You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngAnimate + $$RAFProvider : crashes when browser doesn't support requestAnimationFrame or is prefixed with 'moz' #6535
I would be happy to make a pull request on this but my question is :
is it best to add a fallback on a timeout directly in the RAFProvider or to check for the supportedproperty every time it is used ?
I think just adding the mozRequestAnimationFrame would be a good start.
Yes let's add mozRequestAnimationFrame. All browsers that support CSS animations/transitions also support RAF, therefore, there is no reason to fallback to timeout anymore.
I didn't think that Firefox still needed it. I guess the error showed up on an older version of FF.
Yes indeed the error occurs in an old version of FF (20).
The fact is that if the browser doesn't support RAF (I am thinking of IE8 for example) the code will simply crash.
What is weird is that there is the property supported (false if the browser doesn't support rAF) but it is never checked wherever the rAF service is used.
All browsers that support CSS animations/transitions also support RAF
That's not true. Opera has had transitions since 10.5 (which is really old) and even the latest Presto-based version, 12.16 doesn't have rAF. Opera Presto is still popular in some countries like Russia.
Right. Yes. My mistake on this. I'm putting together a patch that uses the $timeout code with a low value: $timeout(callback, 1000 / 60); and updating the tests to support it.
@matsko If you're putting the timeout in, maybe the moz-prefixed version doesn't matter anymore? Hardly anyone uses old Fx versions so it's mostly so that they work, not necessarily in the most performant way.
Angular 2.0 is a rewrite anyway so the $timeout fallback will live in Angular 1.x forever.
Activity
matsko commentedon Mar 4, 2014
Yes let's add
mozRequestAnimationFrame. All browsers that support CSS animations/transitions also support RAF, therefore, there is no reason to fallback to timeout anymore.I didn't think that Firefox still needed it. I guess the error showed up on an older version of FF.
matsko commentedon Mar 4, 2014
Can you verify that adding
mozRequestAnimationFrameandmozCancelAnimationFramefixes the issue?atomrc commentedon Mar 4, 2014
Yes indeed the error occurs in an old version of FF (20).
The fact is that if the browser doesn't support RAF (I am thinking of IE8 for example) the code will simply crash.
What is weird is that there is the property
supported(false if the browser doesn't support rAF) but it is never checked wherever the rAF service is used.fix (ngAnimate $rAF): fix requestAnimationFrame for old version of Fi…
fix (ngAnimate $rAF): fix requestAnimationFrame for old version of Fi…
fix (ngAnimate $rAF): fix requestAnimationFrame for old version of Fi…
fix (ngAnimate): fix requestAnimationFrame for old version of Firefox
mgol commentedon Mar 14, 2014
@matsko
That's not true. Opera has had transitions since 10.5 (which is really old) and even the latest Presto-based version, 12.16 doesn't have rAF. Opera Presto is still popular in some countries like Russia.
matsko commentedon Mar 14, 2014
Right. Yes. My mistake on this. I'm putting together a patch that uses the
$timeoutcode with a low value:$timeout(callback, 1000 / 60);and updating the tests to support it.mgol commentedon Mar 14, 2014
@matsko If you're putting the timeout in, maybe the
moz-prefixed version doesn't matter anymore? Hardly anyone uses old Fx versions so it's mostly so that they work, not necessarily in the most performant way.Angular 2.0 is a rewrite anyway so the
$timeoutfallback will live in Angular 1.x forever.tbosch commentedon Mar 14, 2014
I agree with @mzgol, e.g. Android 2.3 browsers don't support rAF but do support CSS transitions/animations.
mgol commentedon Mar 14, 2014
@tbosch Not only 2.3. :) No Android Browser version supports requestAnimationFrame, only Chrome mobile does: http://caniuse.com/requestanimationframe
fix (ngAnimate): fix requestAnimationFrame for old version of Firefox
dcherman commentedon Sep 27, 2015
Why are we adding this? Per the browser support policy at https://docs.angularjs.org/misc/faq#what-browsers-does-angular-work-with-, only the latest versions of Firefox are supported; it's a hard sell to consider 20 as a new version.