Bug 1399546: Remove broken code for handling the body text color. r=bholley,Manishearth
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 15 Sep 2017 22:52:26 +0200
changeset 665869 cd3a11354b72de2b9001c2ad83b6f1b7663fd4a0
parent 665868 e354373c68a2853b8b1553b74da2e93c9a99a492
child 665870 f6de9a593c3c3913b483a6606dbcb493369eb3f6
push id80212
push usermaglione.k@gmail.com
push dateSat, 16 Sep 2017 04:24:53 +0000
reviewersbholley, Manishearth
bugs1399546
milestone57.0a1
Bug 1399546: Remove broken code for handling the body text color. r=bholley,Manishearth MozReview-Commit-ID: AfAT9DgzvI7
layout/style/ServoStyleSet.cpp
--- 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);