Skip to content
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

ios: Patch cancelAnimationFrame whenever fakeRequestAnimationFrame is used #8222

Merged

Conversation

tjgrathwell
Copy link

The existing implementation of fakeRequestAnimationFrame
did not return a timer ID, so the frame could not be cancelled
if you wanted to cancel it. But if you do want to cancel it,
it needs to be cancelled through clearTimeout instead of
cancelAnimationFrame, because the timer IDs are different.

ex, without the patch this wouldn't work in iOS:

var frameId = requestAnimationFrame(function() { console.log("called"); });
// do some work
if(!stillNeedsToAnimate) { cancelAnimationFrame(frameId); }

… used

The existing implementation of fakeRequestAnimationFrame
did not return a timer ID, so the frame could not be cancelled
if you wanted to cancel it. But if you do want to cancel it,
it needs to be cancelled through clearTimeout instead of
cancelAnimationFrame, because the timer IDs are different.

Signed-off-by: Jonathan Barnes <[email protected]>
@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

pdfjsbot commented Apr 4, 2017

From: Bot.io (Windows)


Received

Command cmd_test from @yurydelendik received. Current queue size: 1

Live output at: http://54.215.176.217:8877/6658f26013393a5/output.txt

@pdfjsbot
Copy link

pdfjsbot commented Apr 4, 2017

From: Bot.io (Linux)


Received

Command cmd_test from @yurydelendik received. Current queue size: 1

Live output at: http://107.21.233.14:8877/aca0daee0aeccaa/output.txt

Copy link
Contributor

@yurydelendik yurydelendik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pdfjsbot
Copy link

pdfjsbot commented Apr 4, 2017

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/6658f26013393a5/output.txt

Total script time: 23.25 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

pdfjsbot commented Apr 4, 2017

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/aca0daee0aeccaa/output.txt

Total script time: 29.21 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@yurydelendik yurydelendik merged commit b665b03 into mozilla:master Apr 4, 2017
@yurydelendik
Copy link
Contributor

Thank you for the patch.

@yurydelendik yurydelendik mentioned this pull request Apr 13, 2017
movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
…ation-frame

ios: Patch cancelAnimationFrame whenever fakeRequestAnimationFrame is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants