Skip to content

Commit

Permalink
Bug 1804980: Remove the about:config pref for subgrid, layout.css.gri…
Browse files Browse the repository at this point in the history
…d-template-subgrid-value.enabled, since it's been default-enabled for years. r=TYLin,tlouw

Differential Revision: https://phabricator.services.mozilla.com/D164389
  • Loading branch information
dholbert committed Dec 12, 2022
1 parent de95832 commit 1ae1319
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ const TEST_URI = `
`;

add_task(async function() {
info("Enable subgrid in order to see the subgrid display type.");
await pushPref("layout.css.grid-template-subgrid-value.enabled", true);

const { inspector } = await openInspectorForURL(
"data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
const TEST_URL = URL_ROOT + "doc_markup_subgrid.html";

add_task(async function() {
info("Enable subgrid in order to see the subgrid display type.");
await pushPref("layout.css.grid-template-subgrid-value.enabled", true);
const { inspector } = await openInspectorForURL(TEST_URL);
const { highlighters, store } = inspector;

Expand Down
5 changes: 0 additions & 5 deletions devtools/server/actors/inspector/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ loader.lazyRequireGetter(
true
);

const SUBGRID_ENABLED = Services.prefs.getBoolPref(
"layout.css.grid-template-subgrid-value.enabled"
);

const FONT_FAMILY_PREVIEW_TEXT = "The quick brown fox jumps over the lazy dog";
const FONT_FAMILY_PREVIEW_TEXT_SIZE = 20;

Expand Down Expand Up @@ -376,7 +372,6 @@ const NodeActor = protocol.ActorClassWithSpec(nodeSpec, {
}

if (
SUBGRID_ENABLED &&
(display === "grid" || display === "inline-grid") &&
(style.gridTemplateRows.startsWith("subgrid") ||
style.gridTemplateColumns.startsWith("subgrid"))
Expand Down
12 changes: 3 additions & 9 deletions devtools/server/actors/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ loader.lazyRequireGetter(
"resource://devtools/shared/dom-node-constants.js"
);

const SUBGRID_ENABLED = Services.prefs.getBoolPref(
"layout.css.grid-template-subgrid-value.enabled"
);

/**
* Set of actors the expose the CSS layout information to the devtools protocol clients.
*
Expand Down Expand Up @@ -345,11 +341,9 @@ const GridActor = ActorClassWithSpec(gridSpec, {
form.containerNodeActorID = this.walker.getNode(this.containerEl).actorID;
}

if (SUBGRID_ENABLED) {
form.isSubgrid =
gridTemplateRows.startsWith("subgrid") ||
gridTemplateColumns.startsWith("subgrid");
}
form.isSubgrid =
gridTemplateRows.startsWith("subgrid") ||
gridTemplateColumns.startsWith("subgrid");

return form;
},
Expand Down
2 changes: 1 addition & 1 deletion layout/generic/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ load 1542441.html
load 1543140-1.html
load 1544060-1.html
load 1544060-2.html
pref(layout.css.grid-template-subgrid-value.enabled,true) load 1553824.html
load 1553824.html
asserts(26-42) load 1554824.html # extreme sizes, column-width: 0em
load 1555142.html
load 1560349.html
Expand Down
6 changes: 2 additions & 4 deletions layout/generic/test/test_dynamic_reflow_root_disallowal.html
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,8 @@
for (let subtest of gridContainerSubtests) {
runGridContainerSubtest(subtest);
}
if (SpecialPowers.getBoolPref("layout.css.grid-template-subgrid-value.enabled")) {
for (let subtest of gridSubgridSubtests) {
runGridSubgridSubtest(subtest);
}
for (let subtest of gridSubgridSubtests) {
runGridSubgridSubtest(subtest);
}
for (let subtest of gridItemSubtests) {
runGridItemSubtest(subtest);
Expand Down
77 changes: 30 additions & 47 deletions layout/style/test/property_database.js
Original file line number Diff line number Diff line change
Expand Up @@ -12047,10 +12047,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.font-variant-emoji.enabled")) {
};
}

var isGridTemplateSubgridValueEnabled = IsCSSPropertyPrefEnabled(
"layout.css.grid-template-subgrid-value.enabled"
);

var isGridTemplateMasonryValueEnabled = IsCSSPropertyPrefEnabled(
"layout.css.grid-template-masonry-value.enabled"
);
Expand Down Expand Up @@ -12187,6 +12183,22 @@ gCSSProperties["grid-template-columns"] = {
"fit-content(1px) 1fr",
"[a] fit-content(calc(1px - 99%)) [b]",
"[a] fit-content(10%) [b c] fit-content(1em)",
// See https://bugzilla.mozilla.org/show_bug.cgi?id=981300
"[none subgrid min-content max-content foo] 40px",
"subgrid",
"subgrid [] [foo bar]",
"subgrid repeat(1, [])",
"subgrid Repeat(4, [a] [b c] [] [d])",
"subgrid repeat(auto-fill, [])",
"subgrid repeat(Auto-fill, [a b c]) [a] []",
"subgrid [x] repeat( Auto-fill, [a b c]) []",
"subgrid [x] repeat( auto-fill , [a b] [c]) [y]",
"subgrid repeat(auto-fill, [a] [b] [c]) [d]",
"subgrid repeat(Auto-fill, [a] [b c] [] [d])",
"subgrid [x y] [x] repeat(auto-fill, [a b] [c] [d] [d]) [x] [x]",
"subgrid [x] repeat(auto-fill, []) [y z]",
"subgrid [x] repeat(auto-fill, [y]) [z] [] repeat(2, [a] [b]) [y] []",
"subgrid [x] repeat(auto-fill, []) [x y] [z] [] []",
],
invalid_values: [
"",
Expand Down Expand Up @@ -12251,30 +12263,6 @@ gCSSProperties["grid-template-columns"] = {
"fit-content(min-content)",
"fit-content(1px) repeat(auto-fit, 1px)",
"fit-content(1px) repeat(auto-fill, 1px)",
],
unbalanced_values: ["(foo] 40px"],
};
if (isGridTemplateSubgridValueEnabled) {
gCSSProperties["grid-template-columns"].other_values.push(
// See https://bugzilla.mozilla.org/show_bug.cgi?id=981300
"[none subgrid min-content max-content foo] 40px",

"subgrid",
"subgrid [] [foo bar]",
"subgrid repeat(1, [])",
"subgrid Repeat(4, [a] [b c] [] [d])",
"subgrid repeat(auto-fill, [])",
"subgrid repeat(Auto-fill, [a b c]) [a] []",
"subgrid [x] repeat( Auto-fill, [a b c]) []",
"subgrid [x] repeat( auto-fill , [a b] [c]) [y]",
"subgrid repeat(auto-fill, [a] [b] [c]) [d]",
"subgrid repeat(Auto-fill, [a] [b c] [] [d])",
"subgrid [x y] [x] repeat(auto-fill, [a b] [c] [d] [d]) [x] [x]",
"subgrid [x] repeat(auto-fill, []) [y z]",
"subgrid [x] repeat(auto-fill, [y]) [z] [] repeat(2, [a] [b]) [y] []",
"subgrid [x] repeat(auto-fill, []) [x y] [z] [] []"
);
gCSSProperties["grid-template-columns"].invalid_values.push(
"subgrid [inherit]",
"subgrid [initial]",
"subgrid [unset]",
Expand Down Expand Up @@ -12308,9 +12296,10 @@ if (isGridTemplateSubgridValueEnabled) {
"subgrid [a] repeat(auto-fit,[])",
"subgrid repeat(auto-fill, 1px)",
"subgrid repeat(auto-fill, 1px [])",
"subgrid repeat(auto-fill, []) repeat(auto-fill, [])"
);
}
"subgrid repeat(auto-fill, []) repeat(auto-fill, [])",
],
unbalanced_values: ["(foo] 40px"],
};
if (isGridTemplateMasonryValueEnabled) {
gCSSProperties["grid-template-columns"].other_values.push("masonry");
gCSSProperties["grid-template-columns"].invalid_values.push(
Expand Down Expand Up @@ -12386,6 +12375,13 @@ gCSSProperties["grid-template"] = {
"[bar] 'fizz' 100px / [foo] 40px",
"[bar] 'fizz' 100px [buzz] / [foo] 40px",
"[bar] 'fizz' 100px [buzz] \n [a] '.' 200px [b] / [foo] 40px",
"subgrid / subgrid",
"subgrid/40px 20px",
"subgrid [foo] [] [bar baz] / 40px 20px",
"40px 20px/subgrid",
"40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]",
"subgrid/subgrid",
"subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]",
],
invalid_values: [
"'fizz' / repeat(1, 100px)",
Expand All @@ -12394,25 +12390,12 @@ gCSSProperties["grid-template"] = {
"[fizz] [buzz] 100px / 40px",
"[fizz] [buzz] 'foo' / 40px",
"'foo' / none",
],
};
if (isGridTemplateSubgridValueEnabled) {
gCSSProperties["grid-template"].other_values.push(
"subgrid / subgrid",
"subgrid/40px 20px",
"subgrid [foo] [] [bar baz] / 40px 20px",
"40px 20px/subgrid",
"40px 20px/subgrid [foo] [] repeat(3, [a] [b]) [bar baz]",
"subgrid/subgrid",
"subgrid [foo] [] [bar baz]/subgrid [foo] [] [bar baz]"
);
gCSSProperties["grid-template"].invalid_values.push(
"subgrid",
"subgrid []",
"subgrid [] / 'fizz'",
"subgrid / 'fizz'"
);
}
"subgrid / 'fizz'",
],
};
if (isGridTemplateMasonryValueEnabled) {
gCSSProperties["grid-template"].other_values.push(
"masonry / subgrid",
Expand Down
25 changes: 10 additions & 15 deletions layout/style/test/test_grid_container_shorthands.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

<script>

var isGridTemplateSubgridValueEnabled =
SpecialPowers.getBoolPref("layout.css.grid-template-subgrid-value.enabled");

var initial_values = {
gridTemplateAreas: "none",
gridTemplateRows: "none",
Expand Down Expand Up @@ -147,33 +144,31 @@
},
{
specified: "subgrid / subgrid",
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
gridTemplateColumns: "subgrid",
gridTemplateRows: "subgrid",
},
{
specified: "subgrid [foo] / subgrid",
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid [foo]" : "none",
gridTemplateColumns: "subgrid",
gridTemplateRows: "subgrid [foo]",
},
{
specified: "subgrid [foo] repeat(3, [] [a b] [c]) / subgrid",
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
gridTemplateRows: isGridTemplateSubgridValueEnabled ?
"subgrid [foo] [] [a b] [c] [] [a b] [c] [] [a b] [c]" : "none",
gridTemplateColumns: "subgrid",
gridTemplateRows: "subgrid [foo] [] [a b] [c] [] [a b] [c] [] [a b] [c]",
},
{
// Test that the number of lines is clamped to kMaxLine = 10000.
specified: "subgrid [foo] repeat(999999999, [a]) / subgrid",
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid" : "none",
gridTemplateColumns: "subgrid",
// Array(n).join(s) is a hack for the non-standard s.repeat(n - 1) .
// [foo] + 9999 [a] gives us 10000 lines.
gridTemplateRows: isGridTemplateSubgridValueEnabled ?
"subgrid [foo]" + Array(10000).join(" [a]") : "none",
gridTemplateRows: "subgrid [foo]" + Array(10000).join(" [a]"),
},
{
specified: "subgrid [bar]/ subgrid [] [foo",
gridTemplateColumns: isGridTemplateSubgridValueEnabled ? "subgrid [] [foo]" : "none",
gridTemplateRows: isGridTemplateSubgridValueEnabled ? "subgrid [bar]" : "none",
gridTemplateColumns: "subgrid [] [foo]",
gridTemplateRows: "subgrid [bar]",
},
{
specified: "'fizz' repeat(1, 100px)",
Expand Down
5 changes: 1 addition & 4 deletions layout/style/test/test_grid_shorthand_serialization.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

<script>

var isGridTemplateSubgridValueEnabled =
SpecialPowers.getBoolPref("layout.css.grid-template-subgrid-value.enabled");

var initial_values = {
gridTemplateAreas: "none",
gridTemplateRows: "none",
Expand Down Expand Up @@ -48,7 +45,7 @@
{
gridTemplateRows: "40px",
gridTemplateColumns: "subgrid",
shorthand: isGridTemplateSubgridValueEnabled ? "40px / subgrid" : "",
shorthand: "40px / subgrid",
},
{
gridTemplateRows: "[foo] 40px [bar]",
Expand Down
7 changes: 0 additions & 7 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8396,13 +8396,6 @@
value: @IS_NOT_RELEASE_OR_BETA@
mirror: always

# Is support for CSS "grid-template-{columns,rows}: subgrid X" enabled?
- name: layout.css.grid-template-subgrid-value.enabled
type: RelaxedAtomicBool
value: true
mirror: always
rust: true

# Is support for caching an grid item's block axis measurement enabled?
- name: layout.css.grid-item-baxis-measurement.enabled
type: bool
Expand Down
2 changes: 1 addition & 1 deletion servo/components/style/values/specified/grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl Parse for TrackList<LengthPercentage, Integer> {
#[cfg(feature = "gecko")]
#[inline]
fn allow_grid_template_subgrids() -> bool {
static_prefs::pref!("layout.css.grid-template-subgrid-value.enabled")
true
}

#[cfg(feature = "servo")]
Expand Down
2 changes: 0 additions & 2 deletions testing/profiles/unittest-features/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
/* globals user_pref */
// Enable w3c touch events for testing
user_pref("dom.w3c_touch_events.enabled", 1);
// Enable CSS Grid 'subgrid' feature for testing
user_pref("layout.css.grid-template-subgrid-value.enabled", true);
// Enable CSS initial-letter for testing
user_pref("layout.css.initial-letter.enabled", true);
// Enable Media Source Extensions for testing
Expand Down

0 comments on commit 1ae1319

Please sign in to comment.