Closed Bug 1246046 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: DOM: Animation, defect)

defect
Not set
normal

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 (deleted) —
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) (deleted) — 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+
Status: ASSIGNED → RESOLVED
Closed: 9 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.

Attachment

General

Created:
Updated:
Size: