Skip to content

Commit

Permalink
Bug 1398492: Remove the grid pref. r=mats
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 6Qez8NE8oze
  • Loading branch information
emilio committed Dec 16, 2017
1 parent 6a04994 commit dbb3111
Show file tree
Hide file tree
Showing 16 changed files with 583 additions and 735 deletions.
72 changes: 0 additions & 72 deletions devtools/shared/css/generated/properties-db.js
Original file line number Diff line number Diff line change
Expand Up @@ -9859,78 +9859,6 @@ exports.PREFERENCES = [
"font-variation-settings",
"layout.css.font-variations.enabled"
],
[
"grid",
"layout.css.grid.enabled"
],
[
"grid-area",
"layout.css.grid.enabled"
],
[
"grid-auto-columns",
"layout.css.grid.enabled"
],
[
"grid-auto-flow",
"layout.css.grid.enabled"
],
[
"grid-auto-rows",
"layout.css.grid.enabled"
],
[
"grid-column",
"layout.css.grid.enabled"
],
[
"grid-column-end",
"layout.css.grid.enabled"
],
[
"grid-column-gap",
"layout.css.grid.enabled"
],
[
"grid-column-start",
"layout.css.grid.enabled"
],
[
"grid-gap",
"layout.css.grid.enabled"
],
[
"grid-row",
"layout.css.grid.enabled"
],
[
"grid-row-end",
"layout.css.grid.enabled"
],
[
"grid-row-gap",
"layout.css.grid.enabled"
],
[
"grid-row-start",
"layout.css.grid.enabled"
],
[
"grid-template",
"layout.css.grid.enabled"
],
[
"grid-template-areas",
"layout.css.grid.enabled"
],
[
"grid-template-columns",
"layout.css.grid.enabled"
],
[
"grid-template-rows",
"layout.css.grid.enabled"
],
[
"initial-letter",
"layout.css.initial-letter.enabled"
Expand Down
3 changes: 0 additions & 3 deletions layout/base/crashtests/1156588.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<html>
<head>
<meta charset="UTF-8">
<!--
user_pref("layout.css.grid.enabled", true);
-->
<script>

function boom()
Expand Down
2 changes: 1 addition & 1 deletion layout/base/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ load 1127198-1.html
load 1140198.html
load 1143535.html
load 1153716.html
pref(layout.css.grid.enabled,true) load 1156588.html
load 1156588.html
load 1162813.xul
load 1163583.html
load 1234622-1.html
Expand Down
48 changes: 0 additions & 48 deletions layout/base/nsLayoutUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ using namespace mozilla::layers;
using namespace mozilla::layout;
using namespace mozilla::gfx;

#define GRID_ENABLED_PREF_NAME "layout.css.grid.enabled"
#define WEBKIT_PREFIXES_ENABLED_PREF_NAME "layout.css.prefixes.webkit"
#define TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME "layout.css.text-align-unsafe-value.enabled"
#define FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME "layout.css.float-logical-values.enabled"
Expand Down Expand Up @@ -214,51 +213,6 @@ static ContentMap& GetContentMap() {
return *sContentMap;
}

// When the pref "layout.css.grid.enabled" changes, this function is invoked
// to let us update kDisplayKTable, to selectively disable or restore the
// entries for "grid" and "inline-grid" in that table.
static void
GridEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
{
MOZ_ASSERT(strncmp(aPrefName, GRID_ENABLED_PREF_NAME,
ArrayLength(GRID_ENABLED_PREF_NAME)) == 0,
"We only registered this callback for a single pref, so it "
"should only be called for that pref");

static int32_t sIndexOfGridInDisplayTable;
static int32_t sIndexOfInlineGridInDisplayTable;
static bool sAreGridKeywordIndicesInitialized; // initialized to false

bool isGridEnabled =
Preferences::GetBool(GRID_ENABLED_PREF_NAME, false);
if (!sAreGridKeywordIndicesInitialized) {
// First run: find the position of "grid" and "inline-grid" in
// kDisplayKTable.
sIndexOfGridInDisplayTable =
nsCSSProps::FindIndexOfKeyword(eCSSKeyword_grid,
nsCSSProps::kDisplayKTable);
MOZ_ASSERT(sIndexOfGridInDisplayTable >= 0,
"Couldn't find grid in kDisplayKTable");
sIndexOfInlineGridInDisplayTable =
nsCSSProps::FindIndexOfKeyword(eCSSKeyword_inline_grid,
nsCSSProps::kDisplayKTable);
MOZ_ASSERT(sIndexOfInlineGridInDisplayTable >= 0,
"Couldn't find inline-grid in kDisplayKTable");
sAreGridKeywordIndicesInitialized = true;
}

// OK -- now, stomp on or restore the "grid" entries in kDisplayKTable,
// depending on whether the grid pref is enabled vs. disabled.
if (sIndexOfGridInDisplayTable >= 0) {
nsCSSProps::kDisplayKTable[sIndexOfGridInDisplayTable].mKeyword =
isGridEnabled ? eCSSKeyword_grid : eCSSKeyword_UNKNOWN;
}
if (sIndexOfInlineGridInDisplayTable >= 0) {
nsCSSProps::kDisplayKTable[sIndexOfInlineGridInDisplayTable].mKeyword =
isGridEnabled ? eCSSKeyword_inline_grid : eCSSKeyword_UNKNOWN;
}
}

// When the pref "layout.css.prefixes.webkit" changes, this function is invoked
// to let us update kDisplayKTable, to selectively disable or restore the
// entries for "-webkit-box" and "-webkit-inline-box" in that table.
Expand Down Expand Up @@ -8159,8 +8113,6 @@ struct PrefCallbacks
PrefChangedFunc func;
};
static const PrefCallbacks kPrefCallbacks[] = {
{ GRID_ENABLED_PREF_NAME,
GridEnabledPrefChangeCallback },
{ WEBKIT_PREFIXES_ENABLED_PREF_NAME,
WebkitPrefixEnabledPrefChangeCallback },
{ TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
Expand Down
5 changes: 0 additions & 5 deletions layout/generic/crashtests/1015562.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
<html>
<head>
<script>

/*
user_pref("layout.css.grid.enabled", true);
*/

function boom()
{
document.getElementById("r").appendChild(document.createTextNode("B"));
Expand Down
3 changes: 0 additions & 3 deletions layout/generic/crashtests/1156257.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
<html>
<head>
<meta charset="UTF-8">
<!--
user_pref("layout.css.grid.enabled", true);
-->
<script>
function boom()
{
Expand Down
10 changes: 5 additions & 5 deletions layout/generic/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ load 1001233.html
load 1001258-1.html
load 1001994.html
load 1003441.xul
pref(layout.css.grid.enabled,true) load 1015562.html
load 1015562.html
asserts(1-2) load 1015563-1.html
asserts(1-2) load 1015563-2.html
asserts(11) asserts-if(stylo&&Android,274) load 1015844.html # bug 574889, bug 1374479
Expand All @@ -600,7 +600,7 @@ load 1146114.html
asserts(0-20) load 1153478.html # bug 1144852
load 1153695.html
load 1156222.html
pref(layout.css.grid.enabled,true) load 1156257.html
load 1156257.html
load 1157011.html
load 1169420-1.html
load 1169420-2.html
Expand All @@ -613,9 +613,9 @@ load 1223522.xhtml
load 1223568-1.html
load 1223568-2.html
load 1224230-1.html
pref(layout.css.grid.enabled,true) load 1225118.html
pref(layout.css.grid.enabled,true) load 1225376.html
pref(layout.css.grid.enabled,true) load 1225592.html
load 1225118.html
load 1225376.html
load 1225592.html
load 1229437-1.html
load 1229437-2.html
load details-containing-only-text.html
Expand Down
2 changes: 1 addition & 1 deletion layout/reftests/bugs/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,7 @@ pref(layout.css.moz-document.content.enabled,false) == 1035091-2.html 1035091-re
== 1050493-1.html 1050493-1-ref.html
== 1050788-1.html about:blank
== 1053035-1-flex.html 1053035-1-ref.html
test-pref(layout.css.grid.enabled,true) == 1053035-1-grid.html 1053035-1-ref.html
== 1053035-1-grid.html 1053035-1-ref.html
== 1059167-1.html 1059167-1-ref.html
== 1059498-1.html 1059498-1-ref.html
== 1059498-2.html 1059498-1-ref.html
Expand Down
2 changes: 0 additions & 2 deletions layout/reftests/css-grid/reftest.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
default-preferences pref(layout.css.grid.enabled,true)

fails == grid-whitespace-handling-1a.xhtml grid-whitespace-handling-1-ref.xhtml
fails == grid-whitespace-handling-1b.xhtml grid-whitespace-handling-1-ref.xhtml
== grid-whitespace-handling-2.xhtml grid-whitespace-handling-2-ref.xhtml
Expand Down
2 changes: 1 addition & 1 deletion layout/reftests/list-item/reftest.list
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fuzzy-if(OSX,55,4) == numbering-1.html numbering-1-ref.html
== numbering-2.html numbering-2-ref.html
pref(layout.css.grid.enabled,true) fuzzy-if(OSX,8,1) == numbering-3.html numbering-3-ref.html
fuzzy-if(OSX,8,1) == numbering-3.html numbering-3-ref.html
fuzzy-if(OSX,72,2) == numbering-4.html numbering-4-ref.html
== numbering-5.html numbering-5-ref.html
== ol-reversed-1a.html ol-reversed-1-ref.html
Expand Down
Loading

0 comments on commit dbb3111

Please sign in to comment.