From a7ff0f746208c99b674814d7d583d62d15f6c2df Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 5 Jan 2015 22:20:56 +0000 Subject: [PATCH] Bug 1117538 part 2 - [css-grid] Accept 'grid-auto-flow: dense' which now implies 'row dense'. r=simon.sapin --- layout/style/nsCSSParser.cpp | 9 +++++---- layout/style/test/property_database.js | 2 +- layout/style/test/test_grid_container_shorthands.html | 4 ++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index 5c2e2d643f76..5f1be7ff3fd3 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -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); diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index fd6c1edbfd96..1f2d0102180b 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -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", ] diff --git a/layout/style/test/test_grid_container_shorthands.html b/layout/style/test/test_grid_container_shorthands.html index 2e3aacd24580..fa12971d5139 100644 --- a/layout/style/test/test_grid_container_shorthands.html +++ b/layout/style/test/test_grid_container_shorthands.html @@ -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",