From 9992b11faa026d0290f2ea7b25900211e89123a3 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 11 Jan 2018 12:08:02 -0700 Subject: [PATCH] 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 | 2 ++ layout/inspector/tests/test_bug877690.html | 7 +++++++ layout/style/nsCSSPropList.h | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js index 0d5e218dba25..83bd72a41158 100644 --- a/devtools/shared/css/generated/properties-db.js +++ b/devtools/shared/css/generated/properties-db.js @@ -5256,6 +5256,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "none", "unset" ] }, @@ -5268,6 +5269,7 @@ exports.CSS_PROPERTIES = { "values": [ "inherit", "initial", + "none", "unset" ] }, diff --git a/layout/inspector/tests/test_bug877690.html b/layout/inspector/tests/test_bug877690.html index f2f1512080b6..ef5d9f2f4f10 100644 --- a/layout/inspector/tests/test_bug877690.html +++ b/layout/inspector/tests/test_bug877690.html @@ -222,6 +222,13 @@ function do_test() { 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(); } diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h index 6c7135e16e30..5656f7d70c3c 100644 --- a/layout/style/nsCSSPropList.h +++ b/layout/style/nsCSSPropList.h @@ -1652,7 +1652,7 @@ CSS_PROP_CONTENT( CounterIncrement, CSS_PROPERTY_PARSE_FUNCTION, "", - 0, + VARIANT_INHERIT | VARIANT_NONE, nullptr, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) // XXX bug 137285 @@ -1662,7 +1662,7 @@ CSS_PROP_CONTENT( CounterReset, CSS_PROPERTY_PARSE_FUNCTION, "", - 0, + VARIANT_INHERIT | VARIANT_NONE, nullptr, CSS_PROP_NO_OFFSET, eStyleAnimType_Discrete) // XXX bug 137285