From 78af557ec81c19408b8e48c879666e51287a1012 Mon Sep 17 00:00:00 2001 From: Matt Brubeck <mbrubeck@mozilla.com> Date: Mon, 5 Jun 2017 15:59:22 -0700 Subject: [PATCH] Bug 1365163 - Remove pref layout.css.display-flow-root.enabled. r=mats MozReview-Commit-ID: AA3tKHCQ5E0 --HG-- extra : rebase_source : 9a7b16043e4aff09a4997138a9016e2f7f791f58 --- layout/base/nsLayoutUtils.cpp | 33 ------------ .../display-flow-root-disabled-001-ref.html | 51 ------------------- layout/reftests/css-display/reftest.list | 3 +- layout/style/nsCSSProps.cpp | 1 - layout/style/test/property_database.js | 4 +- modules/libpref/init/all.js | 3 -- 6 files changed, 2 insertions(+), 93 deletions(-) delete mode 100644 layout/reftests/css-display/display-flow-root-disabled-001-ref.html diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 35c145abb498f..e46ed972732f1 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -153,7 +153,6 @@ 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_FLOW_ROOT_ENABLED_PREF_NAME "layout.css.display-flow-root.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" @@ -320,36 +319,6 @@ WebkitPrefixEnabledPrefChangeCallback(const char* aPrefName, void* aClosure) } } -// When the pref "layout.css.display-flow-root.enabled" changes, this function is -// invoked to let us update kDisplayKTable, to selectively disable or restore -// the entries for "flow-root" in that table. -static void -DisplayFlowRootEnabledPrefChangeCallback(const char* aPrefName, void* aClosure) -{ - NS_ASSERTION(strcmp(aPrefName, DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME) == 0, - "Did you misspell " DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME " ?"); - - static bool sIsDisplayFlowRootKeywordIndexInitialized; - static int32_t sIndexOfFlowRootInDisplayTable; - bool isDisplayFlowRootEnabled = - Preferences::GetBool(DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME, false); - - if (!sIsDisplayFlowRootKeywordIndexInitialized) { - // First run: find the position of "flow-root" in kDisplayKTable. - sIndexOfFlowRootInDisplayTable = - nsCSSProps::FindIndexOfKeyword(eCSSKeyword_flow_root, - nsCSSProps::kDisplayKTable); - sIsDisplayFlowRootKeywordIndexInitialized = true; - } - - // OK -- now, stomp on or restore the "flow-root" entry in kDisplayKTable, - // depending on whether the pref is enabled vs. disabled. - if (sIndexOfFlowRootInDisplayTable >= 0) { - nsCSSProps::kDisplayKTable[sIndexOfFlowRootInDisplayTable].mKeyword = - isDisplayFlowRootEnabled ? eCSSKeyword_flow_root : 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. @@ -7780,8 +7749,6 @@ static const PrefCallbacks kPrefCallbacks[] = { WebkitPrefixEnabledPrefChangeCallback }, { TEXT_ALIGN_UNSAFE_ENABLED_PREF_NAME, TextAlignUnsafeEnabledPrefChangeCallback }, - { DISPLAY_FLOW_ROOT_ENABLED_PREF_NAME, - DisplayFlowRootEnabledPrefChangeCallback }, { FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME, FloatLogicalValuesEnabledPrefChangeCallback }, }; diff --git a/layout/reftests/css-display/display-flow-root-disabled-001-ref.html b/layout/reftests/css-display/display-flow-root-disabled-001-ref.html deleted file mode 100644 index 15f99ceb0c6bc..0000000000000 --- a/layout/reftests/css-display/display-flow-root-disabled-001-ref.html +++ /dev/null @@ -1,51 +0,0 @@ -<!DOCTYPE HTML> -<!-- - Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ ---> -<html><head> - <meta charset="utf-8"> - <title>Reference: display:flow-root (disabled)</title> - <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1322191"> - <style type="text/css"> -html,body { - color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0; -} - -.float { - float: left; - width: 20px; - height: 40px; - background: pink; -} - - </style> -</head> -<body> - -<div style="border:1px solid"> - <span> - <div style="margin: 20px 0">x</div> - </span> -</div> - -<div style="border:1px solid"> - <span><div class="float"></div></span> -</div> - -<div style="border:1px solid"> - <div class="float"></div> - <span style="border:1px solid">x</span> -</div> - -<span> - <span style="display:inline-block; margin-top:20px"><div>x</div></span> -</span> - -<div style="margin-top:20px"></div> -<span style="border:3px solid; height:10px"> - <!-- this tests that a flow-root fills the available width, and that 'height' applies --> -</span> - -</body> -</html> diff --git a/layout/reftests/css-display/reftest.list b/layout/reftests/css-display/reftest.list index 60e97d3d9ca42..d09842c55effc 100644 --- a/layout/reftests/css-display/reftest.list +++ b/layout/reftests/css-display/reftest.list @@ -28,5 +28,4 @@ asserts(1) asserts-if(styloVsGecko,2) == display-contents-xbl-5.xul display-cont == 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 needs-focus == display-contents-state-change.html display-contents-state-change-ref.html -pref(layout.css.display-flow-root.enabled,true) == display-flow-root-001.html display-flow-root-001-ref.html -pref(layout.css.display-flow-root.enabled,false) fails-if(styloVsGecko||stylo) == display-flow-root-001.html display-flow-root-disabled-001-ref.html +== display-flow-root-001.html display-flow-root-001-ref.html \ No newline at end of file diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index 2079b118a1632..b92a148339312 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -1294,7 +1294,6 @@ KTableEntry nsCSSProps::kDisplayKTable[] = { { eCSSKeyword__webkit_flex, StyleDisplay::Flex }, { eCSSKeyword__webkit_inline_flex, StyleDisplay::InlineFlex }, { eCSSKeyword_contents, StyleDisplay::Contents }, - // The next entry is controlled by the layout.css.display-flow-root.enabled pref. { eCSSKeyword_flow_root, StyleDisplay::FlowRoot }, { eCSSKeyword_UNKNOWN, -1 } }; diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 8559616344b73..6632e9a8139b0 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -7852,9 +7852,7 @@ if (IsCSSPropertyPrefEnabled("layout.css.float-logical-values.enabled")) { gCSSProperties["clear"].invalid_values.push("inline-end"); } -if (IsCSSPropertyPrefEnabled("layout.css.display-flow-root.enabled")) { - gCSSProperties["display"].other_values.push("flow-root"); -} +gCSSProperties["display"].other_values.push("flow-root"); // Copy aliased properties' fields from their alias targets. for (var prop in gCSSProperties) { diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 6ae152a1bcbeb..27c2617cad320 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2886,9 +2886,6 @@ 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:flow-root enabled? -pref("layout.css.display-flow-root.enabled", true); - // Is support for CSS box-decoration-break enabled? pref("layout.css.box-decoration-break.enabled", true); -- GitLab