From 0d870b1b90fcdc4d611a311406a1b4fca6b74413 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Fri, 11 Aug 2017 12:55:32 -0700 Subject: [PATCH] Bug 1388031 - Cleanup code that was used for verifying styling results for throttled animation flush in post traversal. r=bholley Now that we do process normal traversal even in the case of throttled animation flush so that we don't need to do special handling for the case. Note about the comment in has_current_styles(): the remaining animation hints is not caused by either this patch or the previous patch in this patch series, it's been there in the first place, but it should be fixed somehow later. See bug 1389675. MozReview-Commit-ID: JojHufxNCiS --- layout/base/ServoRestyleManager.cpp | 10 +++------- layout/base/nsCSSFrameConstructor.cpp | 3 +-- layout/style/ServoBindingList.h | 4 +--- layout/style/ServoStyleSet.cpp | 12 ++++-------- layout/style/ServoStyleSet.h | 3 +-- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/layout/base/ServoRestyleManager.cpp b/layout/base/ServoRestyleManager.cpp index 9e5db006ae5f..2f8dfec6d52a 100644 --- a/layout/base/ServoRestyleManager.cpp +++ b/layout/base/ServoRestyleManager.cpp @@ -422,9 +422,7 @@ ServoRestyleManager::ClearRestyleStateFromSubtree(Element* aElement) } bool wasRestyled; - Unused << Servo_TakeChangeHint(aElement, - ServoTraversalFlags::Empty, - &wasRestyled); + Unused << Servo_TakeChangeHint(aElement, &wasRestyled); aElement->UnsetHasDirtyDescendantsForServo(); aElement->UnsetHasAnimationOnlyDirtyDescendantsForServo(); aElement->UnsetFlags(NODE_DESCENDANTS_NEED_FRAMES); @@ -705,9 +703,7 @@ ServoRestyleManager::ProcessPostTraversal( // Grab the change hint from Servo. bool wasRestyled; - nsChangeHint changeHint = Servo_TakeChangeHint(aElement, - aFlags, - &wasRestyled); + nsChangeHint changeHint = Servo_TakeChangeHint(aElement, &wasRestyled); // We should really fix the weird primary frame mapping for image maps // (bug 135040)... @@ -799,7 +795,7 @@ ServoRestyleManager::ProcessPostTraversal( if (wasRestyled && oldStyleContext) { MOZ_ASSERT(styleFrame || displayContentsStyle); newContext = - aRestyleState.StyleSet().ResolveServoStyle(aElement, aFlags); + aRestyleState.StyleSet().ResolveServoStyle(aElement); MOZ_ASSERT(oldStyleContext->ComputedData() != newContext->ComputedData()); newContext->ResolveSameStructsAs(oldStyleContext); diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 1024d1689cfe..f44f1fd1aeec 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1960,8 +1960,7 @@ nsCSSFrameConstructor::CreateGeneratedContentItem(nsFrameConstructorState& aStat // and replace old one. mPresShell->StyleSet()->AsServo()->StyleNewSubtree(container); pseudoStyleContext = - styleSet->AsServo()->ResolveServoStyle(container, - ServoTraversalFlags::Empty); + styleSet->AsServo()->ResolveServoStyle(container); } } else { mozilla::GeckoRestyleManager* geckoRM = RestyleManager()->AsGecko(); diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h index 8e424f824e93..0cc48c9c468a 100644 --- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -504,12 +504,10 @@ SERVO_BINDING_FUNC(Servo_NoteExplicitHints, void, RawGeckoElementBorrowed elemen SERVO_BINDING_FUNC(Servo_TakeChangeHint, nsChangeHint, RawGeckoElementBorrowed element, - mozilla::ServoTraversalFlags flags, bool* was_restyled) SERVO_BINDING_FUNC(Servo_ResolveStyle, ServoStyleContextStrong, RawGeckoElementBorrowed element, - RawServoStyleSetBorrowed set, - mozilla::ServoTraversalFlags flags) + RawServoStyleSetBorrowed set) SERVO_BINDING_FUNC(Servo_ResolveStyleAllowStale, ServoStyleContextStrong, RawGeckoElementBorrowed element) SERVO_BINDING_FUNC(Servo_ResolvePseudoStyle, ServoStyleContextStrong, diff --git a/layout/style/ServoStyleSet.cpp b/layout/style/ServoStyleSet.cpp index 78b28adfcacd..b5dc320560d4 100644 --- a/layout/style/ServoStyleSet.cpp +++ b/layout/style/ServoStyleSet.cpp @@ -245,7 +245,7 @@ ServoStyleSet::ResolveStyleFor(Element* aElement, aElement, CSSPseudoElementType::NotPseudo, nullptr, aParentContext); } - return ResolveServoStyle(aElement, ServoTraversalFlags::Empty); + return ResolveServoStyle(aElement); } /** @@ -458,9 +458,7 @@ ServoStyleSet::ResolvePseudoElementStyle(Element* aOriginatingElement, if (aPseudoElement) { MOZ_ASSERT(aType == aPseudoElement->GetPseudoElementType()); computedValues = - Servo_ResolveStyle(aPseudoElement, - mRawSet.get(), - ServoTraversalFlags::Empty).Consume(); + Servo_ResolveStyle(aPseudoElement, mRawSet.get()).Consume(); } else { bool cacheable = !nsCSSPseudoElements::IsEagerlyCascadedInServo(aType) && aParentContext; @@ -1247,13 +1245,11 @@ UpdateBodyTextColorIfNeeded( } already_AddRefed -ServoStyleSet::ResolveServoStyle(Element* aElement, ServoTraversalFlags aFlags) +ServoStyleSet::ResolveServoStyle(Element* aElement) { UpdateStylistIfNeeded(); RefPtr result = - Servo_ResolveStyle(aElement, - mRawSet.get(), - aFlags).Consume(); + Servo_ResolveStyle(aElement, mRawSet.get()).Consume(); UpdateBodyTextColorIfNeeded(*aElement, *result, *mPresContext); return result.forget(); } diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h index 20ca942ee657..7ea57a10bd71 100644 --- a/layout/style/ServoStyleSet.h +++ b/layout/style/ServoStyleSet.h @@ -349,8 +349,7 @@ public: * * FIXME(emilio): Is there a point in this after bug 1367904? */ - already_AddRefed - ResolveServoStyle(dom::Element* aElement, ServoTraversalFlags aFlags); + already_AddRefed ResolveServoStyle(dom::Element* aElement); bool GetKeyframesForName(const nsString& aName, const nsTimingFunction& aTimingFunction,