Bug 1255384 - fix getCSSValuesForProperty for counter-*; r?heycam draft
authorTom Tromey <tom@tromey.com>
Thu, 11 Jan 2018 12:08:02 -0700
changeset 719875 4a784880cad7f22108a56b141d22a0f80384511f
parent 719874 96acd76fdf71cfa850a55bc5b6340267f5830234
child 745910 7870ea20c2f453293634b6620cdcab0cae1dd78a
push id95377
push userbmo:ttromey@mozilla.com
push dateFri, 12 Jan 2018 20:59:03 +0000
reviewersheycam
bugs1255384
milestone59.0a1
Bug 1255384 - fix getCSSValuesForProperty for counter-*; r?heycam This bug notes that getCSSValuesForProperty does not mention the "none" value for counter-increment and counter-reset. This fixes the problem by mentioning the variants in the entries in nsCSSPropList.h. MozReview-Commit-ID: HpZIMIIejHc
devtools/shared/css/generated/properties-db.js
layout/inspector/tests/test_bug877690.html
layout/style/nsCSSPropList.h
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -5251,28 +5251,30 @@ exports.CSS_PROPERTIES = {
     "isInherited": false,
     "subproperties": [
       "counter-increment"
     ],
     "supports": [],
     "values": [
       "inherit",
       "initial",
+      "none",
       "unset"
     ]
   },
   "counter-reset": {
     "isInherited": false,
     "subproperties": [
       "counter-reset"
     ],
     "supports": [],
     "values": [
       "inherit",
       "initial",
+      "none",
       "unset"
     ]
   },
   "cursor": {
     "isInherited": true,
     "subproperties": [
       "cursor"
     ],
--- a/layout/inspector/tests/test_bug877690.html
+++ b/layout/inspector/tests/test_bug877690.html
@@ -217,16 +217,23 @@ function do_test() {
   var expected = [ "inherit", "initial", "unset" ];
   ok(testValues(values, expected), "property all's values.");
 
   var prop = "quotes"
   var values = InspectorUtils.getCSSValuesForProperty(prop);
   var expected = [ "inherit", "initial", "unset", "none" ];
   ok(testValues(values, expected), "property quotes's values.");
 
+  // Regression test for bug 1255384.
+  for (prop of ["counter-increment", "counter-reset"]) {
+    var values = InspectorUtils.getCSSValuesForProperty(prop);
+    var expected = [ "inherit", "initial", "unset", "none" ];
+    ok(testValues(values, expected), "property " + prop + "'s values.");
+  }
+
   SimpleTest.finish();
 }
 
 SimpleTest.waitForExplicitFinish();
 addLoadEvent(do_test);
 
 </script>
 </head>
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -1647,27 +1647,27 @@ CSS_PROP_TEXT(
     eStyleAnimType_None)
 #endif // CSS_PROP_LIST_EXCLUDE_INTERNAL
 CSS_PROP_CONTENT(
     counter-increment,
     counter_increment,
     CounterIncrement,
     CSS_PROPERTY_PARSE_FUNCTION,
     "",
-    0,
+    VARIANT_INHERIT | VARIANT_NONE,
     nullptr,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Discrete) // XXX bug 137285
 CSS_PROP_CONTENT(
     counter-reset,
     counter_reset,
     CounterReset,
     CSS_PROPERTY_PARSE_FUNCTION,
     "",
-    0,
+    VARIANT_INHERIT | VARIANT_NONE,
     nullptr,
     CSS_PROP_NO_OFFSET,
     eStyleAnimType_Discrete) // XXX bug 137285
 CSS_PROP_USERINTERFACE(
     cursor,
     cursor,
     Cursor,
     CSS_PROPERTY_PARSE_FUNCTION |