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 is also available in Dedicated Workers #1519

Closed
1 of 3 tasks
chrisdavidmills opened this issue Jan 20, 2021 · 3 comments
Closed
1 of 3 tasks

requestAnimationFrame is also available in Dedicated Workers #1519

chrisdavidmills opened this issue Jan 20, 2021 · 3 comments
Labels
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

@chrisdavidmills
Copy link
Contributor

@chrisdavidmills commented on Mon Oct 05 2020

@Kaiido commented on Mon Oct 05 2020

Content Issue

  • Please close this issue, I accidentally submitted it without adding any details
  • New documentation
  • Correction or update

URLs of page you are seeing the problem on:

Details

requestAnimationFrame and cancelAnimationFrame used to be Window only methods, but it has recently been added to DedicatedWorkerGlobalScope too. https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#animationframeprovider

interface mixin AnimationFrameProvider {
  unsigned long requestAnimationFrame(FrameRequestCallback callback);
  undefined cancelAnimationFrame(unsigned long handle);
};
Window includes AnimationFrameProvider;
DedicatedWorkerGlobalScope includes AnimationFrameProvider;

I guess the page should now be Web/API/WindowOrWorkerGlobalScope/requestAnimationFrame, but I fear this would break any link to the current /Web/API/window/requestAnimationFrame. So I'm not sure how it should get handled.

Also, compat-data should probably be updated (currently these methods are supported in Blink only).

@hamishwillee
Copy link
Collaborator

hamishwillee commented Jan 22, 2021

Yes the location is a bit messy.

@chrisdavidmills How would this normally be fixed?

My thought is that these should move below AnimationFrameProvider and then in both Window and DedicatedWorkerGlobalScope add them to a section on methods from parent classes (i.e. "Methods implemented from elsewhere" (or similar)).

Probably also a comment in https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API#worker_global_contexts_and_functions

We can support the document move in using the files/en_us/_redirects.txt

Bigger problem is perhaps example code for workers. Could be deferred to a second step.

@hamishwillee
Copy link
Collaborator

hamishwillee commented Jan 22, 2021

@ddbeck The methods window.requestAnimationFrame and window.cancelAnimationFrame are now inherited (from AnimationFrameProvider) by both window and DedicatedWorkerGlobalScope.

How does that get handled in BCD? Do the methods simply get added to DedicatedWorkerGlobalScope (as well)?

Or is it a matter of there being a separate AnimationFrameProvider entry (which will include the web_workers key)? And if the later, how is it obvious that these methods are part of window and DedicatedWorkerGlobalScope? [it looks like this way according to similar cases]

@Rumyra Rumyra added effort: medium This task is a medium effort. and removed 30 minute task labels Nov 29, 2021
@github-actions github-actions bot added the idle label Jan 5, 2022
@sideshowbarker sideshowbarker added the help wanted If you know something about this topic, we would love your help! label Jan 6, 2022
@teoli2003 teoli2003 reopened this May 29, 2022
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 29, 2022
@sideshowbarker sideshowbarker removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 30, 2022
@Josh-Cena
Copy link
Member

Fixed in #23801

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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

6 participants