зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset ad38421023a9 (bug 1180125)
This commit is contained in:
Родитель
e7b44f4611
Коммит
63fc69069a
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<mozilla::TransitionEventInfo>(aEventInfo));
|
||||
}
|
||||
|
||||
void ClearEventQueue() { mEventDispatcher.ClearEventQueue(); }
|
||||
|
||||
protected:
|
||||
virtual ~nsTransitionManager() {}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче