Bug 799775 part 2: Add decl to inherit "-moz-order" on table outer frames in ua.css. r=dbaron
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 11 Oct 2012 14:33:24 -0700
changeset 110118 f858236f4e6201dcca2fc7c0583d0aa968b72c9e
parent 110117 7e4cdcd4179873a0fb2ab3d1786020103b11c3df
child 110119 d9940b9d6f5fcf3ad164262495ec304d99d2d7c2
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersdbaron
bugs799775
milestone19.0a1
Bug 799775 part 2: Add decl to inherit "-moz-order" on table outer frames in ua.css. r=dbaron
layout/style/test/Makefile.in
layout/style/test/file_flexbox_order_table.html
layout/style/test/test_flexbox_order_table.html
layout/style/ua.css
--- a/layout/style/test/Makefile.in
+++ b/layout/style/test/Makefile.in
@@ -198,16 +198,18 @@ MOCHITEST_FILES +=	\
 		test_flexbox_flex_grow_and_shrink.html \
 		file_flexbox_flex_shorthand.html \
 		test_flexbox_flex_shorthand.html \
 		file_flexbox_layout.html \
 		test_flexbox_layout.html \
 		flexbox_layout_testcases.js \
 		file_flexbox_order.html \
 		test_flexbox_order.html \
+		file_flexbox_order_table.html \
+		test_flexbox_order_table.html \
 		$(NULL)
 endif
 
 _VISITED_REFTEST_FILES = \
 		$(shell find $(topsrcdir)/layout/reftests/css-visited/ -name '*.html' -o -name '*.xhtml') \
 		$(topsrcdir)/layout/reftests/svg/pseudo-classes-02.svg \
 		$(topsrcdir)/layout/reftests/svg/pseudo-classes-02-ref.svg \
 		$(topsrcdir)/layout/reftests/svg/as-image/lime100x100.svg \
copy from layout/style/test/file_flexbox_order.html
copy to layout/style/test/file_flexbox_order_table.html
--- a/layout/style/test/file_flexbox_order.html
+++ b/layout/style/test/file_flexbox_order_table.html
@@ -9,16 +9,20 @@
       height: 30px;
     }
 
     refA, refB, refC {
       display: block;
       float: left;
     }
 
+    div#a, div#b, div#c {
+      display: table;
+    }
+
     div#a, refA {
       background: lightgreen;
       width: 20px;
       height: 30px;
     }
     div#b, refB {
       background: orange;
       width: 30px;
@@ -63,17 +67,17 @@
   </div>
 
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.7">
 "use strict";
 
 /* This testcase ensures that we honor the "order" property when ordering
- * flex items within a flex container.
+ * tables as flex items within a flex container.
  *
  * Note: The items in this testcase don't overlap, so this testcase does _not_
  * test paint ordering.  It only tests horizontal ordering in a flex container.
  */
 
 // Use "is()", "ok()", and "todo()" from parent document.
 var is = parent.is;
 var ok = parent.ok;
copy from layout/style/test/test_flexbox_order.html
copy to layout/style/test/test_flexbox_order_table.html
--- a/layout/style/test/test_flexbox_order.html
+++ b/layout/style/test/test_flexbox_order_table.html
@@ -1,46 +1,48 @@
 <!DOCTYPE HTML>
 <html>
 <!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=666041
+https://bugzilla.mozilla.org/show_bug.cgi?id=799775
 -->
 <head>
   <meta charset="utf-8">
-  <title>Test for Bug 666041</title>
+  <title>Test for Bug 799775</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
 <body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=666041">Mozilla Bug 666041</a>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=799775">Mozilla Bug 799775</a>
 <div id="display">
   <iframe id="iframe" style="height: 100px; width: 200px"></iframe>
 </div>
 <pre id="test">
 <script type="application/javascript;version=1.7">
 "use strict";
 
-/** Test for Bug 666041 **/
+/** Test for Bug 799775 **/
 
 /*
  * This mochitest runs in an iframe so that we can selectively turn on the
  * flexbox about:config pref before its document is instantiated.
  *
- * See the iframe's source ("file_flexbox_order.html") for the actual
+ * See the iframe's source ("file_flexbox_order_table.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");
-
-SpecialPowers.setBoolPref("layout.css.flexbox.enabled", true);
-document.getElementById("iframe").src = "file_flexbox_order.html";
+if(SpecialPowers.getBoolPref("layout.css.flexbox.enabled")) {
+  document.getElementById("iframe").src = "file_flexbox_order_table.html";
+} else {
+  todo(false,
+       "Finishing early -- flexbox pref is disabled, and this test only " +
+       "works if the pref is enabled at startup-time, when ua.css is parsed");
+  finish();
+}
 
 function finish() {
-  SpecialPowers.clearUserPref("layout.css.flexbox.enabled");
   SimpleTest.finish();
 }
 </script>
 </pre>
 </body>
 </html>
--- a/layout/style/ua.css
+++ b/layout/style/ua.css
@@ -37,16 +37,17 @@
   bottom: inherit;
   left: inherit;
   z-index: inherit;
   page-break-before: inherit;
   page-break-after: inherit;
   vertical-align: inherit; /* needed for inline-table */
   line-height: inherit; /* needed for vertical-align on inline-table */
   -moz-align-self: inherit; /* needed for "align-self: auto" to work on table */
+  -moz-order: inherit; /* needed for "order" to work on table flex items */
   /* Bug 722777 */
   -moz-transform: inherit;
   -moz-transform-origin: inherit;
   /* Bug 724750 */
   -moz-backface-visibility: inherit;
 }
 
 *|*::-moz-table-row {