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

requestAnimationFrame() - Using incorrect type for some browsers #25807

Open
Lectem opened this issue Jan 29, 2025 · 0 comments
Open

requestAnimationFrame() - Using incorrect type for some browsers #25807

Lectem opened this issue Jan 29, 2025 · 0 comments
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Comments

@Lectem
Copy link

Lectem commented Jan 29, 2025

What type of issue is this?

Browser bug (a bug with a feature that may impact site compatibility)

What information was incorrect, unhelpful, or incomplete?

Both Chromium and Webkit use a int (long) instead of unsigned long for the requestAnimationFrame() request ID.
This means it can be negative on overflow.

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet), Safari, Firefox

What did you expect to see?

As per spec, the request ID should be unsigned.

Did you test this? If so, how?

Not fully, using Edge, I estimate the following loop to take ~1.5 hours to finish running and trigger the issue on my PC.
I would run for(let i = 0;i<2147483647;i++) { cancelAnimationFrame(requestAnimationFrame(() => {})); } then console.log(requestAnimationFrame(() => {}));.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

MDN source:

https://developer.mozilla.org/en-US/docs/Web/API/Window/requestAnimationFrame

MDN PR mentionning the issue:

mdn/content#37856

Links to WebKit source:

Link to the same issue in Blink (since based on Webkit):

Note that firefox (merged in july 2024) only recently fixed the issue:

And it gives an error instead of overflowing https://phabricator.services.mozilla.com/rMOZILLACENTRAL149722297f033d5c3ad126d0c72edcb1cb96d72e
https://searchfox.org/mozilla-central/source/dom/base/RequestCallbackManager.h#43

Do you have anything more you want to share?

No response

MDN URL

No response

MDN metadata

No response

@queengooborg queengooborg added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

No branches or pull requests

2 participants