+
diff --git a/layout/reftests/css-grid/grid-item-overflow-stretch-003-ref.html b/layout/reftests/css-grid/grid-item-overflow-stretch-003-ref.html
index c082e6be4166..5c259c7ccd41 100644
--- a/layout/reftests/css-grid/grid-item-overflow-stretch-003-ref.html
+++ b/layout/reftests/css-grid/grid-item-overflow-stretch-003-ref.html
@@ -19,7 +19,7 @@ body,html { color:black; background:white; font:16px/1 monospace; padding:0; mar
border:1px solid;
}
.c2 { grid-template-columns: 7px 122px 3px; }
-.h > .grid { grid: 7px 112px 3px / 7px 80px 3px; }
+.h > .grid { grid: 7px 112px 3px / 7px 80px 3px; grid-gap: 0; }
.grid > * {
grid-area: 2/2;
diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp
index f4b9db7cb3b8..0665cc7cef47 100644
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -1219,18 +1219,6 @@ Declaration::GetPropertyValueInternal(
// #2 <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>?
// #3 [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
case eCSSProperty_grid: {
- const nsCSSValue& columnGapValue =
- *data->ValueFor(eCSSProperty_grid_column_gap);
- if (columnGapValue.GetUnit() != eCSSUnit_Pixel ||
- columnGapValue.GetFloatValue() != 0.0f) {
- return; // Not serializable, bail.
- }
- const nsCSSValue& rowGapValue =
- *data->ValueFor(eCSSProperty_grid_row_gap);
- if (rowGapValue.GetUnit() != eCSSUnit_Pixel ||
- rowGapValue.GetFloatValue() != 0.0f) {
- return; // Not serializable, bail.
- }
const nsCSSValue& areasValue =
*data->ValueFor(eCSSProperty_grid_template_areas);
const nsCSSValue& columnsValue =
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index e8f5c1c5d993..bbd42cd1ac56 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -9451,13 +9451,6 @@ CSSParserImpl::ParseGrid()
return true;
}
- // https://drafts.csswg.org/css-grid/#grid-shorthand
- // "Also, the gutter properties are reset by this shorthand,
- // even though they can't be set by it."
- value.SetFloatValue(0.0f, eCSSUnit_Pixel);
- AppendValue(eCSSProperty_grid_row_gap, value);
- AppendValue(eCSSProperty_grid_column_gap, value);
-
// [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>
auto res = ParseGridShorthandAutoProps(NS_STYLE_GRID_AUTO_FLOW_ROW);
if (res == CSSParseResult::Error) {
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index e1531367a27c..629b9543a8a1 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2877,8 +2877,6 @@ static const nsCSSPropertyID gGridSubpropTable[] = {
eCSSProperty_grid_auto_flow,
eCSSProperty_grid_auto_rows,
eCSSProperty_grid_auto_columns,
- eCSSProperty_grid_row_gap, // can only be reset, not get/set
- eCSSProperty_grid_column_gap, // can only be reset, not get/set
eCSSProperty_UNKNOWN
};
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
index aae1ebb6dc22..49fb223a2d94 100644
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6744,8 +6744,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.grid.enabled")) {
"grid-auto-flow",
"grid-auto-rows",
"grid-auto-columns",
- "grid-column-gap",
- "grid-row-gap",
],
initial_values: [
"none",
diff --git a/layout/style/test/test_grid_shorthand_serialization.html b/layout/style/test/test_grid_shorthand_serialization.html
index dcb6f888047f..c8e04b0960d6 100644
--- a/layout/style/test/test_grid_shorthand_serialization.html
+++ b/layout/style/test/test_grid_shorthand_serialization.html
@@ -162,30 +162,22 @@ grid_test_cases = grid_template_test_cases.concat([
},
{
gridAutoFlow: "row",
- gridRowGap: "0px",
+ shorthand: "none / none",
+ },
+ // Test that grid-gap properties don't affect serialization.
+ {
+ gridRowGap: "1px",
shorthand: "none / none",
},
{
- gridAutoFlow: "row",
- gridRowGap: "1px",
- shorthand: "",
- },
- {
- gridAutoFlow: "row",
gridColumnGap: "1px",
- shorthand: "",
+ shorthand: "none / none",
},
]);
var grid_important_test_cases = [
{
"grid-auto-flow": "row",
- "grid-row-gap": "0px",
- shorthand: "",
- },
- {
- "grid-auto-flow": "row",
- "grid-column-gap": "1px",
shorthand: "",
},
];
@@ -225,11 +217,11 @@ run_tests(grid_template_test_cases, "gridTemplate", [
run_tests(grid_test_cases, "grid", [
"gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows",
- "gridAutoFlow", "gridAutoColumns", "gridAutoRows", "gridColumnGap", "gridRowGap"]);
+ "gridAutoFlow", "gridAutoColumns", "gridAutoRows"]);
run_important_tests(grid_important_test_cases, "grid", [
"grid-template-areas", "grid-template-columns", "grid-template-rows",
- "grid-auto-flow", "grid-auto-columns", "grid-auto-rows", "grid-column-gap", "grid-row-gap"]);
+ "grid-auto-flow", "grid-auto-columns", "grid-auto-rows"]);