Closed Bug 1246046 Opened 4 years ago Closed 4 years ago

Pausing and seeking a play-pending animation does not render as expected

Categories

(Core :: DOM: Animation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: birtles, Assigned: birtles)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file Test case
In the attached test case, we pause an animation and seek it but nothing is rendered. It should render a box with width: 75px, and height: 100px. Inspecting the console output, however, reveals that the computed style is updated.

If we wait for anim.ready before pausing and seeking then it works.
Assignee: nobody → bbirtles
Status: NEW → ASSIGNED
Attached patch WIP patch (obsolete) — Splinter Review
It seems like the issue is that nsStyleSet::GetContext doesn't pick up the animation rule in the case where we *only* have script generated animations.

This patch is a hacky fix to demonstrate the problem.

We probably need to refactor nsAnimationManager::CheckAnimationRule so that it simply updates the state of CSS animations. Then we should have a separate step that fetches the animation rule for either case.
As for an automated test, we *could* use a reftest, but I can also reproduce this by calling getComputedStyle in attachment 8716131 [details] some time later... perhaps on the next frame. Then I get back "0px" for the width.
Apparently Chrome got a bug report that the following test works in Firefox but not in Chrome:

  https://jsfiddle.net/ur1cp5d6/

Upon investigation, this test should *not* work and fixing this bug makes us behave like Chrome.
Without this patch, when we have script generated animations but *no* CSS
animations, nsStyleSet::GetContext will not use the updated animation rule.
Attachment #8717766 - Flags: review?(cam)
Attachment #8716187 - Attachment is obsolete: true
Attachment #8717766 - Flags: review?(cam) → review+
Attachment #8717767 - Flags: review?(cam) → review+
https://hg.mozilla.org/mozilla-central/rev/ab454c4469b7
https://hg.mozilla.org/mozilla-central/rev/08f313ec397a
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
Depends on: 1249274
You need to log in before you can comment on or make changes to this bug.