Backed out 4 changesets (bug 1420117) for mochitest failures layout/style/test/test_counter_descriptor_storage.html r=backout on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Tue, 05 Dec 2017 02:16:59 +0200
changeset 394971 ef99e0f85f43877252d3f39793e48041dd42d8a8
parent 394970 9037e227d8ac796d570cfd094632700dd8abd59e
child 394972 c7633e5266c0da789ce4503fb0a09979efa2580d
push id97987
push usernerli@mozilla.com
push dateTue, 05 Dec 2017 13:52:50 +0000
treeherdermozilla-inbound@8842dba7396b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1420117
milestone59.0a1
backs out2560a150250d769e02fa843d4f254e347dba11ff
5cceea9740eb4ab884d133f5e5ed8de14e0b0db0
83b36cccea28a9b130d3b2ba9c69fb793618ee67
f7292e7fee0e84e26a164cbbe2a38f5eedf44ceb
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
Backed out 4 changesets (bug 1420117) for mochitest failures layout/style/test/test_counter_descriptor_storage.html r=backout on a CLOSED TREE Backed out changeset 2560a150250d (bug 1420117) Backed out changeset 5cceea9740eb (bug 1420117) Backed out changeset 83b36cccea28 (bug 1420117) Backed out changeset f7292e7fee0e (bug 1420117)
layout/style/ServoBindingList.h
layout/style/ServoBindings.toml
layout/style/ServoCSSParser.cpp
layout/style/ServoCSSParser.h
layout/style/nsCSSCounterStyleRule.cpp
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -750,22 +750,15 @@ SERVO_BINDING_FUNC(Servo_ParseIntersecti
                    nsCSSRect* result);
 // Returning false means the parsed transform contains relative lengths or
 // percentage value, so we cannot compute the matrix. In this case, we keep
 // |result| and |contains_3d_transform| as-is.
 SERVO_BINDING_FUNC(Servo_ParseTransformIntoMatrix, bool,
                    const nsAString* value,
                    bool* contains_3d_transform,
                    RawGeckoGfxMatrix4x4* result);
-SERVO_BINDING_FUNC(Servo_ParseCounterStyleName, nsAtom*,
-                   const nsACString* value);
-SERVO_BINDING_FUNC(Servo_ParseCounterStyleDescriptor, bool,
-                   nsCSSCounterDesc aDescriptor,
-                   const nsACString* aValue,
-                   RawGeckoURLExtraData* aURLExtraData,
-                   nsCSSValue* aResult);
 
 // AddRef / Release functions
 #define SERVO_ARC_TYPE(name_, type_)                                \
   SERVO_BINDING_FUNC(Servo_##name_##_AddRef, void, type_##Borrowed) \
   SERVO_BINDING_FUNC(Servo_##name_##_Release, void, type_##Borrowed)
 #include "mozilla/ServoArcTypeList.h"
 #undef SERVO_ARC_TYPE
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -512,17 +512,16 @@ structs-types = [
     "ServoElementSnapshot",
     "ServoElementSnapshotTable",
     "ServoStyleSetSizes",
     "SheetParsingMode",
     "StyleBasicShapeType",
     "StyleShapeSource",
     "StyleTransition",
     "gfxFontFeatureValueSet",
-    "nsCSSCounterDesc",
     "nsCSSCounterStyleRule",
     "nsCSSFontFaceRule",
     "nsCSSKeyword",
     "nsCSSPropertyID",
     "nsCSSPropertyIDSet",
     "nsCSSRect",
     "nsCSSShadowArray",
     "nsCSSUnit",
--- a/layout/style/ServoCSSParser.cpp
+++ b/layout/style/ServoCSSParser.cpp
@@ -27,27 +27,8 @@ ServoCSSParser::ComputeColor(ServoStyleS
 }
 
 /* static */ bool
 ServoCSSParser::ParseIntersectionObserverRootMargin(const nsAString& aValue,
                                                     nsCSSRect* aResult)
 {
   return Servo_ParseIntersectionObserverRootMargin(&aValue, aResult);
 }
-
-/* static */ already_AddRefed<nsAtom>
-ServoCSSParser::ParseCounterStyleName(const nsAString& aValue)
-{
-  NS_ConvertUTF16toUTF8 value(aValue);
-  nsAtom* atom = Servo_ParseCounterStyleName(&value);
-  return already_AddRefed<nsAtom>(atom);
-}
-
-/* static */ bool
-ServoCSSParser::ParseCounterStyleDescriptor(nsCSSCounterDesc aDescriptor,
-                                            const nsAString& aValue,
-                                            URLExtraData* aURLExtraData,
-                                            nsCSSValue& aResult)
-{
-  NS_ConvertUTF16toUTF8 value(aValue);
-  return Servo_ParseCounterStyleDescriptor(aDescriptor, &value, aURLExtraData,
-                                           &aResult);
-}
--- a/layout/style/ServoCSSParser.h
+++ b/layout/style/ServoCSSParser.h
@@ -44,38 +44,13 @@ public:
    * property.
    *
    * @param aValue The rootMargin value.
    * @param aResult The nsCSSRect object to write the result into.
    * @return Whether the value was successfully parsed.
    */
   static bool ParseIntersectionObserverRootMargin(const nsAString& aValue,
                                                   nsCSSRect* aResult);
-
-  /**
-   * Parses a @counter-style name.
-   *
-   * @param aValue The name to parse.
-   * @return The name as an atom, lowercased if a built-in counter style name,
-   *   or nullptr if parsing failed or if the name was invalid (like "inherit").
-   */
-  static already_AddRefed<nsAtom> ParseCounterStyleName(const nsAString& aValue);
-
-  /**
-   * Parses a @counter-style descriptor.
-   *
-   * @param aDescriptor The descriptor to parse.
-   * @param aValue The value of the descriptor.
-   * @param aURLExtraData URL data for parsing. This would be used for
-   *   image value URL resolution.
-   * @param aResult The nsCSSValue to store the result in.
-   * @return Whether parsing succeeded.
-   */
-  static bool
-  ParseCounterStyleDescriptor(nsCSSCounterDesc aDescriptor,
-                              const nsAString& aValue,
-                              URLExtraData* aURLExtraData,
-                              nsCSSValue& aResult);
 };
 
 } // namespace mozilla
 
 #endif // mozilla_ServoCSSParser_h
--- a/layout/style/nsCSSCounterStyleRule.cpp
+++ b/layout/style/nsCSSCounterStyleRule.cpp
@@ -6,17 +6,16 @@
 
 /* a Gecko @counter-style rule */
 
 #include "nsCSSCounterStyleRule.h"
 
 #include "mozAutoDocUpdate.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/dom/CSSCounterStyleRuleBinding.h"
-#include "mozilla/ServoCSSParser.h"
 #include "nsCSSParser.h"
 #include "nsStyleUtil.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 nsCSSCounterStyleRule::nsCSSCounterStyleRule(const nsCSSCounterStyleRule& aCopy)
   : Rule(aCopy)
@@ -128,27 +127,19 @@ nsCSSCounterStyleRule::GetName(nsAString
   nsDependentAtomString name(mName);
   nsStyleUtil::AppendEscapedCSSIdent(name, aName);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsCSSCounterStyleRule::SetName(const nsAString& aName)
 {
-  RefPtr<nsAtom> name;
-
-  nsIDocument* doc = GetDocument();
-  if (!doc || doc->IsStyledByServo()) {
-    name = ServoCSSParser::ParseCounterStyleName(aName);
-  } else {
-    nsCSSParser parser;
-    name = parser.ParseCounterStyleName(aName, nullptr);
-  }
-
-  if (name) {
+  nsCSSParser parser;
+  if (RefPtr<nsAtom> name = parser.ParseCounterStyleName(aName, nullptr)) {
+    nsIDocument* doc = GetDocument();
     MOZ_AUTO_DOC_UPDATE(doc, UPDATE_STYLE, true);
 
     mName = name;
 
     if (StyleSheet* sheet = GetStyleSheet()) {
       sheet->RuleChanged(this);
     }
   }
@@ -407,43 +398,30 @@ nsCSSCounterStyleRule::CheckDescValue(in
       return true;
   }
 }
 
 nsresult
 nsCSSCounterStyleRule::SetDescriptor(nsCSSCounterDesc aDescID,
                                      const nsAString& aValue)
 {
+  nsCSSParser parser;
   nsCSSValue value;
-  bool ok;
-
-  StyleSheet* sheet = GetStyleSheet();
-
-#ifdef MOZ_STYLO
-  bool useServo = !sheet || sheet->IsServo();
-#else
-  bool useServo = false;
-#endif
-
-  if (useServo) {
-    URLExtraData* data = sheet ? sheet->AsServo()->URLData() : nullptr;
-    ok = ServoCSSParser::ParseCounterStyleDescriptor(aDescID, aValue, data,
-                                                     value);
-  } else {
-    nsCSSParser parser;
-    nsIURI* baseURL = sheet ? sheet->GetBaseURI() : nullptr;
-    nsIPrincipal* principal = sheet ? sheet->Principal() : nullptr;
-    ok = parser.ParseCounterDescriptor(aDescID, aValue, nullptr,
-                                       baseURL, principal, value);
+  nsIURI* baseURL = nullptr;
+  nsIPrincipal* principal = nullptr;
+  if (StyleSheet* sheet = GetStyleSheet()) {
+    baseURL = sheet->GetBaseURI();
+    principal = sheet->Principal();
   }
-
-  if (ok && CheckDescValue(GetSystem(), aDescID, value)) {
-    SetDesc(aDescID, value);
+  if (parser.ParseCounterDescriptor(aDescID, aValue, nullptr,
+                                    baseURL, principal, value)) {
+    if (CheckDescValue(GetSystem(), aDescID, value)) {
+      SetDesc(aDescID, value);
+    }
   }
-
   return NS_OK;
 }
 
 #define CSS_COUNTER_DESC_SETTER(name_)                        \
 NS_IMETHODIMP                                                 \
 nsCSSCounterStyleRule::Set##name_(const nsAString& a##name_)  \
 {                                                             \
   return SetDescriptor(eCSSCounterDesc_##name_, a##name_);    \