mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1171817 part 8 - Override sequence numbers for CSS animations; r=dbaron
This patch re-uses Animation::mSequenceNum to store the index of CSS animations within their corresponding animation-name property. When the animation is removed from an animation-name property it reverts to using the default animation composite order. This patch also updates Animation::DoCancel to call UpdateTiming instead of UpdateEffect. This is because UpdateTiming is responsible for updating the sequence number (when custom composite order is not in effect). When we remove an animation from animation-name it will be cancelled and at that point we expect its sequence number to be cleared which will only happen if UpdateTiming gets called.
This commit is contained in:
parent
c65aa49bb3
commit
d85df33a58
@ -444,7 +444,7 @@ Animation::DoCancel()
|
||||
mHoldTime.SetNull();
|
||||
mStartTime.SetNull();
|
||||
|
||||
UpdateEffect();
|
||||
UpdateTiming(SeekFlag::NoSeek);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -420,6 +420,8 @@ nsAnimationManager::CheckAnimationRule(nsStyleContext* aStyleContext,
|
||||
}
|
||||
}
|
||||
|
||||
oldAnim->CopyAnimationIndex(*newAnim->AsCSSAnimation());
|
||||
|
||||
if (animationChanged) {
|
||||
nsNodeUtils::AnimationChanged(oldAnim);
|
||||
}
|
||||
@ -553,6 +555,7 @@ nsAnimationManager::BuildAnimations(nsStyleContext* aStyleContext,
|
||||
|
||||
nsRefPtr<CSSAnimation> dest = new CSSAnimation(aTimeline, src.GetName());
|
||||
dest->SetOwningElement(*aTarget, aStyleContext->GetPseudoType());
|
||||
dest->SetAnimationIndex(static_cast<uint64_t>(animIdx));
|
||||
aAnimations.AppendElement(dest);
|
||||
|
||||
AnimationTiming timing;
|
||||
|
@ -101,10 +101,25 @@ public:
|
||||
mOwningPseudoType = nsCSSPseudoElements::ePseudo_NotPseudoElement;
|
||||
|
||||
Animation::CancelFromStyle();
|
||||
MOZ_ASSERT(mSequenceNum == kUnsequenced);
|
||||
}
|
||||
|
||||
bool IsStylePaused() const { return mIsStylePaused; }
|
||||
|
||||
bool IsUsingCustomCompositeOrder() const override { return !!mOwningElement; }
|
||||
|
||||
void SetAnimationIndex(uint64_t aIndex)
|
||||
{
|
||||
MOZ_ASSERT(IsUsingCustomCompositeOrder());
|
||||
mSequenceNum = aIndex;
|
||||
}
|
||||
void CopyAnimationIndex(const CSSAnimation& aOther)
|
||||
{
|
||||
MOZ_ASSERT(IsUsingCustomCompositeOrder() &&
|
||||
aOther.IsUsingCustomCompositeOrder());
|
||||
mSequenceNum = aOther.mSequenceNum;
|
||||
}
|
||||
|
||||
void QueueEvents(EventArray& aEventsToDispatch);
|
||||
|
||||
// Returns the element or pseudo-element whose animation-name property
|
||||
|
Loading…
Reference in New Issue
Block a user