Bug 783409: Enable "layout.css.flexbox.enabled" pref. r=dbaron
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 07 Dec 2012 10:58:34 -0800
changeset 115346 9bf579519470
parent 115345 4bf567bd1a3c
child 115347 76fdff965077
push id19296
push userdholbert@mozilla.com
push date2012-12-07 19:17 +0000
Treeherderresults
reviewersdbaron
bugs783409
milestone20.0a1
Bug 783409: Enable "layout.css.flexbox.enabled" pref. r=dbaron
layout/reftests/flexbox/reftest.list
layout/style/test/test_flexbox_align_self_auto.html
layout/style/test/test_flexbox_child_display_values.html
layout/style/test/test_flexbox_flex_grow_and_shrink.html
layout/style/test/test_flexbox_flex_shorthand.html
layout/style/test/test_flexbox_layout.html
layout/style/test/test_flexbox_min_size_auto.html
layout/style/test/test_flexbox_order.html
modules/libpref/src/init/all.js
--- a/layout/reftests/flexbox/reftest.list
+++ b/layout/reftests/flexbox/reftest.list
@@ -1,36 +1,25 @@
-# Tests for flexbox pref "layout.css.flexbox.enabled"
-# (Note that it defaults to off for now)
-== flexbox-pref-1.xhtml flexbox-pref-1-disabled-ref.xhtml
+# Check that flexbox pref is default-enabled:
+== flexbox-pref-1.xhtml flexbox-pref-1-enabled-ref.xhtml
+
+# Check that manually setting the pref on/off w/ test-pref() works correctly:
 test-pref(layout.css.flexbox.enabled,false) == flexbox-pref-1.xhtml flexbox-pref-1-disabled-ref.xhtml
 test-pref(layout.css.flexbox.enabled,true) == flexbox-pref-1.xhtml flexbox-pref-1-enabled-ref.xhtml
 
-# Enable pref for remaining tests
-# (Most tests only need it in the testcase, but a few use it in the
-# reference case, so we'll just enable it using "pref()" to make
-# it available for both.)
-default-preferences pref(layout.css.flexbox.enabled,true)
-
 # Tests for cross-axis alignment (align-self / align-items properties)
 == flexbox-align-self-baseline-horiz-1.xhtml  flexbox-align-self-baseline-horiz-1-ref.xhtml
 fails == flexbox-align-self-baseline-horiz-2.xhtml  flexbox-align-self-baseline-horiz-2-ref.xhtml # bug 793456, and possibly others
 # This one fails on windows R (but not Ru, strangely). On Windows R, the
 # single-line <label> flex item has a different background size in test vs. ref
 random-if(winWidget) == flexbox-align-self-baseline-horiz-3.xhtml  flexbox-align-self-baseline-horiz-3-ref.xhtml # XXXdholbert investigate
-# XXXdholbert This test needs the flexbox pref to be enabled _at startup time_
-# (when we parse ua.css) in order to pass -- so it'll fail until we enable the
-# flexbox pref by default (bug 783409):
-fails == flexbox-align-self-baseline-horiz-4.xhtml flexbox-align-self-baseline-horiz-4-ref.xhtml
+== flexbox-align-self-baseline-horiz-4.xhtml flexbox-align-self-baseline-horiz-4-ref.xhtml
 
 == flexbox-align-self-horiz-1-block.xhtml  flexbox-align-self-horiz-1-ref.xhtml
-# XXXdholbert This test needs the flexbox pref to be enabled _at startup time_
-# (when we parse ua.css) in order to pass -- so it'll fail until we enable the
-# flexbox pref by default (bug 783409):
-fails == flexbox-align-self-horiz-1-table.xhtml  flexbox-align-self-horiz-1-ref.xhtml
+== flexbox-align-self-horiz-1-table.xhtml  flexbox-align-self-horiz-1-ref.xhtml
 == flexbox-align-self-horiz-2.xhtml  flexbox-align-self-horiz-2-ref.xhtml
 == flexbox-align-self-horiz-3.xhtml  flexbox-align-self-horiz-3-ref.xhtml
 == flexbox-align-self-horiz-4.xhtml  flexbox-align-self-horiz-4-ref.xhtml
 == flexbox-align-self-horiz-5.xhtml  flexbox-align-self-horiz-5-ref.xhtml
 == flexbox-align-self-vert-1.xhtml  flexbox-align-self-vert-1-ref.xhtml
 == flexbox-align-self-vert-2.xhtml  flexbox-align-self-vert-2-ref.xhtml
 == flexbox-align-self-vert-3.xhtml  flexbox-align-self-vert-3-ref.xhtml
 == flexbox-align-self-vert-4.xhtml  flexbox-align-self-vert-4-ref.xhtml
--- a/layout/style/test/test_flexbox_align_self_auto.html
+++ b/layout/style/test/test_flexbox_align_self_auto.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_align_self_auto.html") for the actual
  * test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src = "file_flexbox_align_self_auto.html";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
 </pre>
--- a/layout/style/test/test_flexbox_child_display_values.html
+++ b/layout/style/test/test_flexbox_child_display_values.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_child_display_values.xhtml") for the
  * actual test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src =
   "file_flexbox_child_display_values.xhtml";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
--- a/layout/style/test/test_flexbox_flex_grow_and_shrink.html
+++ b/layout/style/test/test_flexbox_flex_grow_and_shrink.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_flex_grow_and_shrink.html") for
  * the actual test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src =
   "file_flexbox_flex_grow_and_shrink.html";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
--- a/layout/style/test/test_flexbox_flex_shorthand.html
+++ b/layout/style/test/test_flexbox_flex_shorthand.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_flex_shorthand.html") for the actual
  * test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src = "file_flexbox_flex_shorthand.html";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
 </pre>
--- a/layout/style/test/test_flexbox_layout.html
+++ b/layout/style/test/test_flexbox_layout.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_layout.html") for the actual
  * test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src = "file_flexbox_layout.html";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
 </pre>
--- a/layout/style/test/test_flexbox_min_size_auto.html
+++ b/layout/style/test/test_flexbox_min_size_auto.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_min_size_auto.html") for the actual
  * test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src = "file_flexbox_min_size_auto.html";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
 </pre>
--- a/layout/style/test/test_flexbox_order.html
+++ b/layout/style/test/test_flexbox_order.html
@@ -25,20 +25,19 @@ https://bugzilla.mozilla.org/show_bug.cg
  * flexbox about:config pref before its document is instantiated.
  *
  * See the iframe's source ("file_flexbox_order.html") for the actual
  * test code and for more documentation.
  */
 
 SimpleTest.waitForExplicitFinish();
 
-ok(!SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
-   "expecting flexbox pref to be disabled by default");
+ok(SpecialPowers.getBoolPref("layout.css.flexbox.enabled"),
+   "expecting flexbox pref to be enabled by default");
 
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
 document.getElementById("iframe").src = "file_flexbox_order.html";
 
 function finish() {
   SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
 </pre>
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -1617,17 +1617,17 @@ pref("layout.css.dpi", -1);
 // on Mac). A positive value is used as-is. This effectively controls the size
 // of a CSS "px". This is only used for windows on the screen, not for printing.
 pref("layout.css.devPixelsPerPx", "-1.0");
 
 // Is support for the the @supports rule enabled?
 pref("layout.css.supports-rule.enabled", true);
 
 // Is support for CSS Flexbox enabled?
-pref("layout.css.flexbox.enabled", false);
+pref("layout.css.flexbox.enabled", true);
 
 // Are sets of prefixed properties supported?
 pref("layout.css.prefixes.border-image", true);
 pref("layout.css.prefixes.transforms", true);
 pref("layout.css.prefixes.transitions", true);
 pref("layout.css.prefixes.animations", true);
 
 // pref for which side vertical scrollbars should be on