mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-04 22:37:29 +09:00
parent
c8ee9f4f48
commit
901d2a277f
11 changed files with 99 additions and 73 deletions
|
|
@ -251,6 +251,26 @@ ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
|||
aField.Traverse(&aCallback, aName);
|
||||
}
|
||||
|
||||
// Return the TransitionPhase or AnimationPhase to use when the animation
|
||||
// doesn't have a target effect.
|
||||
template <typename PhaseType>
|
||||
PhaseType GetAnimationPhaseWithoutEffect(const dom::Animation& aAnimation)
|
||||
{
|
||||
MOZ_ASSERT(!aAnimation.GetEffect(),
|
||||
"Should only be called when we do not have an effect");
|
||||
|
||||
Nullable<TimeDuration> currentTime = aAnimation.GetCurrentTime();
|
||||
if (currentTime.IsNull()) {
|
||||
return PhaseType::Idle;
|
||||
}
|
||||
|
||||
// If we don't have a target effect, the duration will be zero so the phase is
|
||||
// 'before' if the current time is less than zero.
|
||||
return currentTime.Value() < TimeDuration()
|
||||
? PhaseType::Before
|
||||
: PhaseType::After;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif /* !defined(mozilla_css_AnimationCommon_h) */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue