зеркало из https://github.com/mozilla/gecko-dev.git
Bug 996796 patch 23 - Make transition manager ignore StyleContextChanged notifications during an animation-only style update. r=heycam
This will be necessary when we use the restyle tracker for the animation-only style flush.
This commit is contained in:
Родитель
e7c9303e63
Коммит
986f645557
|
@ -1574,8 +1574,15 @@ RestyleManager::UpdateOnlyAnimationStyles()
|
|||
}
|
||||
mLastUpdateForThrottledAnimations = now;
|
||||
|
||||
mPresContext->TransitionManager()->UpdateAllThrottledStyles();
|
||||
mPresContext->AnimationManager()->UpdateAllThrottledStyles();
|
||||
nsTransitionManager* transitionManager = mPresContext->TransitionManager();
|
||||
nsAnimationManager* animationManager = mPresContext->AnimationManager();
|
||||
|
||||
transitionManager->SetInAnimationOnlyStyleUpdate(true);
|
||||
|
||||
transitionManager->UpdateAllThrottledStyles();
|
||||
animationManager->UpdateAllThrottledStyles();
|
||||
|
||||
transitionManager->SetInAnimationOnlyStyleUpdate(false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -163,6 +163,15 @@ nsTransitionManager::StyleContextChanged(dom::Element *aElement,
|
|||
aNewStyleContext->HasPseudoElementData(),
|
||||
"pseudo type mismatch");
|
||||
|
||||
if (mInAnimationOnlyStyleUpdate) {
|
||||
// If we're doing an animation-only style update, return, since the
|
||||
// purpose of an animation-only style update is to update only the
|
||||
// animation styles so that we don't consider style changes
|
||||
// resulting from changes in the animation time for starting a
|
||||
// transition.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!mPresContext->IsDynamic()) {
|
||||
// For print or print preview, ignore transitions.
|
||||
return nullptr;
|
||||
|
|
|
@ -67,6 +67,7 @@ class nsTransitionManager MOZ_FINAL
|
|||
public:
|
||||
nsTransitionManager(nsPresContext *aPresContext)
|
||||
: mozilla::css::CommonAnimationManager(aPresContext)
|
||||
, mInAnimationOnlyStyleUpdate(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -117,6 +118,10 @@ public:
|
|||
nsStyleContext *aOldStyleContext,
|
||||
nsStyleContext *aNewStyleContext);
|
||||
|
||||
void SetInAnimationOnlyStyleUpdate(bool aInAnimationOnlyUpdate) {
|
||||
mInAnimationOnlyStyleUpdate = aInAnimationOnlyUpdate;
|
||||
}
|
||||
|
||||
// nsIStyleRuleProcessor (parts)
|
||||
virtual void RulesMatching(ElementRuleProcessorData* aData) MOZ_OVERRIDE;
|
||||
virtual void RulesMatching(PseudoElementRuleProcessorData* aData) MOZ_OVERRIDE;
|
||||
|
@ -184,6 +189,8 @@ private:
|
|||
nsStyleContext* aParentStyle,
|
||||
nsStyleChangeList &aChangeList);
|
||||
void UpdateAllThrottledStylesInternal();
|
||||
|
||||
bool mInAnimationOnlyStyleUpdate;
|
||||
};
|
||||
|
||||
#endif /* !defined(nsTransitionManager_h_) */
|
||||
|
|
Загрузка…
Ссылка в новой задаче