Bug 1255384 - fix getCSSValuesForProperty for counter-*; r=heycam
authorTom Tromey <tom@tromey.com>
Thu, 11 Jan 2018 12:08:02 -0700
changeset 450910 de312c964b3a6b6a864f4ea987a61b820dae7ac1
parent 450909 96acd76fdf71cfa850a55bc5b6340267f5830234
child 450911 6e299e057fd4396cd4900c82336df2c2c511fce4
push id8543
push userryanvm@gmail.com
push dateTue, 16 Jan 2018 14:33:22 +0000
treeherdermozilla-beta@a6525ed16a32 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1255384
milestone59.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 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 |