Closed
Bug 686656
Opened 13 years ago
Closed 13 years ago
[css3-animations] when animations interrupted by restyle, implicit 0% or 100% values (from base value) pick up value from animation
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
FIXED
mozilla9
People
(Reporter: maxaks, Assigned: bzbarsky)
Details
Attachments
(3 files, 1 obsolete file)
1.23 KB,
text/html; charset=UTF-8
|
Details | |
5.43 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
2.02 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0a1) Gecko/20110913 Firefox/9.0a1 Build ID: 20110913030846 Steps to reproduce: I was trying to animate the border-color property between a base value (specified out of the @keyframes ruleset) and another value in a keyframe. Actual results: After a Repaint event, the starting value of the animated property is no longer the base value, but the value which was active before the Repaint event. See the attached example: Resizing the window triggers a Repaint and "blocks" the starting value of the animation. For the first box, for example, the starting value becomes "black", and the animation therefore goes between "black" and "black". Expected results: Animation should continue properly, like it was just after the page load. The specification does indeed say that you must include rules for at least the times 0% (or from) and 100% (or to), but doesn't indicate clearly if the starting value can not be defined elsewhere (as in, NOT in the keyframe rule). This works in webkit.
Attachment #560138 -
Attachment mime type: text/plain → text/html; charset=UTF-8
Assignee | ||
Comment 1•13 years ago
|
||
Confirming. David, any idea what's up here?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: CSS3 animations not rendered properly after repaint event → Restyling parent element stops CSS3 animations on children
Assignee | ||
Comment 2•13 years ago
|
||
If there were transitions involved, I would think that the problem is including the transition rules when reparenting or something. But that shouldn't matter for animations, should it?
Assignee | ||
Comment 3•13 years ago
|
||
And in fact we explicitly skip transition rules when reparenting. Maybe we need to do that for animations too?
Assignee | ||
Comment 4•13 years ago
|
||
If I do that, it seems to fix the bug.
So what's supposed to prevent this is that nsAnimationManager::CheckAnimationRule only calls BuildAnimations when !mPresContext->IsProcessingAnimationStyleChange(). (BuildAnimations is where we use the base value if there's nothing specified for 0% or 100%.) I think the problem is that that's not sufficient for the cases where !mPresContext->IsProcessingRestyles(). Some untested work-in-progress is at: https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/96b7d4e5eda0/animation-with-restyle but I'm pretty busy right now; may not have time to finish it for a bit. (Boris, I'm curious if you think this makes sense -- my assumption is that with the async stuff we've done lately that reframes that result from processing restyles will actually lead to the new frames being created after mPresContext->IsProcessingRestyles() is no longer true -- but I could be wrong there, in which case this fix would actually be sufficient.)
OS: Windows 7 → All
Hardware: x86 → All
Summary: Restyling parent element stops CSS3 animations on children → [css3-animations] when animations interrupted by restyle, implicit 0% or 100% values (from base value) pick up value from animation
Version: 9 Branch → Trunk
(I wrote comment 5 before seeing comments 1 - 4, but submitted it anyway over the collision.)
OK, bz and I just discussed this; the reframing for restyles is sync, so bz's fix should be all that necessary. But we should have a test that triggers both the reframing and non-reframing cases.
Assignee | ||
Comment 8•13 years ago
|
||
Attachment #560286 -
Flags: review?(dbaron)
Without your patch, I get 1 failure: failed | bug 686656 test 1 at 625ms - got 100px, expected 50px and with your patch the test passes.
Attachment #561317 -
Flags: review?(bzbarsky)
Comment on attachment 560286 [details] [diff] [review] Make sure to skip animation rules as well as transition rules when we're reparenting a style context when not processing an animation restyle. r=dbaron
Attachment #560286 -
Flags: review?(dbaron) → review+
Also, I'd like to add some assertions, but they fire too much; need to investigate: https://hg.mozilla.org/users/dbaron_mozilla.com/patches/raw-file/2f99515c87d4/unapplied.assert-check-animation-rule Also, I realize the comment in the test is a bit misleading -- the 100% case doesn't actually matter since the animation has ended by the point we test. I should probably add 'forwards' to the animation lines in both cases; then the 1000ms test should also fail without the patch. I should check that...
with -moz-animation-fill-mode: forwards
Attachment #561317 -
Attachment is obsolete: true
Attachment #561317 -
Flags: review?(bzbarsky)
Attachment #561319 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 13•13 years ago
|
||
Comment on attachment 561319 [details] [diff] [review] test r=me
Attachment #561319 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 14•13 years ago
|
||
http://hg.mozilla.org/integration/mozilla-inbound/rev/1ed711ae0b35 http://hg.mozilla.org/integration/mozilla-inbound/rev/c18a3ab59221
Assignee: nobody → bzbarsky
Flags: in-testsuite+
Priority: -- → P3
Target Milestone: --- → mozilla9
Comment 15•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/1ed711ae0b35 https://hg.mozilla.org/mozilla-central/rev/c18a3ab59221
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•