Bug 1350754 - Convert pseudo nsIAtom to CSSPseudoElementType in Gecko_UpdateAnimations(). r=heycam

MozReview-Commit-ID: 38ZyRyxB73z

--HG--
extra : rebase_source : 01c971c2db8779f92d5845fa09047cb7eae43c7d
This commit is contained in:
Hiroyuki Ikezoe 2017-03-27 19:43:13 +09:00
Родитель de29155c66
Коммит ee457cf7c3
3 изменённых файлов: 11 добавлений и 8 удалений

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

@ -446,6 +446,9 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aElement);
MOZ_ASSERT(!aPseudoTagOrNull ||
aPseudoTagOrNull == nsCSSPseudoElements::before ||
aPseudoTagOrNull == nsCSSPseudoElements::after);
nsPresContext* presContext = nsContentUtils::GetContextForContent(aElement);
if (!presContext) {
@ -455,9 +458,12 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
if (presContext->IsDynamic() && aElement->IsInComposedDoc()) {
const ServoComputedValuesWithParent servoValues =
{ aComputedValues, aParentComputedValues };
CSSPseudoElementType pseudoType =
nsCSSPseudoElements::GetPseudoType(aPseudoTagOrNull,
CSSEnabledState::eForAllContent);
presContext->AnimationManager()->
UpdateAnimations(const_cast<dom::Element*>(aElement), aPseudoTagOrNull,
UpdateAnimations(const_cast<dom::Element*>(aElement), pseudoType,
servoValues);
}
}

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

@ -1051,7 +1051,7 @@ nsAnimationManager::UpdateAnimations(nsStyleContext* aStyleContext,
void
nsAnimationManager::UpdateAnimations(
dom::Element* aElement,
nsIAtom* aPseudoTagOrNull,
CSSPseudoElementType aPseudoType,
const ServoComputedValuesWithParent& aServoValues)
{
MOZ_ASSERT(mPresContext->IsDynamic(),
@ -1060,18 +1060,15 @@ nsAnimationManager::UpdateAnimations(
"Should not update animations that are not attached to the "
"document tree");
CSSPseudoElementType pseudoType =
nsCSSPseudoElements::GetPseudoType(aPseudoTagOrNull,
CSSEnabledState::eForAllContent);
if (!aServoValues.mCurrentStyle) {
// If we are in a display:none subtree we will have no computed values.
// Since CSS animations should not run in display:none subtrees we should
// stop (actually, destroy) any animations on this element here.
StopAnimationsForElement(aElement, pseudoType);
StopAnimationsForElement(aElement, aPseudoType);
return;
}
NonOwningAnimationTarget target(aElement, pseudoType);
NonOwningAnimationTarget target(aElement, aPseudoType);
ServoCSSAnimationBuilder builder(aServoValues.mCurrentStyle,
aServoValues.mParentStyle);

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

@ -330,7 +330,7 @@ public:
*/
void UpdateAnimations(
mozilla::dom::Element* aElement,
nsIAtom* aPseudoTagOrNull,
mozilla::CSSPseudoElementType aPseudoType,
const mozilla::ServoComputedValuesWithParent& aServoValues);
/**