Skip to content

Commit

Permalink
Bug 1255380 - fix getCSSValuesForProperty for "content" property; r=x…
Browse files Browse the repository at this point in the history
…idorn

This changes getCSSValuesForProperty to return the correct values for
the "content" property.

MozReview-Commit-ID: 2F5LQPbSIFs

--HG--
extra : rebase_source : 290df953c8234888801b7a8a6ef5668a11a59bea
  • Loading branch information
tromey committed Jan 25, 2018
1 parent c1d340e commit 12c8602
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
8 changes: 7 additions & 1 deletion devtools/shared/css/generated/properties-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -5269,13 +5269,19 @@ exports.CSS_PROPERTIES = {
],
"values": [
"-moz-alt-content",
"attr",
"close-quote",
"counter",
"counters",
"inherit",
"initial",
"no-close-quote",
"no-open-quote",
"none",
"normal",
"open-quote",
"unset"
"unset",
"url"
]
},
"counter-increment": {
Expand Down
8 changes: 7 additions & 1 deletion layout/inspector/InspectorUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,13 @@ static void GetOtherValuesForProperty(const uint32_t aParserVariant,
InsertNoDuplicates(aArray, NS_LITERAL_STRING("-moz-repeating-linear-gradient"));
InsertNoDuplicates(aArray, NS_LITERAL_STRING("-moz-repeating-radial-gradient"));
}
if (aParserVariant & VARIANT_ATTR) {
InsertNoDuplicates(aArray, NS_LITERAL_STRING("attr"));
}
if (aParserVariant & VARIANT_COUNTER) {
InsertNoDuplicates(aArray, NS_LITERAL_STRING("counter"));
InsertNoDuplicates(aArray, NS_LITERAL_STRING("counters"));
}
}

/* static */ void
Expand Down Expand Up @@ -691,7 +698,6 @@ PropertySupportsVariant(nsCSSPropertyID aPropertyID, uint32_t aVariant)
supported |= VARIANT_LENGTH;
break;

case eCSSProperty_content:
case eCSSProperty_cursor:
supported |= VARIANT_URL;
break;
Expand Down
8 changes: 8 additions & 0 deletions layout/inspector/tests/test_bug877690.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@
var values = InspectorUtils.getCSSValuesForProperty("clip");
ok(testValues(values, expected), "property clip's values");

// Regression test for bug 1255380.
var expected = [ "normal", "none", "url", "counter", "counters",
"attr", "open-quote", "close-quote", "no-open-quote",
"no-close-quote", "inherit", "initial", "unset",
"-moz-alt-content" ];
var values = InspectorUtils.getCSSValuesForProperty("content");
ok(testValues(values, expected), "property counter's values");

SimpleTest.finish();
}

Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsCSSPropList.h
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ CSS_PROP_CONTENT(
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_START_IMAGE_LOADS,
"",
0,
VARIANT_HMK | VARIANT_NONE | VARIANT_URL | VARIANT_COUNTER | VARIANT_ATTR,
kContentKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
Expand Down

0 comments on commit 12c8602

Please sign in to comment.