Backed out 4 changesets (bug 1465628) for Eslint failure. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Tue, 05 Jun 2018 04:00:30 +0300
changeset 475536 a9e6e98ff2c2abe8986d24221cb2c4ae7204a5ba
parent 475535 04f276eb2f0ea509ded9f185c0f3287ba3b91b87
child 475537 f2ba9f18c051cb8e9e110d28152cadbac3040676
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1465628
milestone62.0a1
backs out04f276eb2f0ea509ded9f185c0f3287ba3b91b87
e9cdff1227930054a35a2af291a3f945b99f5e08
6832baa28e3fa16dc59480f9f475a85e6aca65c3
e5ac0c7a9fb49d3d011095283014bae7324361d0
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 1465628) for Eslint failure. CLOSED TREE Backed out changeset 04f276eb2f0e (bug 1465628) Backed out changeset e9cdff122793 (bug 1465628) Backed out changeset 6832baa28e3f (bug 1465628) Backed out changeset e5ac0c7a9fb4 (bug 1465628)
devtools/shared/css/generated/generate-properties-db.js
devtools/shared/css/generated/mach_commands.py
devtools/shared/css/generated/properties-db.js
devtools/shared/tests/unit/test_css-properties-db.js
dom/chrome-webidl/InspectorUtils.webidl
layout/inspector/InspectorUtils.cpp
layout/inspector/InspectorUtils.h
layout/style/GenerateCSSPropsGenerated.py
layout/style/nsCSSProps.cpp
layout/style/nsCSSProps.h
--- a/devtools/shared/css/generated/generate-properties-db.js
+++ b/devtools/shared/css/generated/generate-properties-db.js
@@ -15,17 +15,16 @@ const InspectorUtils = require("Inspecto
 
 // xpcshell can output extra information, so place some delimiter text between
 // the output of the css properties database.
 dump("DEVTOOLS_CSS_DB_DELIMITER");
 
 // Output JSON
 dump(JSON.stringify({
   cssProperties: cssProperties(),
-  preferences: preferences(),
   pseudoElements: pseudoElements()
 }));
 
 dump("DEVTOOLS_CSS_DB_DELIMITER");
 
 /*
  * A list of CSS Properties and their various characteristics. This is used on the
  * client-side when the CssPropertiesActor is not found, or when the client and server
@@ -43,25 +42,13 @@ function cssProperties() {
     if (key.includes("-moz-osx-")) {
       properties[key] = undefined;
     }
   }
   return properties;
 }
 
 /**
- * A list of preferences of CSS properties.
- */
-function preferences() {
-  const prefs = InspectorUtils.getCSSPropertyPrefs();
-  let result = [];
-  for (let {name, pref} of prefs) {
-    result.push([name, pref]);
-  }
-  return result;
-}
-
-/**
  * The list of all CSS Pseudo Elements.
  */
 function pseudoElements() {
   return InspectorUtils.getCSSPseudoElementNames();
 }
--- a/devtools/shared/css/generated/mach_commands.py
+++ b/devtools/shared/css/generated/mach_commands.py
@@ -36,23 +36,38 @@ def stringify(obj):
 class MachCommands(MachCommandBase):
     @Command(
         'devtools-css-db', category='post-build',
         description='Rebuild the devtool\'s static css properties database.')
     def generate_css_db(self):
         """Generate the static css properties database for devtools and write it to file."""
 
         print("Re-generating the css properties database...")
+        preferences = self.get_preferences()
         db = self.get_properties_db_from_xpcshell()
 
         self.output_template({
-            'preferences': stringify(db['preferences']),
+            'preferences': stringify(preferences),
             'cssProperties': stringify(db['cssProperties']),
             'pseudoElements': stringify(db['pseudoElements'])})
 
+    def get_preferences(self):
+        """Get all of the preferences associated with enabling and disabling a property."""
+        # The data takes the following form:
+        # [ (name, prop, id, flags, pref, proptype), ... ]
+        dataPath = resolve_path(self.topobjdir, 'layout/style/ServoCSSPropList.py')
+        data = runpy.run_path(dataPath)['data']
+
+        # Map this list
+        preferences = [
+            (p.name, p.pref) for p in data
+            if 'CSSPropFlags::Internal' not in p.flags and p.pref]
+
+        return preferences
+
     def get_properties_db_from_xpcshell(self):
         """Generate the static css properties db for devtools from an xpcshell script."""
         build = MozbuildObject.from_environment()
 
         # Get the paths
         script_path = resolve_path(self.topsrcdir,
             'devtools/shared/css/generated/generate-properties-db.js')
         gre_path = resolve_path(self.topobjdir, 'dist/bin')
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -2963,24 +2963,16 @@ exports.CSS_PROPERTIES = {
       "-webkit-text-fill-color",
       "-webkit-text-stroke-color",
       "-webkit-text-stroke-width",
       "ruby-align",
       "ruby-position",
       "text-combine-upright",
       "text-rendering",
       "-moz-control-character-visibility",
-      "cursor",
-      "pointer-events",
-      "-moz-user-input",
-      "-moz-user-modify",
-      "-moz-user-focus",
-      "caret-color",
-      "scrollbar-face-color",
-      "scrollbar-track-color",
       "list-style-position",
       "list-style-type",
       "list-style-image",
       "quotes",
       "-moz-image-region",
       "margin-top",
       "margin-right",
       "margin-bottom",
@@ -2992,16 +2984,22 @@ exports.CSS_PROPERTIES = {
       "-moz-outline-radius-topright",
       "-moz-outline-radius-bottomright",
       "-moz-outline-radius-bottomleft",
       "outline-offset",
       "padding-top",
       "padding-right",
       "padding-bottom",
       "padding-left",
+      "cursor",
+      "pointer-events",
+      "-moz-user-input",
+      "-moz-user-modify",
+      "-moz-user-focus",
+      "caret-color",
       "top",
       "right",
       "bottom",
       "left",
       "z-index",
       "flex-direction",
       "flex-wrap",
       "justify-content",
@@ -9255,24 +9253,16 @@ exports.PREFERENCES = [
     "scroll-snap-type-x",
     "layout.css.scroll-snap.enabled"
   ],
   [
     "scroll-snap-type-y",
     "layout.css.scroll-snap.enabled"
   ],
   [
-    "scrollbar-face-color",
-    "layout.css.scrollbar-colors.enabled"
-  ],
-  [
-    "scrollbar-track-color",
-    "layout.css.scrollbar-colors.enabled"
-  ],
-  [
     "shape-image-threshold",
     "layout.css.shape-outside.enabled"
   ],
   [
     "shape-margin",
     "layout.css.shape-outside.enabled"
   ],
   [
--- a/devtools/shared/tests/unit/test_css-properties-db.js
+++ b/devtools/shared/tests/unit/test_css-properties-db.js
@@ -31,34 +31,36 @@ function run_test() {
                                  "assertion run `mach devtools-css-db` to re-generate " +
                                  "the client side properties.";
 
   // Check that the platform and client match for pseudo elements.
   deepEqual(PSEUDO_ELEMENTS, InspectorUtils.getCSSPseudoElementNames(),
             "The pseudo elements match on the client and platform. " +
             propertiesErrorMessage);
 
-  let prefs = InspectorUtils.getCSSPropertyPrefs();
-  deepEqual(PREFERENCES, prefs.map(({name, pref}) => [name, pref]),
-            "The preferences match on the client and platform. " +
-            propertiesErrorMessage);
-
   /**
    * Check that the platform and client match for the details on their CSS properties.
    * Enumerate each property to aid in debugging. Sometimes these properties don't
    * completely agree due to differences in preferences. Check the currently set
    * preference for that property to see if it's enabled.
    */
   const platformProperties = generateCssProperties();
 
   for (const propertyName in CSS_PROPERTIES) {
     const platformProperty = platformProperties[propertyName];
     const clientProperty = CSS_PROPERTIES[propertyName];
     const deepEqual = isJsonDeepEqual(platformProperty, clientProperty);
 
+    // The "all" property can contain information that can be turned on and off by
+    // preferences. These values can be different between OSes, so ignore the equality
+    // check for this property, since this is likely to fail.
+    if (propertyName === "all") {
+      continue;
+    }
+
     if (deepEqual) {
       ok(true, `The static database and platform match for "${propertyName}".`);
     } else {
       ok(false, `The static database and platform do not match for ` + `
         "${propertyName}". ${propertiesErrorMessage}`);
     }
   }
 
--- a/dom/chrome-webidl/InspectorUtils.webidl
+++ b/dom/chrome-webidl/InspectorUtils.webidl
@@ -28,17 +28,16 @@ namespace InspectorUtils {
                                              unsigned long selectorIndex);
   [Throws] boolean selectorMatchesElement(
       Element element,
       CSSStyleRule rule,
       unsigned long selectorIndex,
       [TreatNullAs=EmptyString] optional DOMString pseudo = "");
   boolean isInheritedProperty(DOMString property);
   sequence<DOMString> getCSSPropertyNames(optional PropertyNamesOptions options);
-  sequence<PropertyPref> getCSSPropertyPrefs();
   [Throws] sequence<DOMString> getCSSValuesForProperty(DOMString property);
   [Throws] DOMString rgbToColorName(octet r, octet g, octet b);
   InspectorRGBATuple? colorToRGBA(DOMString colorString);
   boolean isValidCSSColor(DOMString colorString);
   [Throws] sequence<DOMString> getSubpropertiesForCSSProperty(DOMString property);
   [Throws] boolean cssPropertyIsShorthand(DOMString property);
 
   // TODO: Change this to use an enum.
@@ -81,21 +80,16 @@ namespace InspectorUtils {
 };
 
 dictionary PropertyNamesOptions {
   boolean includeAliases = false;
   boolean includeShorthands = true;
   boolean includeExperimentals = false;
 };
 
-dictionary PropertyPref {
-  required DOMString name;
-  required DOMString pref;
-};
-
 dictionary InspectorRGBATuple {
   /*
    * NOTE: This tuple is in the normal 0-255-sized RGB space but can be
    * fractional and may extend outside the 0-255 range.
    *
    * a is in the range 0 - 1.
    */
   double r = 0;
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -394,29 +394,16 @@ InspectorUtils::GetCSSPropertyNames(Glob
   if (aOptions.mIncludeAliases) {
     for (prop = eCSSProperty_COUNT; prop < eCSSProperty_COUNT_with_aliases; ++prop) {
       appendProperty(prop);
     }
   }
 }
 
 /* static */ void
-InspectorUtils::GetCSSPropertyPrefs(GlobalObject& aGlobalObject,
-                                    nsTArray<PropertyPref>& aResult)
-{
-  for (const auto* src = nsCSSProps::kPropertyPrefTable;
-       src->mPropID != eCSSProperty_UNKNOWN; src++) {
-    PropertyPref& dest = *aResult.AppendElement();
-    const nsCString& name = nsCSSProps::GetStringValue(src->mPropID);
-    dest.mName.Assign(NS_ConvertASCIItoUTF16(name));
-    dest.mPref.AssignASCII(src->mPref);
-  }
-}
-
-/* static */ void
 InspectorUtils::GetSubpropertiesForCSSProperty(GlobalObject& aGlobal,
                                                const nsAString& aProperty,
                                                nsTArray<nsString>& aResult,
                                                ErrorResult& aRv)
 {
   nsCSSPropertyID propertyID =
     nsCSSProps::LookupProperty(aProperty, CSSEnabledState::eForAllContent);
 
--- a/layout/inspector/InspectorUtils.h
+++ b/layout/inspector/InspectorUtils.h
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 #ifndef mozilla_dom_InspectorUtils_h
 #define mozilla_dom_InspectorUtils_h
 
-#include "mozilla/dom/InspectorUtilsBinding.h"
+#include "mozilla/dom/BindingDeclarations.h"
 
 class nsAtom;
 class nsIDocument;
 class ComputedStyle;
 
 namespace mozilla {
 class StyleSheet;
 namespace css {
@@ -109,21 +109,16 @@ public:
                                   const nsAString& aPropertyName);
 
   // Get a list of all our supported property names.  Optionally
   // property aliases included.
   static void GetCSSPropertyNames(GlobalObject& aGlobal,
                                   const PropertyNamesOptions& aOptions,
                                   nsTArray<nsString>& aResult);
 
-  // Get a list of all properties controlled by preference, as well as
-  // their corresponding preference names.
-  static void GetCSSPropertyPrefs(GlobalObject& aGlobal,
-                                  nsTArray<PropertyPref>& aResult);
-
   // Get a list of all valid keywords and colors for aProperty.
   static void GetCSSValuesForProperty(GlobalObject& aGlobal,
                                       const nsAString& aPropertyName,
                                       nsTArray<nsString>& aResult,
                                       ErrorResult& aRv);
 
   // Utilities for working with CSS colors
   static void RgbToColorName(GlobalObject& aGlobal,
--- a/layout/style/GenerateCSSPropsGenerated.py
+++ b/layout/style/GenerateCSSPropsGenerated.py
@@ -28,19 +28,19 @@ class PropertyWrapper(object):
 def generate(output, dataFile):
     output.write("""/* THIS IS AN AUTOGENERATED FILE.  DO NOT EDIT */
 
 /* processed file that defines CSS property tables that can't be generated
    with the pre-processor, designed to be #included in nsCSSProps.cpp */
 
 """)
 
-    raw_properties = runpy.run_path(dataFile)["data"]
+    properties = runpy.run_path(dataFile)["data"]
     properties = [PropertyWrapper(i, p)
-                  for i, p in enumerate(raw_properties)
+                  for i, p in enumerate(properties)
                   if p.type() != "alias"]
 
     # Generate kIDLNameTable
     output.write("const char* const nsCSSProps::"
                  "kIDLNameTable[eCSSProperty_COUNT] = {\n")
     for p in properties:
         if p.idlname is None:
             output.write("  nullptr,  // {}\n".format(p.name))
@@ -53,30 +53,16 @@ def generate(output, dataFile):
     ps = [(p, position) for position, p in enumerate(ps)]
     ps.sort(key=lambda (p, position): p.index)
     output.write("const int32_t nsCSSProps::"
                  "kIDLNameSortPositionTable[eCSSProperty_COUNT] = {\n")
     for (p, position) in ps:
         output.write("  {},\n".format(position))
     output.write("};\n\n")
 
-    # Generate preferences table
-    output.write("const nsCSSProps::PropertyPref "
-                 "nsCSSProps::kPropertyPrefTable[] = {\n")
-    for p in raw_properties:
-        if not p.pref:
-            continue
-        if p.type() != "alias":
-            prop_id = "eCSSProperty_" + p.id
-        else:
-            prop_id = "eCSSPropertyAlias_" + p.alias_id
-        output.write("  {{ {}, \"{}\" }},\n".format(prop_id, p.pref))
-    output.write("  { eCSSProperty_UNKNOWN, nullptr },\n")
-    output.write("};\n\n")
-
     # Generate shorthand subprop tables
     names = []
     for p in properties:
         if p.type() != "shorthand":
             continue
         name = "g{}SubpropTable".format(p.method)
         names.append(name)
         output.write("static const nsCSSPropertyID {}[] = {{\n".format(name))
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -118,21 +118,35 @@ nsCSSProps::AddRefTable(void)
       if (kIDLNameTable[p]) {
         gPropertyIDLNameTable->Put(nsDependentCString(kIDLNameTable[p]), p);
       }
     }
 
     static bool prefObserversInited = false;
     if (!prefObserversInited) {
       prefObserversInited = true;
-      for (const PropertyPref* pref = kPropertyPrefTable;
-           pref->mPropID != eCSSProperty_UNKNOWN; pref++) {
-        bool* enabled = &gPropertyEnabled[pref->mPropID];
-        Preferences::AddBoolVarCache(enabled, pref->mPref);
-      }
+
+      #define OBSERVE_PROP(pref_, id_)                                        \
+        if (pref_[0]) {                                                       \
+          Preferences::AddBoolVarCache(&gPropertyEnabled[id_],                \
+                                       pref_);                                \
+        }
+
+      #define CSS_PROP_LONGHAND(name_, id_, method_, flags_, pref_) \
+        OBSERVE_PROP(pref_, eCSSProperty_##id_)
+      #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
+        OBSERVE_PROP(pref_, eCSSProperty_##id_)
+      #define CSS_PROP_ALIAS(name_, aliasid_, id_, method_, pref_) \
+        OBSERVE_PROP(pref_, eCSSPropertyAlias_##aliasid_)
+      #include "mozilla/ServoCSSPropList.h"
+      #undef CSS_PROP_ALIAS
+      #undef CSS_PROP_SHORTHAND
+      #undef CSS_PROP_LONGHAND
+
+      #undef OBSERVE_PROP
     }
   }
 }
 
 #undef  DEBUG_SHORTHANDS_CONTAINING
 
 void
 nsCSSProps::ReleaseTable(void)
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -242,22 +242,16 @@ public:
         PropHasFlags(aProperty, Flags::EnabledInChrome))
     {
       return true;
     }
     return false;
   }
 
 public:
-  struct PropertyPref
-  {
-    nsCSSPropertyID mPropID;
-    const char* mPref;
-  };
-  static const PropertyPref kPropertyPrefTable[];
 
 // Storing the enabledstate_ value in an nsCSSPropertyID variable is a small hack
 // to avoid needing a separate variable declaration for its real type
 // (CSSEnabledState), which would then require using a block and
 // therefore a pair of macros by consumers for the start and end of the loop.
 #define CSSPROPS_FOR_SHORTHAND_SUBPROPERTIES(it_, prop_, enabledstate_)   \
   for (const nsCSSPropertyID *it_ = nsCSSProps::SubpropertyEntryFor(prop_), \
                             es_ = (nsCSSPropertyID)((enabledstate_) |       \