moebius#89: DOM - implement animationcancel event

Issue #55
This commit is contained in:
janekptacijarabaci 2018-03-14 11:45:38 +01:00 committed by Roy Tam
commit 901d2a277f
11 changed files with 99 additions and 73 deletions

View file

@ -46,8 +46,6 @@ using mozilla::dom::KeyframeEffectReadOnly;
using namespace mozilla;
using namespace mozilla::css;
typedef mozilla::ComputedTiming::AnimationPhase AnimationPhase;
namespace {
struct TransitionEventParams {
EventMessage mMessage;
@ -203,7 +201,7 @@ CSSTransition::QueueEvents(StickyTimeDuration aActiveTime)
StickyTimeDuration intervalEndTime;
if (!mEffect) {
currentPhase = GetTransitionPhaseWithoutEffect();
currentPhase = GetAnimationPhaseWithoutEffect<TransitionPhase>(*this);
intervalStartTime = zeroDuration;
intervalEndTime = zeroDuration;
} else {
@ -329,23 +327,6 @@ CSSTransition::QueueEvents(StickyTimeDuration aActiveTime)
}
}
CSSTransition::TransitionPhase
CSSTransition::GetTransitionPhaseWithoutEffect() const
{
MOZ_ASSERT(!mEffect, "Should only be called when we do not have an effect");
Nullable<TimeDuration> currentTime = GetCurrentTime();
if (currentTime.IsNull()) {
return TransitionPhase::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()
? TransitionPhase::Before
: TransitionPhase::After;
}
void
CSSTransition::Tick()
{