mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1109390 part 17 - Add Animation::IsInPlay(); r=jwatt
This patch adds a method for testing if an animation is "in play" which is a term defined in the Web Animations spec. This is in preparation for removing some slightly redundant code in IsRunning and aligning better with the spec.
This commit is contained in:
parent
dea70a395d
commit
0c22048a6a
@ -229,6 +229,18 @@ Animation::ActiveDuration(const AnimationTiming& aTiming)
|
||||
aTiming.mIterationDuration.MultDouble(aTiming.mIterationCount));
|
||||
}
|
||||
|
||||
// http://w3c.github.io/web-animations/#in-play
|
||||
bool
|
||||
Animation::IsInPlay(const AnimationPlayer& aPlayer) const
|
||||
{
|
||||
if (IsFinishedTransition() ||
|
||||
aPlayer.PlayState() == AnimationPlayState::Finished) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return GetComputedTiming().mPhase == ComputedTiming::AnimationPhase_Active;
|
||||
}
|
||||
|
||||
// http://w3c.github.io/web-animations/#current
|
||||
bool
|
||||
Animation::IsCurrent(const AnimationPlayer& aPlayer) const
|
||||
|
@ -302,6 +302,7 @@ public:
|
||||
mIsFinishedTransition = true;
|
||||
}
|
||||
|
||||
bool IsInPlay(const AnimationPlayer& aPlayer) const;
|
||||
bool IsCurrent(const AnimationPlayer& aPlayer) const;
|
||||
bool IsInEffect() const;
|
||||
|
||||
|
@ -203,6 +203,10 @@ public:
|
||||
}
|
||||
bool IsRunning() const;
|
||||
|
||||
bool HasInPlaySource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsInPlay(*this);
|
||||
}
|
||||
bool HasCurrentSource() const
|
||||
{
|
||||
return GetSource() && GetSource()->IsCurrent(*this);
|
||||
|
Loading…
Reference in New Issue
Block a user