Closed
Bug 1268385
Opened 9 years ago
Closed 9 years ago
isRunningOnCompositor should be cleared when associating nsIFrame is destroyed.
Categories
(Core :: DOM: Animation, defect)
Core
DOM: Animation
Tracking
()
RESOLVED
FIXED
mozilla49
Tracking | Status | |
---|---|---|
firefox49 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
Details
Attachments
(1 file)
Assignee | ||
Comment 1•9 years ago
|
||
Assignee | ||
Comment 2•9 years ago
|
||
It's my first time I see TEST-UNEXPECTED-PASS on try.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b00fbf1c0545
Assignee | ||
Comment 3•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52664/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/52664/
Attachment #8752613 -
Flags: review?(bbirtles)
Updated•9 years ago
|
Attachment #8752613 -
Flags: review?(bbirtles) → review+
Comment 4•9 years ago
|
||
Comment on attachment 8752613 [details]
MozReview Request: Bug 1268385 - Clear isRunningOnCompositor for script animations if associated nsIFrame is destroyed. r?birtles
https://reviewboard.mozilla.org/r/52664/#review49632
Thanks for doing this!
::: dom/animation/KeyframeEffect.h:340
(Diff revision 1)
> // will be used to generate a localized message for devtools.
> void SetPerformanceWarning(
> nsCSSProperty aProperty,
> const AnimationPerformanceWarning& aWarning);
>
> + void ResetIsRunningOnCompositor();
Shouldn't this move to just after SetIsRunningOnCompositor?
(And we should probably change the order in the .cpp file too, I guess.)
::: layout/base/RestyleManager.cpp:1159
(Diff revision 1)
> + // Script animations should keep running but not running on the
> + // *compositor* at this point.
> + EffectSet* effectSet = EffectSet::GetEffectSet(element, aPseudoType);
> + if (effectSet) {
> + for (KeyframeEffectReadOnly* effect : *effectSet) {
> + effect->ResetIsRunningOnCompositor();
> + }
> + }
So I was a little surprised that this works. I guess that [1] is not called?
In fact, I guess once we no longer have a frame *none* of the places that would normally reset the compositor status get reached?
In that case, this makes sense.
One very minor nit: Rather than 'script animations', perhaps we could say 'All other animations (e.g. those created using the Web Animations API)'.
The reason is that there will be some animations which are created by CSS, cancelled from CSS, but kept alive by script--so they kind of blur the line a bit.
[1] https://dxr.mozilla.org/mozilla-central/rev/4a8ed77f6bb573f20980056bf8c1dadd125c1a85/layout/base/FrameLayerBuilder.cpp#1907
Assignee | ||
Comment 5•9 years ago
|
||
https://reviewboard.mozilla.org/r/52664/#review49632
> Shouldn't this move to just after SetIsRunningOnCompositor?
>
> (And we should probably change the order in the .cpp file too, I guess.)
Ah, that's right. Thanks.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8752613 [details]
MozReview Request: Bug 1268385 - Clear isRunningOnCompositor for script animations if associated nsIFrame is destroyed. r?birtles
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52664/diff/1-2/
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Brian Birtles (:birtles) from comment #4)
> ::: layout/base/RestyleManager.cpp:1159
> (Diff revision 1)
> > + // Script animations should keep running but not running on the
> > + // *compositor* at this point.
> > + EffectSet* effectSet = EffectSet::GetEffectSet(element, aPseudoType);
> > + if (effectSet) {
> > + for (KeyframeEffectReadOnly* effect : *effectSet) {
> > + effect->ResetIsRunningOnCompositor();
> > + }
> > + }
>
> So I was a little surprised that this works. I guess that [1] is not called?
No. I don't remember clearly but I think the purpose of ClearAnimationCompositorState was mainly for animation.pause(). For the case when corresponding nsIFrame is still there but corresponding display item is not there any more. It might not be necessary any more due to recent recent refactorings related to EffectCompositor.
> In fact, I guess once we no longer have a frame *none* of the places that
> would normally reset the compositor status get reached?
>
> In that case, this makes sense.
>
> One very minor nit: Rather than 'script animations', perhaps we could say
> 'All other animations (e.g. those created using the Web Animations API)'.
>
> The reason is that there will be some animations which are created by CSS,
> cancelled from CSS, but kept alive by script--so they kind of blur the line
> a bit.
It makes very sense. Thanks.
Comment 9•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Updated•9 years ago
|
Assignee: nobody → hiikezoe
You need to log in
before you can comment on or make changes to this bug.
Description
•