Bug 1117538 part 2 - [css-grid] Accept 'grid-auto-flow: dense' which now implies 'row dense'. r=simon.sapin

This commit is contained in:
Mats Palmgren 2015-01-05 22:20:56 +00:00
parent 0c2e9247ec
commit a7ff0f7462
3 changed files with 10 additions and 5 deletions

View File

@ -7654,10 +7654,11 @@ CSSParserImpl::ParseGridAutoFlow()
}
int32_t bitField = value.GetIntValue();
// Require one of these.
if (!(bitField & NS_STYLE_GRID_AUTO_FLOW_ROW ||
bitField & NS_STYLE_GRID_AUTO_FLOW_COLUMN)) {
return false;
// If neither row nor column is provided, row is assumed.
if (!(bitField & (NS_STYLE_GRID_AUTO_FLOW_ROW |
NS_STYLE_GRID_AUTO_FLOW_COLUMN))) {
value.SetIntValue(bitField | NS_STYLE_GRID_AUTO_FLOW_ROW,
eCSSUnit_Enumerated);
}
AppendValue(eCSSProperty_grid_auto_flow, value);

View File

@ -5077,13 +5077,13 @@ if (SpecialPowers.getBoolPref("layout.css.grid.enabled")) {
"row dense",
"dense column",
"dense row",
"dense",
],
invalid_values: [
"",
"auto",
"none",
"10px",
"dense",
"column row",
"dense row dense",
]

View File

@ -178,6 +178,10 @@ grid_test_cases = grid_template_test_cases.concat([
specified: "row",
gridAutoFlow: "row",
},
{
specified: "dense",
gridAutoFlow: "row dense",
},
{
specified: "row 40px",
gridAutoFlow: "row",