Closed
Bug 1241770
Opened 9 years ago
Closed 9 years ago
EffectCompositeOrderComparator should consider same animations in EffectSet in some cases.
Categories
(Core :: DOM: Animation, defect)
Core
DOM: Animation
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
firefox46 | --- | affected |
People
(Reporter: hiro, Assigned: hiro)
References
Details
Attachments
(2 files, 1 obsolete file)
1.03 KB,
patch
|
Details | Diff | Splinter Review | |
1.97 KB,
patch
|
Details | Diff | Splinter Review |
Currently we create new temporary animations in nsAnimationManager::BuildAnimations when animation style is updated. If EffectCompositeOrderComparator is used while
EffectSet has both new temporary animation and current animation corresponding to the new animation.
Fortunately we are not facing such cases in automation tests (and real world?). But we will face the cases soon once we have the fixes for bug 1166500. An example is a try result with the fixes[1].
[1] https://treeherder.mozilla.org/logviewer.html#?job_id=15711955&repo=try
We should take case such cases in EffectCompositeOrderComparator.
Assignee | ||
Comment 1•9 years ago
|
||
As far as I can tell there are two cases:
a) animation index is different
b) the same animation index but AnimationProperty or AnimationEffectTiming in KeyframeEffectReadOnly is different.
Assignee | ||
Comment 3•9 years ago
|
||
If we do it before PlayFromStyle, EffectSet has two animation which has the same index.
This patch makes test_animations-dynamic-changes.html failure at https://dxr.mozilla.org/mozilla-central/rev/66e07ef46853709e3fa91e7c9ad9fe6abf0d5f06/dom/animation/test/css-animations/file_animations-dynamic-changes.html#144
firstAddedAnimation is positioned at the second place in getAnimations' array somehow.
I am now investigating the reason.
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #3)
> This patch makes test_animations-dynamic-changes.html failure at
> https://dxr.mozilla.org/mozilla-central/rev/
> 66e07ef46853709e3fa91e7c9ad9fe6abf0d5f06/dom/animation/test/css-animations/
> file_animations-dynamic-changes.html#144
>
> firstAddedAnimation is positioned at the second place in getAnimations'
> array somehow.
> I am now investigating the reason.
I found the reason.
The reason is that anim2 in file_animations-dynamic-changes.html has empty keyframe.
Animations have empty keyframe skips at [1], so we need to set animation index before the skip.
[1] https://dxr.mozilla.org/mozilla-central/source/layout/style/nsAnimationManager.cpp#661
Attachment #8710884 -
Attachment is obsolete: true
Comment 5•9 years ago
|
||
Can't we just avoid putting two effects with equivalent Animations in the EffectSet at once? That seems like the more correct (and efficient) thing to do here.
Assignee | ||
Comment 6•9 years ago
|
||
Thanks! That makes much sense! I will try it.
Assignee | ||
Comment 7•9 years ago
|
||
(In reply to Brian Birtles (:birtles, away 23~31 Jan, busy 1~9 Feb) from comment #5)
> Can't we just avoid putting two effects with equivalent Animations in the
> EffectSet at once? That seems like the more correct (and efficient) thing to
> do here.
To compare animations (and effects) properly we need to set all properties and timing for the effect before calling SetEffect. To achieve this we should move a bunch of stuff in BuildAnimations into another KeyframeEffectReadOnly constructor.
Assignee | ||
Comment 8•9 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #7)
> (In reply to Brian Birtles (:birtles, away 23~31 Jan, busy 1~9 Feb) from
> comment #5)
> > Can't we just avoid putting two effects with equivalent Animations in the
> > EffectSet at once? That seems like the more correct (and efficient) thing to
> > do here.
>
> To compare animations (and effects) properly we need to set all properties
> and timing for the effect before calling SetEffect. To achieve this we
> should move a bunch of stuff in BuildAnimations into another
> KeyframeEffectReadOnly constructor.
I had overlooked CSS animation's name. I was going to check the equality of Animations in EffectSet::AddEffect(), but there are other animations which don't have the name in the function.
I am going to do the check in BuildAnimations for now.
Assignee | ||
Comment 9•9 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #8)
> (In reply to Hiroyuki Ikezoe (:hiro) from comment #7)
> > (In reply to Brian Birtles (:birtles, away 23~31 Jan, busy 1~9 Feb) from
> > comment #5)
> > > Can't we just avoid putting two effects with equivalent Animations in the
> > > EffectSet at once? That seems like the more correct (and efficient) thing to
> > > do here.
> >
> > To compare animations (and effects) properly we need to set all properties
> > and timing for the effect before calling SetEffect. To achieve this we
> > should move a bunch of stuff in BuildAnimations into another
> > KeyframeEffectReadOnly constructor.
>
> I had overlooked CSS animation's name. I was going to check the equality of
> Animations in EffectSet::AddEffect(), but there are other animations which
> don't have the name in the function.
>
> I am going to do the check in BuildAnimations for now.
It turns out we should refactor CheckAnimationRule and BuildAnimations to avoid creating temporary animations. I'd want to do such refactoring once we fix bug 1166500, so I'd like to take part 1 and 2 patches here.
Brian, what do you think?
Flags: needinfo?(bbirtles)
Comment 10•9 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #9)
> (In reply to Hiroyuki Ikezoe (:hiro) from comment #8)
> > (In reply to Hiroyuki Ikezoe (:hiro) from comment #7)
> > > (In reply to Brian Birtles (:birtles, away 23~31 Jan, busy 1~9 Feb) from
> > > comment #5)
> > > > Can't we just avoid putting two effects with equivalent Animations in the
> > > > EffectSet at once? That seems like the more correct (and efficient) thing to
> > > > do here.
> > >
> > > To compare animations (and effects) properly we need to set all properties
> > > and timing for the effect before calling SetEffect. To achieve this we
> > > should move a bunch of stuff in BuildAnimations into another
> > > KeyframeEffectReadOnly constructor.
> >
> > I had overlooked CSS animation's name. I was going to check the equality of
> > Animations in EffectSet::AddEffect(), but there are other animations which
> > don't have the name in the function.
> >
> > I am going to do the check in BuildAnimations for now.
>
> It turns out we should refactor CheckAnimationRule and BuildAnimations to
> avoid creating temporary animations. I'd want to do such refactoring once
> we fix bug 1166500, so I'd like to take part 1 and 2 patches here.
>
> Brian, what do you think?
Yes, I think we should avoid creating temporary animations in BuildAnimations (and perhaps create some simplified representation of them?)
I'm a bit concerned about adding part 1. It's a pretty expensive comparison to do every time we sort animations. I'd like to avoid adding that cost if possible.
Do we need *both* parts 1 and 2?
Assignee | ||
Comment 11•9 years ago
|
||
(In reply to Brian Birtles (:birtles, away 23~31 Jan, busy 1~9 Feb) from comment #10)
> > It turns out we should refactor CheckAnimationRule and BuildAnimations to
> > avoid creating temporary animations. I'd want to do such refactoring once
> > we fix bug 1166500, so I'd like to take part 1 and 2 patches here.
> >
> > Brian, what do you think?
>
> Yes, I think we should avoid creating temporary animations in
> BuildAnimations (and perhaps create some simplified representation of them?)
>
> I'm a bit concerned about adding part 1. It's a pretty expensive comparison
> to do every time we sort animations. I'd like to avoid adding that cost if
> possible.
>
> Do we need *both* parts 1 and 2?
Yes. And your concern is quite right. OK. I can go with the refactoring. We need the refactoring anyway sooner or later. Now it's the time.
Assignee | ||
Comment 13•9 years ago
|
||
Fixed by bug 1242872.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•