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

In the example, isn't the requestAnimationFrame always called more than once if once queued were fired within a single frame? #23635

Open
NewUserHa opened this issue Jan 14, 2023 · 0 comments
Labels
area: DOM/CSSOM Content:WebAPI Web API docs effort: medium This task is a medium effort. help wanted If you know something about this topic, we would love your help!

Comments

@NewUserHa
Copy link

MDN URL

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

What specific section or headline is this issue about?

examples

What information was incorrect, unhelpful, or incomplete?

at the beginning of the article, it says

The callback method is passed a single argument, a DOMHighResTimeStamp, which indicates the current time (based on the number of milliseconds since time origin). When multiple callbacks queued by requestAnimationFrame() begin to fire in a single frame, each receives the same timestamp even though time has passed during the computation of every previous callback's workload

but in the example, if once queued were fired within a single frame happened, weren't there always 2 or more requestAnimationFrame calls made (even those redundant async calls do nothing because previousTimeStamp !== timestamp, but it is still a useless call?)?
In the example, isn't the requestAnimationFrame always called more than once if

What did you expect to see?

maybe when found (previousTimeStamp !== timestamp), it should skip to call a new requestAnimationFrame?

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@NewUserHa NewUserHa added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 14, 2023
@github-actions github-actions bot added the Content:WebAPI Web API docs label Jan 14, 2023
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! effort: medium This task is a medium effort. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DOM/CSSOM Content:WebAPI Web API docs effort: medium This task is a medium effort. help wanted If you know something about this topic, we would love your help!
Projects
None yet
Development

No branches or pull requests

3 participants