mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-29 20:57:43 -10:00
Bug 1387410: Stop the grid shorthand from resetting grid-gap properties. r=heycam
MozReview-Commit-ID: GxU9YuAUc00
This commit is contained in:
1 parent
af9598da03
commit
2fb463ee98
8 files changed
+16
-47
No files matched your search
@@ -95,21 +95,21 @@ button:nth-child(4n) { background: silver; }
|
||||
<button class="end">AB</button>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid:auto/auto auto">
|
||||
<div class="grid" style="grid: auto/auto auto; grid-gap: 0;">
|
||||
<button>AB</button>
|
||||
<button class="jend">AB</button>
|
||||
<button class="aend">AB</button>
|
||||
<button class="end">AB</button>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid:50px 50px/50px 50px">
|
||||
<div class="grid" style="grid: 50px 50px/50px 50px; grid-gap: 0;">
|
||||
<button>AB</button>
|
||||
<button class="jend"> </button>
|
||||
<button class="aend">AB</button>
|
||||
<button class="end"> </button>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid:minmax(auto,20px) 20px/auto auto">
|
||||
<div class="grid" style="grid: minmax(auto,20px) 20px/auto auto; grid-gap: 0;">
|
||||
<button>AB</button>
|
||||
<button class="jend">AB</button>
|
||||
<button class="aend">AB</button>
|
||||
@@ -142,14 +142,14 @@ button:nth-child(4n) { background: silver; }
|
||||
<button class="end">AB</button>
|
||||
</div>
|
||||
|
||||
<div class="grid max40" style="grid:50px 50px/50px 50px">
|
||||
<div class="grid max40" style="grid:50px 50px/50px 50px; grid-gap: 0;">
|
||||
<button>AB</button>
|
||||
<button class="jend"> </button>
|
||||
<button class="aend">AB</button>
|
||||
<button class="end"> </button>
|
||||
</div>
|
||||
|
||||
<div class="grid max40" style="grid:50px 50px/50px 50px; place-items:stretch">
|
||||
<div class="grid max40" style="grid:50px 50px/50px 50px; place-items:stretch; grid-gap: 0;">
|
||||
<button>AB</button>
|
||||
<button class="jend"> </button>
|
||||
<button class="aend">AB</button>
|
||||
|
||||
@@ -78,14 +78,14 @@ canvas:nth-child(4n) { background: black; }
|
||||
<canvas class="end"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid:auto/auto auto">
|
||||
<div class="grid" style="grid: auto/auto auto; grid-gap: 0;">
|
||||
<canvas></canvas>
|
||||
<canvas class="jend"></canvas>
|
||||
<canvas class="aend"></canvas>
|
||||
<canvas class="end"></canvas>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid:minmax(auto,30px) 30px/auto auto">
|
||||
<div class="grid" style="grid: minmax(auto,30px) 30px/auto auto; grid-gap: 0">
|
||||
<canvas></canvas>
|
||||
<canvas class="jend"></canvas>
|
||||
<canvas class="aend"></canvas>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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"]);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in new issue
Block a user