Bug 1026302 part 2 - Move PostRestyleForAnimation to CommonElementAnimationData; r=dbaron

This patch moves PostRestyleForAnimation from ElementAnimations to the base
class CommonElementAnimationData and makes use of it within nsTransitionManager.
This commit is contained in:
Brian Birtles 2014-06-23 10:48:01 +09:00
Родитель 00e736ff46
Коммит d01a278fc3
3 изменённых файлов: 8 добавлений и 18 удалений

Просмотреть файл

@ -491,6 +491,11 @@ struct CommonElementAnimationData : public PRCList
}
}
void PostRestyleForAnimation(nsPresContext *aPresContext) {
nsRestyleHint styleHint = IsForElement() ? eRestyle_Self : eRestyle_Subtree;
aPresContext->PresShell()->RestyleForAnimation(mElement, styleHint);
}
static void LogAsyncAnimationFailure(nsCString& aMessage,
const nsIContent* aContent = nullptr);

Просмотреть файл

@ -61,11 +61,6 @@ struct ElementAnimations MOZ_FINAL
nsAnimationManager *aAnimationManager, TimeStamp aNow);
void GetEventsAt(TimeStamp aRefreshTime, EventArray &aEventsToDispatch);
void PostRestyleForAnimation(nsPresContext *aPresContext) {
nsRestyleHint styleHint = IsForElement() ? eRestyle_Self : eRestyle_Subtree;
aPresContext->PresShell()->RestyleForAnimation(mElement, styleHint);
}
};
class nsAnimationManager MOZ_FINAL

Просмотреть файл

@ -597,12 +597,7 @@ nsTransitionManager::ConsiderStartingTransition(nsCSSProperty aProperty,
}
}
aElementTransitions->UpdateAnimationGeneration(mPresContext);
nsRestyleHint hint =
aNewStyleContext->GetPseudoType() ==
nsCSSPseudoElements::ePseudo_NotPseudoElement ?
eRestyle_Self : eRestyle_Subtree;
presContext->PresShell()->RestyleForAnimation(aElement, hint);
aElementTransitions->PostRestyleForAnimation(presContext);
*aStartedAny = true;
aWhichStarted->AddProperty(aProperty);
@ -682,10 +677,7 @@ nsTransitionManager::WalkTransitionRule(ElementDependentRuleProcessorData* aData
// We need to immediately restyle with animation
// after doing this.
nsRestyleHint hint =
aPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement ?
eRestyle_Self : eRestyle_Subtree;
mPresContext->PresShell()->RestyleForAnimation(aData->mElement, hint);
et->PostRestyleForAnimation(mPresContext);
return;
}
@ -877,9 +869,7 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags)
et->mElementProperty == nsGkAtoms::transitionsOfAfterProperty,
"Unexpected element property; might restyle too much");
if (!canThrottleTick || transitionStartedOrEnded) {
nsRestyleHint hint = et->mElementProperty == nsGkAtoms::transitionsProperty ?
eRestyle_Self : eRestyle_Subtree;
mPresContext->PresShell()->RestyleForAnimation(et->mElement, hint);
et->PostRestyleForAnimation(mPresContext);
} else {
didThrottle = true;
}