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

Issue with "Element.animate()": wrong scenario mentioned #13487

Open
OnkarRuikar opened this issue Mar 4, 2022 · 0 comments
Open

Issue with "Element.animate()": wrong scenario mentioned #13487

OnkarRuikar opened this issue Mar 4, 2022 · 0 comments
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!

Comments

@OnkarRuikar
Copy link
Contributor

MDN URL: https://developer.mozilla.org/en-US/docs/Web/API/Element/animate
and https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Keyframe_Formats

What information was incorrect, unhelpful, or incomplete?

In newer browser versions, you are able to set a beginning or end state for an animation only (i.e. a single keyframe), and the browser will infer the other end of the animation if it is able to.

This mentions two scenarios when only one keyframe is mentioned:

  1. from key frame is inferred. It's the elements current state. The corresponding code snippet covers this case.
  2. to key frame is inferred. In what scenario a browser will be able to infer the end frame given only one frame? Unlike CSS @keyframe rule there are no to and 100% keywords in DOM API. I don't think this scenario is possible. If it is possible, then please provide an example on the pages.
    I think the author is talking about following case:
let rotate360 = [
      { transform: 'rotate(360deg)' },
      {}   // empty keyframe, values are inferred from elements starting state
    ];

But in this case there are two keyframes provided.

Specific section or headline?

https://developer.mozilla.org/en-US/docs/Web/API/Element/animate#implicit_tofrom_keyframes
and also
https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Keyframe_Formats#implicit_tofrom_keyframes

What did you expect to see?

Correct the description saying from frame is inferred if only one keyframe is provided.
Or provide an example for the second scenario.

Did you test this? If so, how?

MDN Content page report details
@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Mar 4, 2022
@sideshowbarker sideshowbarker added help wanted If you know something about this topic, we would love your help! Content:WebAPI Web API docs and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs help wanted If you know something about this topic, we would love your help!
2 participants