Bug 1449566 - Remove GenericSpecifiedValues::ShouldIgnoreColors. r=emilio
☠☠ backed out by 9eee0f48055b ☠ ☠
authorJonathan Watt <jwatt@jwatt.org>
Fri, 23 Mar 2018 16:40:12 +0000
changeset 410484 72f9188800afb4dec5b69d0a9066bb0453c61fbc
parent 410483 763277b299e42d8ee7eafede027ee690b66a7a2a
child 410485 c31de7e26809522daca72a6050cd3ab665e8f6ff
push id33729
push userrgurzau@mozilla.com
push dateWed, 28 Mar 2018 21:55:49 +0000
treeherdermozilla-central@6aa3b57955fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1449566
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1449566 - Remove GenericSpecifiedValues::ShouldIgnoreColors. r=emilio
dom/html/HTMLBodyElement.cpp
dom/html/HTMLFontElement.cpp
dom/html/HTMLHRElement.cpp
dom/html/HTMLTableElement.cpp
dom/html/nsGenericHTMLElement.cpp
layout/style/GenericSpecifiedValues.h
layout/style/GenericSpecifiedValuesInlines.h
--- a/dom/html/HTMLBodyElement.cpp
+++ b/dom/html/HTMLBodyElement.cpp
@@ -211,18 +211,17 @@ HTMLBodyElement::MapAttributesIntoRule(c
       value = aAttributes->GetAttr(nsGkAtoms::vlink);
       if (value && value->GetColorValue(color)) {
         styleSheet->SetVisitedLinkColor(color);
       }
     }
   }
 
   if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Color))) {
-    if (!aData->PropertyIsSet(eCSSProperty_color) &&
-        !aData->ShouldIgnoreColors()) {
+    if (!aData->PropertyIsSet(eCSSProperty_color)) {
       // color: color
       nscolor color;
       const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::text);
       if (value && value->GetColorValue(color)) {
         aData->SetColorValue(eCSSProperty_color, color);
       }
     }
   }
--- a/dom/html/HTMLFontElement.cpp
+++ b/dom/html/HTMLFontElement.cpp
@@ -70,18 +70,17 @@ HTMLFontElement::MapAttributesIntoRule(c
     // size: int
     if (!aData->PropertyIsSet(eCSSProperty_font_size)) {
       const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::size);
       if (value && value->Type() == nsAttrValue::eInteger)
         aData->SetKeywordValue(eCSSProperty_font_size, value->GetIntegerValue());
     }
   }
   if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Color))) {
-    if (!aData->PropertyIsSet(eCSSProperty_color) &&
-        !aData->ShouldIgnoreColors()) {
+    if (!aData->PropertyIsSet(eCSSProperty_color)) {
       // color: color
       const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::color);
       nscolor color;
       if (value && value->GetColorValue(color)) {
         aData->SetColorValue(eCSSProperty_color, color);
       }
     }
   }
--- a/dom/html/HTMLHRElement.cpp
+++ b/dom/html/HTMLHRElement.cpp
@@ -162,17 +162,17 @@ HTMLHRElement::MapAttributesIntoRule(con
            *props != eCSSProperty_UNKNOWN; ++props) {
         aData->SetPixelValueIfUnset(*props, 10000.0f);
       }
     }
   }
   if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Color))) {
     // color: a color
     // (we got the color attribute earlier)
-    if (colorIsSet && !aData->ShouldIgnoreColors()) {
+    if (colorIsSet) {
       aData->SetColorValueIfUnset(eCSSProperty_color, color);
     }
   }
 
   nsGenericHTMLElement::MapWidthAttributeInto(aAttributes, aData);
   nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
 }
 
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -985,17 +985,17 @@ HTMLTableElement::MapAttributesIntoRule(
         aData->SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)value->GetIntegerValue());
       }
     }
   }
   if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Border))) {
     // bordercolor
     const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bordercolor);
     nscolor color;
-    if (value && !aData->ShouldIgnoreColors() && value->GetColorValue(color)) {
+    if (value && value->GetColorValue(color)) {
       aData->SetColorValueIfUnset(eCSSProperty_border_top_color, color);
       aData->SetColorValueIfUnset(eCSSProperty_border_left_color, color);
       aData->SetColorValueIfUnset(eCSSProperty_border_bottom_color, color);
       aData->SetColorValueIfUnset(eCSSProperty_border_right_color, color);
     }
 
     // border
     const nsAttrValue* borderValue = aAttributes->GetAttr(nsGkAtoms::border);
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1470,36 +1470,34 @@ nsGenericHTMLElement::MapImageBorderAttr
 void
 nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
                                         GenericSpecifiedValues* aData)
 {
 
   if (!aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Background)))
     return;
 
-  if (!aData->PropertyIsSet(eCSSProperty_background_image) &&
-      !aData->ShouldIgnoreColors()) {
+  if (!aData->PropertyIsSet(eCSSProperty_background_image)) {
     // background
     nsAttrValue* value =
       const_cast<nsAttrValue*>(aAttributes->GetAttr(nsGkAtoms::background));
     if (value) {
       aData->SetBackgroundImage(*value);
     }
   }
 }
 
 void
 nsGenericHTMLElement::MapBGColorInto(const nsMappedAttributes* aAttributes,
                                      GenericSpecifiedValues* aData)
 {
   if (!aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Background)))
     return;
 
-  if (!aData->PropertyIsSet(eCSSProperty_background_color) &&
-      !aData->ShouldIgnoreColors()) {
+  if (!aData->PropertyIsSet(eCSSProperty_background_color)) {
     const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bgcolor);
     nscolor color;
     if (value && value->GetColorValue(color)) {
       aData->SetColorValue(eCSSProperty_background_color, color);
     }
   }
 }
 
--- a/layout/style/GenericSpecifiedValues.h
+++ b/layout/style/GenericSpecifiedValues.h
@@ -41,19 +41,16 @@ protected:
 public:
   MOZ_DECL_STYLO_METHODS(nsRuleData, ServoSpecifiedValues)
 
   nsIDocument* Document()
   {
     return mDocument;
   }
 
-  // Whether we should ignore document colors.
-  inline bool ShouldIgnoreColors() const;
-
   // Check if we already contain a certain longhand
   inline bool PropertyIsSet(nsCSSPropertyID aId);
 
   // Check if we are able to hold longhands from a given
   // style struct. Pass the result of NS_STYLE_INHERIT_BIT to this
   // function. Can accept multiple inherit bits or'd together.
   inline bool ShouldComputeStyleStruct(uint64_t aInheritBits)
   {
--- a/layout/style/GenericSpecifiedValuesInlines.h
+++ b/layout/style/GenericSpecifiedValuesInlines.h
@@ -19,25 +19,16 @@
 
 namespace mozilla {
 
 MOZ_DEFINE_STYLO_METHODS(GenericSpecifiedValues,
                          nsRuleData,
                          ServoSpecifiedValues)
 
 bool
-GenericSpecifiedValues::ShouldIgnoreColors() const
-{
-  // Servo handles this during cascading.
-  //
-  // FIXME(emilio): We should eventually move it to the document though.
-  return false;
-}
-
-bool
 GenericSpecifiedValues::PropertyIsSet(nsCSSPropertyID aId)
 {
   MOZ_STYLO_FORWARD(PropertyIsSet, (aId))
 }
 
 void
 GenericSpecifiedValues::SetIdentStringValue(nsCSSPropertyID aId,
                                             const nsString& aValue)