Bug 1333482 part 3 - [css-ui] Put 'appearance' and '-moz-appearance' behind separate prefs. Enable both by default. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Thu, 23 Mar 2017 23:13:18 +0100
changeset 349335 af3341f277444d3f3057f3f3eb0b49c38c27a287
parent 349334 cf701cfc024972be7bb703aace2b9d88e6f27115
child 349336 62474fd399f8bde1e09ed3787845326b076bd5db
push id31550
push usercbook@mozilla.com
push dateFri, 24 Mar 2017 13:22:27 +0000
treeherdermozilla-central@473e0b201761 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1333482
milestone55.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 1333482 part 3 - [css-ui] Put 'appearance' and '-moz-appearance' behind separate prefs. Enable both by default. r=dholbert MozReview-Commit-ID: 7f5jqm8z3Vy
layout/style/nsCSSPropList.h
layout/style/test/property_database.js
modules/libpref/init/all.js
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -459,28 +459,30 @@ CSS_PROP_DISPLAY(
     VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
     kTransitionTimingFunctionKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_None)
 CSS_PROP_DISPLAY(
     -moz-appearance,
     _moz_appearance,
     MozAppearance,
-    CSS_PROPERTY_PARSE_VALUE,
-    "",
+    CSS_PROPERTY_PARSE_VALUE |
+        CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME,
+    "layout.css.moz-appearance.enabled",
     VARIANT_HK,
     kMozAppearanceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Discrete)
 CSS_PROP_DISPLAY(
     appearance,
     appearance,
     Appearance,
-    CSS_PROPERTY_PARSE_VALUE,
-    "",
+    CSS_PROPERTY_PARSE_VALUE |
+        CSS_PROPERTY_ENABLED_IN_UA_SHEETS_AND_CHROME,
+    "layout.css.appearance.enabled",
     VARIANT_HK,
     kAppearanceKTable,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Discrete)
 CSS_PROP_DISPLAY(
     backface-visibility,
     backface_visibility,
     BackfaceVisibility,
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -971,24 +971,16 @@ var gCSSProperties = {
   "animation-timing-function": {
     domProp: "animationTimingFunction",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "ease" ],
     other_values: [ "cubic-bezier(0.25, 0.1, 0.25, 1.0)", "linear", "ease-in", "ease-out", "ease-in-out", "linear, ease-in, cubic-bezier(0.1, 0.2, 0.8, 0.9)", "cubic-bezier(0.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.25, 1.5, 0.75, -0.5)", "step-start", "step-end", "steps(1)", "steps(2, start)", "steps(386)", "steps(3, end)", "frames(2)", "frames(1000)", "frames( 2 )" ],
     invalid_values: [ "none", "auto", "cubic-bezier(0.25, 0.1, 0.25)", "cubic-bezier(0.25, 0.1, 0.25, 0.25, 1.0)", "cubic-bezier(-0.5, 0.5, 0.5, 0.5)", "cubic-bezier(1.5, 0.5, 0.5, 0.5)", "cubic-bezier(0.5, 0.5, -0.5, 0.5)", "cubic-bezier(0.5, 0.5, 1.5, 0.5)", "steps(2, step-end)", "steps(0)", "steps(-2)", "steps(0, step-end, 1)", "frames(1)", "frames(-2)", "frames", "frames()", "frames(,)", "frames(a)", "frames(2.0)", "frames(2.5)", "frames(2 3)" ]
   },
-  "-moz-appearance": {
-    domProp: "MozAppearance",
-    inherited: false,
-    type: CSS_TYPE_LONGHAND,
-    initial_values: [ "none" ],
-    other_values: [ "radio", "menulist" ],
-    invalid_values: []
-  },
   "-moz-binding": {
     domProp: "MozBinding",
     inherited: false,
     type: CSS_TYPE_LONGHAND,
     initial_values: [ "none" ],
     other_values: [ "url(foo.xml)" ],
     invalid_values: []
   },
@@ -7781,16 +7773,40 @@ if (IsCSSPropertyPrefEnabled("layout.css
     "content-box text url(404.png) blue"
   );
 }
 
 if (IsCSSPropertyPrefEnabled("layout.css.display-flow-root.enabled")) {
   gCSSProperties["display"].other_values.push("flow-root");
 }
 
+if (IsCSSPropertyPrefEnabled("layout.css.appearance.enabled")) {
+  gCSSProperties["appearance"] = {
+    domProp: "appearance",
+    inherited: false,
+    type: CSS_TYPE_LONGHAND,
+    initial_values: [ "auto" ],
+    other_values: [ "none" ],
+    invalid_values: [ "button" ]
+  };
+}
+if (IsCSSPropertyPrefEnabled("layout.css.moz-appearance.enabled")) {
+  gCSSProperties["-moz-appearance"] = {
+    domProp: "MozAppearance",
+    inherited: false,
+    type: CSS_TYPE_LONGHAND,
+    initial_values: [ "none" ],
+    other_values: [ "radio", "menulist", "button", "checkbox", "textfield",
+                    "textfield-multiline", "meterbar", "progressbar", "range",
+                    "range-thumb", "spinner-upbutton", "spinner-downbutton",
+                    "number-input", "listbox", "menulist-button" ],
+    invalid_values: [ "auto" ]
+  };
+}
+
 // Copy aliased properties' fields from their alias targets.
 for (var prop in gCSSProperties) {
   var entry = gCSSProperties[prop];
   if (entry.alias_for) {
     var aliasTargetEntry = gCSSProperties[entry.alias_for];
     if (!aliasTargetEntry) {
       ok(false,
          "Alias '" + prop + "' alias_for field, '" + entry.alias_for + "', " +
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2633,16 +2633,20 @@ pref("layout.css.grid.enabled", true);
 pref("layout.css.grid-template-subgrid-value.enabled", false);
 
 // Is support for CSS contain enabled?
 pref("layout.css.contain.enabled", false);
 
 // Is support for CSS display:flow-root enabled?
 pref("layout.css.display-flow-root.enabled", true);
 
+// Is support for CSS [-moz-]appearance enabled for web content?
+pref("layout.css.appearance.enabled", true);
+pref("layout.css.moz-appearance.enabled", true);
+
 // Is support for CSS box-decoration-break enabled?
 pref("layout.css.box-decoration-break.enabled", true);
 
 // Is layout of CSS outline-style:auto enabled?
 pref("layout.css.outline-style-auto.enabled", false);
 
 // Is CSSOM-View scroll-behavior and its MSD smooth scrolling enabled?
 pref("layout.css.scroll-behavior.enabled", true);