Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

polyfill for cancelAnimationFrame is broken #326

Closed
manolo opened this issue Apr 14, 2016 · 1 comment
Closed

polyfill for cancelAnimationFrame is broken #326

manolo opened this issue Apr 14, 2016 · 1 comment

Comments

@manolo
Copy link

manolo commented Apr 14, 2016

The pachTimer for AnimationFrame prevents animation requests to be cancelled.

This code does not write anything in console normally, but when angular2-polyfills.js is loaded, the callback is executed:

  var callback = function() {
    console.log("Done")
  }
  var i = window.requestAnimationFrame(callback);
  window.cancelAnimationFrame(i);
@jwoyame
Copy link

jwoyame commented May 24, 2016

Looking at this code in browser.ts:

patchTimer(_global, 'request', 'cancelMacroTask', 'AnimationFrame');
patchTimer(_global, 'mozRequest', 'mozCancel', 'AnimationFrame');
patchTimer(_global, 'webkitRequest', 'webkitCancel', 'AnimationFrame');

Shouldn't it be 'cancel' on the first line, instead of 'cancelMacroTask'? That 'MacroTask' string seems out of place.

tom5760 added a commit to tom5760/zone.js that referenced this issue May 25, 2016
Call cancelAnimationFrame instead of cancelMicroTaskAnimationFrame.

Fixes angular#326 and Leaflet/Leaflet#4588
mhevery pushed a commit that referenced this issue Jun 6, 2016
Call cancelAnimationFrame instead of cancelMicroTaskAnimationFrame.

Fixes #326 and Leaflet/Leaflet#4588
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants