Bug 1365163 - Remove pref layout.css.display-flow-root.enabled. r=mats
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 05 Jun 2017 15:59:22 -0700
changeset 410649 1a313acd411064962b235f0ef48d018f9b16f06b
parent 410648 ce3003cd38bcca606b1019b380bb985809c99bd0
child 410650 02fb002e96bf32429d571ab854596269add0195e
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1365163
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1365163 - Remove pref layout.css.display-flow-root.enabled. r=mats MozReview-Commit-ID: AA3tKHCQ5E0
layout/base/nsLayoutUtils.cpp
layout/reftests/css-display/display-flow-root-disabled-001-ref.html
layout/reftests/css-display/reftest.list
layout/style/nsCSSProps.cpp
layout/style/test/property_database.js
modules/libpref/init/all.js
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -148,17 +148,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_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"
 
 // 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
 // idle time and the next Tick.
@@ -315,46 +314,16 @@ WebkitPrefixEnabledPrefChangeCallback(co
   }
   if (sIndexOfWebkitInlineFlexInDisplayTable >= 0) {
     nsCSSProps::kDisplayKTable[sIndexOfWebkitInlineFlexInDisplayTable].mKeyword =
       isWebkitPrefixSupportEnabled ?
       eCSSKeyword__webkit_inline_flex : eCSSKeyword_UNKNOWN;
   }
 }
 
-// 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.
 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 " ?");
@@ -7775,18 +7744,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_FLOW_ROOT_ENABLED_PREF_NAME,
-    DisplayFlowRootEnabledPrefChangeCallback },
   { FLOAT_LOGICAL_VALUES_ENABLED_PREF_NAME,
     FloatLogicalValuesEnabledPrefChangeCallback },
 };
 
 /* static */
 void
 nsLayoutUtils::Initialize()
 {
deleted file mode 100644
--- 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>
--- a/layout/reftests/css-display/reftest.list
+++ b/layout/reftests/css-display/reftest.list
@@ -23,10 +23,9 @@ asserts(1) asserts-if(styloVsGecko,2) ==
 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) asserts-if(styloVsGecko,2) == 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-dyn-insert-text.html display-contents-dyn-insert-text-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
 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
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -1289,17 +1289,16 @@ KTableEntry nsCSSProps::kDisplayKTable[]
   { 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 },
   { 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 }
 };
 
 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
@@ -7847,19 +7847,17 @@ if (IsCSSPropertyPrefEnabled("layout.css
   gCSSProperties["clear"].other_values.push("inline-end");
 } else {
   gCSSProperties["float"].invalid_values.push("inline-start");
   gCSSProperties["float"].invalid_values.push("inline-end");
   gCSSProperties["clear"].invalid_values.push("inline-start");
   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) {
   var entry = gCSSProperties[prop];
   if (entry.alias_for) {
     var aliasTargetEntry = gCSSProperties[entry.alias_for];
     if (!aliasTargetEntry) {
       ok(false,
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2881,19 +2881,16 @@ pref("layout.css.overflow-clip-box.enabl
 pref("layout.css.grid.enabled", true);
 
 // 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: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);
 
 // 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);