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
This commit is contained in:
Hiroyuki Ikezoe 2017-08-11 12:55:32 -07:00 committed by Bobby Holley
parent fb03af5d7d
commit 0d870b1b90
5 changed files with 10 additions and 22 deletions

View File

@ -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);

View File

@ -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();

View File

@ -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,

View File

@ -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<ServoStyleContext>
ServoStyleSet::ResolveServoStyle(Element* aElement, ServoTraversalFlags aFlags)
ServoStyleSet::ResolveServoStyle(Element* aElement)
{
UpdateStylistIfNeeded();
RefPtr<ServoStyleContext> result =
Servo_ResolveStyle(aElement,
mRawSet.get(),
aFlags).Consume();
Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
UpdateBodyTextColorIfNeeded(*aElement, *result, *mPresContext);
return result.forget();
}

View File

@ -349,8 +349,7 @@ public:
*
* FIXME(emilio): Is there a point in this after bug 1367904?
*/
already_AddRefed<ServoStyleContext>
ResolveServoStyle(dom::Element* aElement, ServoTraversalFlags aFlags);
already_AddRefed<ServoStyleContext> ResolveServoStyle(dom::Element* aElement);
bool GetKeyframesForName(const nsString& aName,
const nsTimingFunction& aTimingFunction,