-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Make sure the animation makes forward progress even if WebKit drops even... #1015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…vents, ticket #12837
|
Tests? Also, have you signed the CLA? |
|
I actually have no idea how to reproduce this bug in any environment I hadn't heard of the CLA before now, but I'm happy to guarantee for |
|
OK, the CLA is submitted. |
src/effects.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very concerned about the cost of an additional setTimeout for every animation tick. But if we're going to incur it, why not move the fxNow || that precedes calls to createFxNow inside of that function instead of creating a new one?
|
I kinda feel like doing |
|
One possible approach to a unit test for this issue would be to run approx 100 animations from 0-100 over 100ms. Ensure that all the values match on all 100 elements (to make sure |
|
@gibson042: If I understand your suggestion, then it would not fix this bug. The point is that |
|
@gnarf37: The First, if calling Second, there is a comment on
I believe that means that some animations depend on this optimization to work synchronously. I haven't seen which ones depend on this behavior, or why they would. This comment just makes me think that there is a reason things were done this way. |
|
@gnarf37: The unit test you describe would pass, whether or not my patch were committed. This bug is only exercised in a Safari browser on iPad. I don't think there's much value in a unit test that passes even when the bug still manifests on a browser. The unit test would have to simulate a broken WebKit somehow to be worth using. |
|
@chadparry I think you misunderstood. I was suggesting first to do nothing unless this can be reliably reproduced, and second—if it is found to be useful—to replace all |
|
The whole point of the opti was to skip the call to The whole reason this was added in the first place - Imagine 100 elements being animated, they all have to have the same startTime if the start in the same JS event frame. They all have to use the same "current time" as well for each tick. Setting the value to undefined at the start of tick I think is probably the most direct solution, It might also allow us to just remove the setTimeout to |
|
Which is why I'm loathe to do anything here... but it seems silly to do But I think you're right that it'd be better to skip the the setTimeout altogether and handle |
|
@gibson042: This bug is reproducible 100% of the time on an iPad, so that makes it easier to investigate. Are you suggesting that you would change In that case, lots more If that's not exactly how you want to change |
|
@gnarf37: I think that you have a great idea. The |
|
In master right now, every tick uses Your change adds the setTimeout previously restricted to But if OR Modify this request to implement something like @gnarf37's suggestion, managing |
|
@gibson042: IIUC, you are suggesting some changes that would make the Anyway, I think @gnarf37 has the best suggestion. |
Revert "Make sure the animation makes forward progress even if WebKit drops events, ticket #12837" This reverts commit 37d7f64.
…vents, second attempt, ticket #12837
|
@gnarf37: I tried to start implementing an enhanced fix. But the code is not very amenable to this idea. The Here is one of the requirements you mentioned:
There are two problems with this requirement. First, if I've updated the pull request with the new code. Instead of assigning I'd like to hear some feedback on this approach before I pursue it further. |
|
There are two |
|
@chadparry https://github.com/jquery/jquery/blob/9346c0ef9938b44f3711d588ebdb6800bc077d8f/src/effects.js#L610-626 -- This is the |
|
It might even make sense to set |
|
http://bugs.jquery.com/ticket/7917 is the original ticket that landed |
+1 |
|
The current |
|
Yes, that makes sense for matching start times associated with the same synchronous window. |
|
Agreed. I'll take another shot at it. |
|
Start up on a new branch, new pull - Please CC @gibson042 and me when you open a new pull. |
Make sure the animation makes forward progress even if WebKit drops events, http://bugs.jquery.com/ticket/12837