From 63fc69069af6f5dd7916e1ec4312472018e1d804 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Wed, 29 Jul 2015 17:31:59 +0200 Subject: [PATCH] Backed out changeset ad38421023a9 (bug 1180125) --- layout/base/nsPresShell.cpp | 1 - layout/style/nsTransitionManager.cpp | 44 +++++----------------------- layout/style/nsTransitionManager.h | 15 ---------- 3 files changed, 8 insertions(+), 52 deletions(-) diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 474dd9be07e5..9868f9c3fa4a 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1252,7 +1252,6 @@ PresShell::Destroy() if (mPresContext) { mPresContext->AnimationManager()->ClearEventQueue(); - mPresContext->TransitionManager()->ClearEventQueue(); } // Revoke any pending events. We need to do this and cancel pending reflows diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp index 5f5314a1bb1c..8cdab123450c 100644 --- a/layout/style/nsTransitionManager.cpp +++ b/layout/style/nsTransitionManager.cpp @@ -117,42 +117,6 @@ CSSTransition::GetAnimationManager() const return context->TransitionManager(); } -void -CSSTransition::QueueEvents() -{ - AnimationPlayState playState = PlayState(); - bool newlyFinished = !mWasFinishedOnLastTick && - playState == AnimationPlayState::Finished; - mWasFinishedOnLastTick = playState == AnimationPlayState::Finished; - - if (!newlyFinished || !mEffect || !mOwningElement.IsSet()) { - return; - } - - dom::Element* owningElement; - nsCSSPseudoElements::Type owningPseudoType; - mOwningElement.GetElement(owningElement, owningPseudoType); - MOZ_ASSERT(owningElement, "Owning element should be set"); - - nsPresContext* presContext = mOwningElement.GetRenderedPresContext(); - if (!presContext) { - return; - } - nsTransitionManager* manager = presContext->TransitionManager(); - - manager->QueueEvent( - TransitionEventInfo(owningElement, TransitionProperty(), - mEffect->Timing().mIterationDuration, - owningPseudoType)); -} - -void -CSSTransition::Tick() -{ - Animation::Tick(); - QueueEvents(); -} - nsCSSProperty CSSTransition::TransitionProperty() const { @@ -953,6 +917,14 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags) ComputedTiming computedTiming = anim->GetEffect()->GetComputedTiming(); if (computedTiming.mPhase == ComputedTiming::AnimationPhase_After) { + nsCSSProperty prop = + anim->GetEffect()->AsTransition()->TransitionProperty(); + TimeDuration duration = + anim->GetEffect()->Timing().mIterationDuration; + mEventDispatcher.QueueEvent( + TransitionEventInfo(collection->mElement, prop, + duration, collection->PseudoElementType())); + // Leave this transition in the list for one more refresh // cycle, since we haven't yet processed its style change, and // if we also have (already, or will have from processing diff --git a/layout/style/nsTransitionManager.h b/layout/style/nsTransitionManager.h index 534436088004..7628f771dc33 100644 --- a/layout/style/nsTransitionManager.h +++ b/layout/style/nsTransitionManager.h @@ -84,7 +84,6 @@ class CSSTransition final : public Animation public: explicit CSSTransition(nsIGlobalObject* aGlobal) : dom::Animation(aGlobal) - , mWasFinishedOnLastTick(false) { } @@ -118,8 +117,6 @@ public: MOZ_ASSERT(mSequenceNum == kUnsequenced); } - void Tick() override; - nsCSSProperty TransitionProperty() const; bool HasLowerCompositeOrderThan(const Animation& aOther) const override; @@ -169,13 +166,9 @@ protected: virtual CommonAnimationManager* GetAnimationManager() const override; - void QueueEvents(); - // The (pseudo-)element whose computed transition-property refers to this // transition (if any). OwningElementRef mOwningElement; - - bool mWasFinishedOnLastTick; }; } // namespace dom @@ -279,14 +272,6 @@ public: void FlushTransitions(FlushFlags aFlags); - void QueueEvent(mozilla::TransitionEventInfo&& aEventInfo) - { - mEventDispatcher.QueueEvent( - mozilla::Forward(aEventInfo)); - } - - void ClearEventQueue() { mEventDispatcher.ClearEventQueue(); } - protected: virtual ~nsTransitionManager() {}