Bug 1399546: Remove broken code for handling the body text color.
MozReview-Commit-ID: AfAT9DgzvI7
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -1267,51 +1267,21 @@ ServoStyleSet::ClearCachedStyleData()
}
void
ServoStyleSet::CompatibilityModeChanged()
{
Servo_StyleSet_CompatModeChanged(mRawSet.get());
}
-inline static void
-UpdateBodyTextColorIfNeeded(
- const Element& aElement,
- ServoStyleContext& aStyleContext,
- nsPresContext& aPresContext)
-{
- if (aPresContext.CompatibilityMode() != eCompatibility_NavQuirks) {
- return;
- }
-
- if (!aElement.IsHTMLElement(nsGkAtoms::body)) {
- return;
- }
-
- nsIDocument* doc = aElement.GetUncomposedDoc();
- if (!doc || doc->GetBodyElement() != &aElement) {
- return;
- }
-
- MOZ_ASSERT(!aStyleContext.GetPseudo());
-
- // NOTE(emilio): We do the ComputedData() dance to avoid triggering the
- // IsInServoTraversal() assertion in StyleColor(), which seems useful enough
- // in the general case, I guess...
- aPresContext.SetBodyTextColor(
- aStyleContext.ComputedData()->GetStyleColor()->mColor);
-}
-
already_AddRefed<ServoStyleContext>
ServoStyleSet::ResolveServoStyle(Element* aElement)
{
- UpdateStylistIfNeeded();
RefPtr<ServoStyleContext> result =
Servo_ResolveStyle(aElement, mRawSet.get()).Consume();
- UpdateBodyTextColorIfNeeded(*aElement, *result, *mPresContext);
return result.forget();
}
void
ServoStyleSet::ClearNonInheritingStyleContexts()
{
for (RefPtr<ServoStyleContext>& ptr : mNonInheritingStyleContexts) {
ptr = nullptr;
@@ -1369,20 +1339,16 @@ ServoStyleSet::ResolveStyleLazilyInterna
Servo_ResolveStyleLazily(elementForStyleResolution,
pseudoTypeForStyleResolution,
aRuleInclusion,
&Snapshots(),
mRawSet.get(),
aIgnoreExistingStyles).Consume();
}
- if (aPseudoType == CSSPseudoElementType::NotPseudo) {
- UpdateBodyTextColorIfNeeded(*aElement, *computedValues, *mPresContext);
- }
-
return computedValues.forget();
}
bool
ServoStyleSet::AppendFontFaceRules(nsTArray<nsFontFaceRuleContainer>& aArray)
{
UpdateStylistIfNeeded();
Servo_StyleSet_GetFontFaceRules(mRawSet.get(), &aArray);