Bug 1295788 - Remove layout.css.display-contents.enabled pref.
1. Remove the preference setting in reftest.list
2. Remove the preference guard in property_database.js
3. Remove the callback function of preference change
4. Remove the preference from all.js
MozReview-Commit-ID: 6aqYmhz6c9M
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -142,17 +142,16 @@ using namespace mozilla::dom;
using namespace mozilla::image;
using namespace mozilla::layers;
using namespace mozilla::layout;
using namespace mozilla::gfx;
#define GRID_ENABLED_PREF_NAME "layout.css.grid.enabled"
#define GRID_TEMPLATE_SUBGRID_ENABLED_PREF_NAME "layout.css.grid-template-subgrid-value.enabled"
#define WEBKIT_PREFIXES_ENABLED_PREF_NAME "layout.css.prefixes.webkit"
-#define DISPLAY_CONTENTS_ENABLED_PREF_NAME "layout.css.display-contents.enabled"
#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"
#define BG_CLIP_TEXT_ENABLED_PREF_NAME "layout.css.background-clip-text.enabled"
// The time in number of frames that we estimate for a refresh driver
// to be quiescent
#define DEFAULT_QUIESCENT_FRAMES 2
// The time (milliseconds) we estimate is needed between the end of an
@@ -307,46 +306,16 @@ WebkitPrefixEnabledPrefChangeCallback(co
}
if (sIndexOfWebkitInlineFlexInDisplayTable >= 0) {
nsCSSProps::kDisplayKTable[sIndexOfWebkitInlineFlexInDisplayTable].mKeyword =
isWebkitPrefixSupportEnabled ?
eCSSKeyword__webkit_inline_flex : eCSSKeyword_UNKNOWN;
}
}
-// When the pref "layout.css.display-contents.enabled" changes, this function is
-// invoked to let us update kDisplayKTable, to selectively disable or restore
-// the entries for "contents" in that table.
-static void
-DisplayContentsEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
-{
- NS_ASSERTION(strcmp(aPrefName, DISPLAY_CONTENTS_ENABLED_PREF_NAME) == 0,
- "Did you misspell " DISPLAY_CONTENTS_ENABLED_PREF_NAME " ?");
-
- static bool sIsDisplayContentsKeywordIndexInitialized;
- static int32_t sIndexOfContentsInDisplayTable;
- bool isDisplayContentsEnabled =
- Preferences::GetBool(DISPLAY_CONTENTS_ENABLED_PREF_NAME, false);
-
- if (!sIsDisplayContentsKeywordIndexInitialized) {
- // First run: find the position of "contents" in kDisplayKTable.
- sIndexOfContentsInDisplayTable =
- nsCSSProps::FindIndexOfKeyword(eCSSKeyword_contents,
- nsCSSProps::kDisplayKTable);
- sIsDisplayContentsKeywordIndexInitialized = true;
- }
-
- // OK -- now, stomp on or restore the "contents" entry in kDisplayKTable,
- // depending on whether the pref is enabled vs. disabled.
- if (sIndexOfContentsInDisplayTable >= 0) {
- nsCSSProps::kDisplayKTable[sIndexOfContentsInDisplayTable].mKeyword =
- isDisplayContentsEnabled ? eCSSKeyword_contents : eCSSKeyword_UNKNOWN;
- }
-}
-
// When the pref "layout.css.text-align-unsafe-value.enabled" changes, this
// function is called to let us update kTextAlignKTable & kTextAlignLastKTable,
// to selectively disable or restore the entries for "unsafe" in those tables.
static void
TextAlignUnsafeEnabledPrefChangeCallback(const char* aPrefName, void* aClosure)
{
NS_ASSERTION(strcmp(aPrefName, TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME) == 0,
"Did you misspell " TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME " ?");
@@ -7529,18 +7498,16 @@ struct PrefCallbacks
};
static const PrefCallbacks kPrefCallbacks[] = {
{ GRID_ENABLED_PREF_NAME,
GridEnabledPrefChangeCallback },
{ WEBKIT_PREFIXES_ENABLED_PREF_NAME,
WebkitPrefixEnabledPrefChangeCallback },
{ TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME,
TextAlignUnsafeEnabledPrefChangeCallback },
- { DISPLAY_CONTENTS_ENABLED_PREF_NAME,
- DisplayContentsEnabledPrefChangeCallback },
{ FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME,
FloatLogicalValuesEnabledPrefChangeCallback },
{ BG_CLIP_TEXT_ENABLED_PREF_NAME,
BackgroundClipTextEnabledPrefChangeCallback },
};
/* static */
void
--- a/layout/reftests/css-display/reftest-stylo.list
+++ b/layout/reftests/css-display/reftest-stylo.list
@@ -1,37 +1,37 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
# Tests for CSS Display spec features.
# http://dev.w3.org/csswg/css-display
-fuzzy-if(Android,8,604) pref(layout.css.display-contents.enabled,true) == display-contents-acid.html display-contents-acid.html
-random pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-1.html display-contents-acid-dyn-1.html
-random pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-2.html display-contents-acid-dyn-2.html
-random pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-3.html display-contents-acid-dyn-3.html
-pref(layout.css.display-contents.enabled,true) == display-contents-generated-content.html display-contents-generated-content.html
-pref(layout.css.display-contents.enabled,true) == display-contents-generated-content-2.html display-contents-generated-content-2.html
-pref(layout.css.display-contents.enabled,true) == display-contents-style-inheritance-1.html display-contents-style-inheritance-1.html
-skip pref(layout.css.display-contents.enabled,true) == display-contents-style-inheritance-1-stylechange.html display-contents-style-inheritance-1-stylechange.html
-skip pref(layout.css.display-contents.enabled,true) fuzzy-if(winWidget,12,100) == display-contents-style-inheritance-1-dom-mutations.html display-contents-style-inheritance-1-dom-mutations.html
-pref(layout.css.display-contents.enabled,true) == display-contents-tables.xhtml display-contents-tables.xhtml
-pref(layout.css.display-contents.enabled,true) == display-contents-tables-2.xhtml display-contents-tables-2.xhtml
-pref(layout.css.display-contents.enabled,true) == display-contents-tables-3.xhtml display-contents-tables-3.xhtml
-pref(layout.css.display-contents.enabled,true) == display-contents-visibility-hidden.html display-contents-visibility-hidden.html
-pref(layout.css.display-contents.enabled,true) == display-contents-visibility-hidden-2.html display-contents-visibility-hidden-2.html
-random pref(layout.css.display-contents.enabled,true) == display-contents-495385-2d.html display-contents-495385-2d.html
-skip-if(B2G||Mulet) fuzzy-if(Android,7,3935) pref(layout.css.display-contents.enabled,true) == display-contents-xbl.xhtml display-contents-xbl.xhtml
+fuzzy-if(Android,8,604) == display-contents-acid.html display-contents-acid.html
+random == display-contents-acid-dyn-1.html display-contents-acid-dyn-1.html
+random == display-contents-acid-dyn-2.html display-contents-acid-dyn-2.html
+random == display-contents-acid-dyn-3.html display-contents-acid-dyn-3.html
+== display-contents-generated-content.html display-contents-generated-content.html
+== display-contents-generated-content-2.html display-contents-generated-content-2.html
+== display-contents-style-inheritance-1.html display-contents-style-inheritance-1.html
+skip == display-contents-style-inheritance-1-stylechange.html display-contents-style-inheritance-1-stylechange.html
+skip fuzzy-if(winWidget,12,100) == display-contents-style-inheritance-1-dom-mutations.html display-contents-style-inheritance-1-dom-mutations.html
+== display-contents-tables.xhtml display-contents-tables.xhtml
+== display-contents-tables-2.xhtml display-contents-tables-2.xhtml
+== display-contents-tables-3.xhtml display-contents-tables-3.xhtml
+== display-contents-visibility-hidden.html display-contents-visibility-hidden.html
+== display-contents-visibility-hidden-2.html display-contents-visibility-hidden-2.html
+random == display-contents-495385-2d.html display-contents-495385-2d.html
+skip-if(B2G||Mulet) fuzzy-if(Android,7,3935) == display-contents-xbl.xhtml display-contents-xbl.xhtml
# Initial mulet triage: parity with B2G/B2G Desktop
-# fuzzy-if(Android,7,1186) pref(layout.css.display-contents.enabled,true) pref(dom.webcomponents.enabled,true) == display-contents-shadow-dom-1.html display-contents-shadow-dom-1.html
-skip-if(B2G||Mulet) pref(layout.css.display-contents.enabled,true) == display-contents-xbl-2.xul display-contents-xbl-2.xul
+# fuzzy-if(Android,7,1186) pref(dom.webcomponents.enabled,true) == display-contents-shadow-dom-1.html display-contents-shadow-dom-1.html
+skip-if(B2G||Mulet) == display-contents-xbl-2.xul display-contents-xbl-2.xul
# Initial mulet triage: parity with B2G/B2G Desktop
-skip-if(B2G||Mulet) asserts(1) pref(layout.css.display-contents.enabled,true) == display-contents-xbl-3.xul display-contents-xbl-3.xul
+skip-if(B2G||Mulet) asserts(1) == display-contents-xbl-3.xul display-contents-xbl-3.xul
# bug 1089223
# Initial mulet triage: parity with B2G/B2G Desktop
-skip pref(layout.css.display-contents.enabled,true) == display-contents-xbl-4.xul display-contents-xbl-4.xul
+skip == display-contents-xbl-4.xul display-contents-xbl-4.xul
# fails (not just asserts) due to bug 1089223
-asserts(0-1) fuzzy-if(Android,8,3216) pref(layout.css.display-contents.enabled,true) == display-contents-fieldset.html display-contents-fieldset.html
+asserts(0-1) fuzzy-if(Android,8,3216) == display-contents-fieldset.html display-contents-fieldset.html
# bug 1089223
-skip-if(B2G||Mulet) asserts(1) pref(layout.css.display-contents.enabled,true) == display-contents-xbl-5.xul display-contents-xbl-5.xul
+skip-if(B2G||Mulet) asserts(1) == display-contents-xbl-5.xul display-contents-xbl-5.xul
# bug 1089223
# Initial mulet triage: parity with B2G/B2G Desktop
-pref(layout.css.display-contents.enabled,true) == display-contents-list-item-child.html display-contents-list-item-child.html
-pref(layout.css.display-contents.enabled,true) == display-contents-writing-mode-1.html display-contents-writing-mode-1.html
-pref(layout.css.display-contents.enabled,true) == display-contents-writing-mode-2.html display-contents-writing-mode-2.html
+== display-contents-list-item-child.html display-contents-list-item-child.html
+== display-contents-writing-mode-1.html display-contents-writing-mode-1.html
+== display-contents-writing-mode-2.html display-contents-writing-mode-2.html
--- a/layout/reftests/css-display/reftest.list
+++ b/layout/reftests/css-display/reftest.list
@@ -1,28 +1,28 @@
# Tests for CSS Display spec features.
# http://dev.w3.org/csswg/css-display
-fuzzy-if(Android,8,604) pref(layout.css.display-contents.enabled,true) == display-contents-acid.html display-contents-acid-ref.html
-fuzzy-if(Android,8,604) pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-1.html display-contents-acid-ref.html
-fuzzy-if(Android,8,604) pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-2.html display-contents-acid-ref.html
-fuzzy-if(Android,8,604) pref(layout.css.display-contents.enabled,true) == display-contents-acid-dyn-3.html display-contents-acid-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-generated-content.html display-contents-generated-content-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-generated-content-2.html display-contents-generated-content-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-style-inheritance-1.html display-contents-style-inheritance-1-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-style-inheritance-1-stylechange.html display-contents-style-inheritance-1-ref.html
-pref(layout.css.display-contents.enabled,true) fuzzy-if(winWidget,12,100) == display-contents-style-inheritance-1-dom-mutations.html display-contents-style-inheritance-1-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-tables.xhtml display-contents-tables-ref.xhtml
-pref(layout.css.display-contents.enabled,true) == display-contents-tables-2.xhtml display-contents-tables-ref.xhtml
-pref(layout.css.display-contents.enabled,true) == display-contents-tables-3.xhtml display-contents-tables-3-ref.xhtml
-pref(layout.css.display-contents.enabled,true) == display-contents-visibility-hidden.html display-contents-visibility-hidden-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-visibility-hidden-2.html display-contents-visibility-hidden-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-495385-2d.html display-contents-495385-2d-ref.html
-fuzzy-if(Android,7,3935) pref(layout.css.display-contents.enabled,true) == display-contents-xbl.xhtml display-contents-xbl-ref.html
-fuzzy-if(Android,7,1186) pref(layout.css.display-contents.enabled,true) pref(dom.webcomponents.enabled,true) == display-contents-shadow-dom-1.html display-contents-shadow-dom-1-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-xbl-2.xul display-contents-xbl-2-ref.xul
-asserts(1) pref(layout.css.display-contents.enabled,true) == display-contents-xbl-3.xul display-contents-xbl-3-ref.xul # bug 1089223
-skip pref(layout.css.display-contents.enabled,true) == display-contents-xbl-4.xul display-contents-xbl-4-ref.xul # fails (not just asserts) due to bug 1089223
-asserts(0-1) fuzzy-if(Android,8,3216) pref(layout.css.display-contents.enabled,true) == display-contents-fieldset.html display-contents-fieldset-ref.html # bug 1089223
-asserts(1) pref(layout.css.display-contents.enabled,true) == display-contents-xbl-5.xul display-contents-xbl-3-ref.xul # bug 1089223
-pref(layout.css.display-contents.enabled,true) == display-contents-list-item-child.html display-contents-list-item-child-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-writing-mode-1.html display-contents-writing-mode-1-ref.html
-pref(layout.css.display-contents.enabled,true) == display-contents-writing-mode-2.html display-contents-writing-mode-2-ref.html
+fuzzy-if(Android,8,604) == display-contents-acid.html display-contents-acid-ref.html
+fuzzy-if(Android,8,604) == display-contents-acid-dyn-1.html display-contents-acid-ref.html
+fuzzy-if(Android,8,604) == display-contents-acid-dyn-2.html display-contents-acid-ref.html
+fuzzy-if(Android,8,604) == display-contents-acid-dyn-3.html display-contents-acid-ref.html
+== display-contents-generated-content.html display-contents-generated-content-ref.html
+== display-contents-generated-content-2.html display-contents-generated-content-ref.html
+== display-contents-style-inheritance-1.html display-contents-style-inheritance-1-ref.html
+== display-contents-style-inheritance-1-stylechange.html display-contents-style-inheritance-1-ref.html
+fuzzy-if(winWidget,12,100) == display-contents-style-inheritance-1-dom-mutations.html display-contents-style-inheritance-1-ref.html
+== display-contents-tables.xhtml display-contents-tables-ref.xhtml
+== display-contents-tables-2.xhtml display-contents-tables-ref.xhtml
+== display-contents-tables-3.xhtml display-contents-tables-3-ref.xhtml
+== display-contents-visibility-hidden.html display-contents-visibility-hidden-ref.html
+== display-contents-visibility-hidden-2.html display-contents-visibility-hidden-ref.html
+== display-contents-495385-2d.html display-contents-495385-2d-ref.html
+fuzzy-if(Android,7,3935) == display-contents-xbl.xhtml display-contents-xbl-ref.html
+fuzzy-if(Android,7,1186) pref(dom.webcomponents.enabled,true) == display-contents-shadow-dom-1.html display-contents-shadow-dom-1-ref.html
+== display-contents-xbl-2.xul display-contents-xbl-2-ref.xul
+asserts(1) == display-contents-xbl-3.xul display-contents-xbl-3-ref.xul # bug 1089223
+skip == display-contents-xbl-4.xul display-contents-xbl-4-ref.xul # fails (not just asserts) due to bug 1089223
+asserts(0-1) fuzzy-if(Android,8,3216) == display-contents-fieldset.html display-contents-fieldset-ref.html # bug 1089223
+asserts(1) == display-contents-xbl-5.xul display-contents-xbl-3-ref.xul # bug 1089223
+== display-contents-list-item-child.html display-contents-list-item-child-ref.html
+== display-contents-writing-mode-1.html display-contents-writing-mode-1-ref.html
+== display-contents-writing-mode-2.html display-contents-writing-mode-2-ref.html
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1325,18 +1325,16 @@ KTableEntry nsCSSProps::kDisplayKTable[]
// The next two entries are controlled by the layout.css.grid.enabled pref.
{ eCSSKeyword_grid, StyleDisplay::Grid },
{ eCSSKeyword_inline_grid, StyleDisplay::InlineGrid },
// The next 4 entries are controlled by the layout.css.prefixes.webkit pref.
{ eCSSKeyword__webkit_box, StyleDisplay::WebkitBox },
{ eCSSKeyword__webkit_inline_box, StyleDisplay::WebkitInlineBox },
{ eCSSKeyword__webkit_flex, StyleDisplay::Flex },
{ eCSSKeyword__webkit_inline_flex, StyleDisplay::InlineFlex },
- // The next entry is controlled by the layout.css.display-contents.enabled
- // pref.
{ eCSSKeyword_contents, StyleDisplay::Contents },
{ eCSSKeyword_UNKNOWN, -1 }
};
const KTableEntry nsCSSProps::kEmptyCellsKTable[] = {
{ eCSSKeyword_show, NS_STYLE_TABLE_EMPTY_CELLS_SHOW },
{ eCSSKeyword_hide, NS_STYLE_TABLE_EMPTY_CELLS_HIDE },
{ eCSSKeyword_UNKNOWN, -1 }
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -6666,19 +6666,17 @@ if (IsCSSPropertyPrefEnabled("layout.css
subproperties: [ "grid-column-gap", "grid-row-gap" ],
initial_values: [ "0", "0 0" ],
other_values: [ "1ch 0", "1px 1%", "1em 1px", "calc(1px) calc(1%)" ],
invalid_values: [ "-1px", "1px -1px", "1px 1px 1px", "inherit 1px",
"1px auto" ]
};
}
-if (IsCSSPropertyPrefEnabled("layout.css.display-contents.enabled")) {
- gCSSProperties["display"].other_values.push("contents");
-}
+gCSSProperties["display"].other_values.push("contents");
if (IsCSSPropertyPrefEnabled("layout.css.contain.enabled")) {
gCSSProperties["contain"] = {
domProp: "contain",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2612,19 +2612,16 @@ pref("layout.css.grid.enabled", true);
#endif
// Is support for CSS "grid-template-{columns,rows}: subgrid X" enabled?
pref("layout.css.grid-template-subgrid-value.enabled", false);
// Is support for CSS contain enabled?
pref("layout.css.contain.enabled", false);
-// Is support for CSS display:contents enabled?
-pref("layout.css.display-contents.enabled", true);
-
// Is support for CSS box-decoration-break enabled?
pref("layout.css.box-decoration-break.enabled", true);
// Is layout of CSS outline-style:auto enabled?
pref("layout.css.outline-style-auto.enabled", false);
// Is CSSOM-View scroll-behavior and its MSD smooth scrolling enabled?
pref("layout.css.scroll-behavior.enabled", true);