Bug 1607575 - Change consumers of XUL ordinal attribute to use the -moz-box-ordinal-group style instead r=bgrins
authorKirk Steuber <ksteuber@mozilla.com>
Wed, 22 Jan 2020 17:23:47 +0100
changeset 511466 e2c67219b588c23e34680a28ddcd8f566bc6d988
parent 511465 5a23d2af7031dfc3a63d07f231cd0873b8438752
child 511467 ac902c6ec3054dccc7ddf2d02fb629d3aa42d1e4
push id105814
push userarchaeopteryx@coole-files.de
push dateThu, 23 Jan 2020 12:36:19 +0000
treeherderautoland@ac902c6ec305 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1607575
milestone74.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 1607575 - Change consumers of XUL ordinal attribute to use the -moz-box-ordinal-group style instead r=bgrins Differential Revision: https://phabricator.services.mozilla.com/D59762
browser/base/content/browser.xhtml
browser/components/places/tests/chrome/test_0_bug510634.xhtml
browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xhtml
browser/components/places/tests/chrome/test_bug549192.xhtml
browser/components/places/tests/chrome/test_bug549491.xhtml
browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xhtml
browser/components/places/tests/chrome/test_treeview_date.xhtml
layout/reftests/box/flexbox-attributes-no-box-horizontal-ref.xhtml
layout/reftests/box/flexbox-attributes-no-box-horizontal.xhtml
layout/reftests/box/flexbox-attributes-no-box-vertical-ref.xhtml
layout/reftests/box/flexbox-attributes-no-box-vertical.xhtml
layout/reftests/box/flexbox-attributes-no-input-horizontal-ref.xhtml
layout/reftests/box/flexbox-attributes-no-input-horizontal.xhtml
layout/reftests/box/flexbox-attributes-no-input-vertical-ref.xhtml
layout/reftests/box/flexbox-attributes-no-input-vertical.xhtml
layout/xul/tree/crashtests/430394-1.xhtml
layout/xul/tree/crashtests/730441-1.xhtml
layout/xul/tree/crashtests/730441-2.xhtml
layout/xul/tree/crashtests/crashtests.list
toolkit/content/xul.css
--- a/browser/base/content/browser.xhtml
+++ b/browser/base/content/browser.xhtml
@@ -677,17 +677,17 @@
                autohide="true"
 #endif
                context="toolbar-context-menu">
         <toolbaritem id="menubar-items" align="center">
 # The entire main menubar is placed into browser-menubar.inc, so that it can be
 # shared with other top level windows in macWindow.inc.xhtml.
 #include browser-menubar.inc
         </toolbaritem>
-        <spacer flex="1" skipintoolbarset="true" ordinal="1000"/>
+        <spacer flex="1" skipintoolbarset="true" style="-moz-box-ordinal-group: 1000;"/>
 #include titlebar-items.inc.xhtml
       </toolbar>
 
       <toolbar id="TabsToolbar"
                class="browser-toolbar titlebar-color"
                fullscreentoolbar="true"
                customizable="true"
                customizationtarget="TabsToolbar-customization-target"
@@ -1128,17 +1128,17 @@
                        class="toolbarbutton-1"
                        badged="true"
                        consumeanchor="PanelUI-button"
                        label="&brandShortName;"
                        tooltiptext="&appmenu.tooltip;"/>
       </toolbaritem>
 
       <hbox id="window-controls" hidden="true" pack="end" skipintoolbarset="true"
-            ordinal="1000">
+            style="-moz-box-ordinal-group: 1000;">
         <toolbarbutton id="minimize-button"
                        tooltiptext="&fullScreenMinimize.tooltip;"
                        oncommand="window.minimize();"/>
 
         <toolbarbutton id="restore-button"
 #ifdef XP_MACOSX
 # Prior to 10.7 there wasn't a native fullscreen button so we use #restore-button
 # to exit fullscreen and want it to behave like other toolbar buttons.
--- a/browser/components/places/tests/chrome/test_0_bug510634.xhtml
+++ b/browser/components/places/tests/chrome/test_0_bug510634.xhtml
@@ -21,17 +21,17 @@
   <script type="application/javascript" src="head.js" />
 
   <body xmlns="http://www.w3.org/1999/xhtml" />
 
   <tree id="tree"
         is="places-tree"
         flex="1">
     <treecols>
-      <treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
+      <treecol label="Title" id="title" anonid="title" primary="true" style="-moz-box-ordinal-group: 1;" flex="1"/>
     </treecols>
     <treechildren flex="1"/>
   </tree>
 
   <script type="application/javascript">
   <![CDATA[
 
     /**
--- a/browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xhtml
+++ b/browser/components/places/tests/chrome/test_bug1163447_selectItems_through_shortcut.xhtml
@@ -22,17 +22,17 @@
   <script type="application/javascript" src="head.js" />
 
   <body xmlns="http://www.w3.org/1999/xhtml" />
 
   <tree id="tree"
         is="places-tree"
         flex="1">
     <treecols>
-      <treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
+      <treecol label="Title" id="title" anonid="title" primary="true" style="-moz-box-ordinal-group: 1;" flex="1"/>
     </treecols>
     <treechildren flex="1"/>
   </tree>
 
   <script type="application/javascript"><![CDATA[
 
     /**
      * Bug 1163447: places-tree should be able to select an item within the toolbar, and
--- a/browser/components/places/tests/chrome/test_bug549192.xhtml
+++ b/browser/components/places/tests/chrome/test_bug549192.xhtml
@@ -23,17 +23,17 @@
 
   <body xmlns="http://www.w3.org/1999/xhtml" />
 
   <tree id="tree"
         is="places-tree"
         flatList="true"
         flex="1">
     <treecols>
-      <treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
+      <treecol label="Title" id="title" anonid="title" primary="true" style="-moz-box-ordinal-group: 1;" flex="1"/>
     </treecols>
     <treechildren flex="1"/>
   </tree>
 
   <script type="application/javascript"><![CDATA[
     /**
      * Bug 874407
      * Ensures that history views are updated properly after visits.
--- a/browser/components/places/tests/chrome/test_bug549491.xhtml
+++ b/browser/components/places/tests/chrome/test_bug549491.xhtml
@@ -23,17 +23,17 @@
 
   <body xmlns="http://www.w3.org/1999/xhtml" />
 
   <tree id="tree"
         is="places-tree"
         flatList="true"
         flex="1">
     <treecols>
-      <treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
+      <treecol label="Title" id="title" anonid="title" primary="true" style="-moz-box-ordinal-group: 1;" flex="1"/>
       <splitter class="tree-splitter"/>
       <treecol label="Date" anonid="date" flex="1"/>
     </treecols>
     <treechildren flex="1"/>
   </tree>
 
   <script type="application/javascript"><![CDATA[
     /**
--- a/browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xhtml
+++ b/browser/components/places/tests/chrome/test_selectItems_on_nested_tree.xhtml
@@ -22,17 +22,17 @@
   <script type="application/javascript" src="head.js" />
 
   <body xmlns="http://www.w3.org/1999/xhtml" />
 
   <tree id="tree"
         is="places-tree"
         flex="1">
     <treecols>
-      <treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
+      <treecol label="Title" id="title" anonid="title" primary="true" style="-moz-box-ordinal-group: 1;" flex="1"/>
     </treecols>
     <treechildren flex="1"/>
   </tree>
 
   <script type="application/javascript"><![CDATA[
     /**
      * Ensure that selectItems doesn't recurse infinitely in nested trees.
      */
--- a/browser/components/places/tests/chrome/test_treeview_date.xhtml
+++ b/browser/components/places/tests/chrome/test_treeview_date.xhtml
@@ -22,17 +22,17 @@
 
   <body xmlns="http://www.w3.org/1999/xhtml" />
 
   <tree id="tree"
         is="places-tree"
         flatList="true"
         flex="1">
     <treecols>
-      <treecol label="Title" id="title" anonid="title" primary="true" ordinal="1" flex="1"/>
+      <treecol label="Title" id="title" anonid="title" primary="true" style="-moz-box-ordinal-group: 1;" flex="1"/>
       <splitter class="tree-splitter"/>
       <treecol label="Tags" id="tags" anonid="tags" flex="1"/>
       <splitter class="tree-splitter"/>
       <treecol label="Url" id="url" anonid="url" flex="1"/>
       <splitter class="tree-splitter"/>
       <treecol label="Visit Date" id="date" anonid="date" flex="1"/>
       <splitter class="tree-splitter"/>
       <treecol label="Visit Count" id="visitCount" anonid="visitCount" flex="1"/>
--- a/layout/reftests/box/flexbox-attributes-no-box-horizontal-ref.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-box-horizontal-ref.xhtml
@@ -24,18 +24,16 @@ div > div {
   border: 1px solid blue;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <div>2</div>
-  <div>1</div>
   <div>width</div>
   <div>height</div>
   <div>minwidth</div>
   <div>minheight</div>
   <div>maxwidth</div>
   <div>maxheight</div>
   <div>flex</div>
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-box-horizontal.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-box-horizontal.xhtml
@@ -24,18 +24,16 @@ div > div {
   border: 1px solid blue;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <div ordinal="2">2</div>
-  <div ordinal="1">1</div>
   <div width="100">width</div>
   <div height="100">height</div>
   <div minwidth="100">minwidth</div>
   <div minheight="100">minheight</div>
   <div maxwidth="50">maxwidth</div>
   <div maxheight="15">maxheight</div>
   <div flex="100">flex</div>
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-box-vertical-ref.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-box-vertical-ref.xhtml
@@ -24,18 +24,16 @@ div > div {
   border: 1px solid blue;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <div>2</div>
-  <div>1</div>
   <div>width</div>
   <div>height</div>
   <div>minwidth</div>
   <div>minheight</div>
   <div>maxwidth</div>
   <div>maxheight</div>
   <div>flex</div>
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-box-vertical.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-box-vertical.xhtml
@@ -24,18 +24,16 @@ div > div {
   border: 1px solid blue;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <div ordinal="2">2</div>
-  <div ordinal="1">1</div>
   <div width="100">width</div>
   <div height="100">height</div>
   <div minwidth="100">minwidth</div>
   <div minheight="100">minheight</div>
   <div maxwidth="50">maxwidth</div>
   <div maxheight="15">maxheight</div>
   <div flex="100">flex</div>
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-input-horizontal-ref.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-input-horizontal-ref.xhtml
@@ -19,18 +19,16 @@ body > div {
   -moz-box-orient: horizontal;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <input type="text" value="2" />
-  <input type="text" value="1" />
   <input type="text" value="width" />
   <input type="text" value="height" />
   <input type="text" value="minwidth" />
   <input type="text" value="minheight" />
   <input type="text" value="maxwidth" />
   <input type="text" value="maxheight" />
   <input type="text" value="flex" />
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-input-horizontal.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-input-horizontal.xhtml
@@ -20,18 +20,16 @@ body > div {
   -moz-box-orient: horizontal;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <input type="text" ordinal="2" value="2" />
-  <input type="text" ordinal="1" value="1" />
   <input type="text" width="100" value="width" />
   <input type="text" height="100" value="height" />
   <input type="text" minwidth="100" value="minwidth" />
   <input type="text" minheight="100" value="minheight" />
   <input type="text" maxwidth="50" value="maxwidth" />
   <input type="text" maxheight="15" value="maxheight" />
   <input type="text" flex="100" value="flex" />
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-input-vertical-ref.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-input-vertical-ref.xhtml
@@ -18,18 +18,16 @@ body > div {
   -moz-box-orient: vertical;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <input type="text" value="2" />
-  <input type="text" value="1" />
   <input type="text" value="width" />
   <input type="text" value="height" />
   <input type="text" value="minwidth" />
   <input type="text" value="minheight" />
   <input type="text" value="maxwidth" />
   <input type="text" value="maxheight" />
   <input type="text" value="flex" />
 </div>
--- a/layout/reftests/box/flexbox-attributes-no-input-vertical.xhtml
+++ b/layout/reftests/box/flexbox-attributes-no-input-vertical.xhtml
@@ -18,18 +18,16 @@ body > div {
   -moz-box-orient: vertical;
 }
 
 ]]>
 </style>
 </head>
 <body>
 <div>
-  <input type="text" ordinal="2" value="2" />
-  <input type="text" ordinal="1" value="1" />
   <input type="text" width="100" value="width" />
   <input type="text" height="100" value="height" />
   <input type="text" minwidth="100" value="minwidth" />
   <input type="text" minheight="100" value="minheight" />
   <input type="text" maxwidth="50" value="maxwidth" />
   <input type="text" maxheight="5" value="maxheight" />
   <input type="text" flex="100" value="flex" />
 </div>
deleted file mode 100644
--- a/layout/xul/tree/crashtests/430394-1.xhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<tree id="a" style="content: 't';" rows="-2">
-  <menuitem id="b" onoverflow="event.currentTarget.parentNode.removeAttribute('style')">
-    <treechildren style="display: block;" onoverflow="event.target.parentNode.removeChild(event.target)" />
-    <treechildren style="display: block;" ordinal="0.5"/>
-  </menuitem>
-</tree>
-</window>
\ No newline at end of file
deleted file mode 100644
--- a/layout/xul/tree/crashtests/730441-1.xhtml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0"?>
-<!--
-Program received signal SIGSEGV, Segmentation fault.
-0xb6457185 in nsIContent::SetAttr (this=0x0, aNameSpaceID=0, aName=0xb0cb064c, aValue=..., aNotify=1) at ../../dist/include/nsIContent.h:285
-285	    return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify);
-(gdb) p this
-$6 = (nsIContent * const) 0x0
-(gdb) bt 3
-#0  0xb6457185 in nsIContent::SetAttr (this=0x0, aNameSpaceID=0, aName=0xb0cb064c, aValue=..., aNotify=1) at ../../dist/include/nsIContent.h:285
-#1  0xb6b72072 in nsTreeColumns::RestoreNaturalOrder (this=0xaaf83cc0) at layout/xul/base/src/tree/src/nsTreeColumns.cpp:605
-#2  0xb736c76f in NS_InvokeByIndex_P () at xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp:69
-(More stack frames follow...)
-(gdb) frame 1
-#1  0xb6b72072 in nsTreeColumns::RestoreNaturalOrder (this=0xaaf83cc0) at layout/xul/base/src/tree/src/nsTreeColumns.cpp:605
-605	    child->SetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, ordinal, PR_TRUE);
-(gdb) list
-600	  PRUint32 numChildren = colsContent->GetChildCount();
-601	  for (PRUint32 i = 0; i < numChildren; ++i) {
-602	    nsIContent *child = colsContent->GetChildAt(i);
-603	    nsAutoString ordinal;
-604	    ordinal.AppendInt(i);
-605	    child->SetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, ordinal, PR_TRUE);
-606	  }
-(gdb) p child
-$7 = (nsIContent *) 0x0
-
-First loop iteration: |child->SetAttr()| dispatches "DOMAttrModified" event.
-Event listener removes next column. Second loop iteration: |colsContent->GetChildAt(i)|
-returns null. Then we have |null->SetAttr()|.
--->
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="run();">
-<tree id="tree">
-  <treecols>
-    <treecol id="col1"/>
-    <treecol id="col2"/>
-  </treecols>
-  <treechildren/>
-</tree>
-<script type="text/javascript"><![CDATA[
-function listener() {
-  var col2 = document.getElementById("col2");
-  col2.remove();
-}
-
-function run() {
-  var col1 = document.getElementById("col1");
-  col1.addEventListener("DOMAttrModified", listener, true);
-  var tree = document.getElementById("tree");
-  tree.columns.restoreNaturalOrder();
-}
-]]></script>
-</window>
-
deleted file mode 100644
--- a/layout/xul/tree/crashtests/730441-2.xhtml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-Program received signal SIGSEGV, Segmentation fault.
-0xb6b720a6 in nsTreeColumns::RestoreNaturalOrder (this=0xa947a580) at layout/xul/base/src/tree/src/nsTreeColumns.cpp:610
-610	  mTree->Invalidate();
-(gdb) bt 3
-#0  0xb6b720a6 in nsTreeColumns::RestoreNaturalOrder (this=0xa947a580) at layout/xul/base/src/tree/src/nsTreeColumns.cpp:610
-#1  0xb736c76f in NS_InvokeByIndex_P () at xpcom/reflect/xptcall/md/unix/xptcinvoke_gcc_x86_unix.cpp:69
-#2  0xb6171901 in XPCWrappedNative::CallMethod (ccx=..., mode=XPCWrappedNative::CALL_METHOD)
-    at js/src/xpconnect/src/xpcwrappednative.cpp:2722
-(More stack frames follow...)
-(gdb) list
-605	    child->SetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, ordinal, PR_TRUE);
-606	  }
-607	
-608	  nsTreeColumns::InvalidateColumns();
-609	
-610	  mTree->Invalidate();
-611	
-612	  return NS_OK;
-613	}
-614	
-(gdb) p mTree
-$9 = (nsITreeBoxObject *) 0x0
-
-|child->SetAttr()| dispatches "DOMAttrModified" event. Event listener removes
-whole tree, |mTree| is being set to null. Then we have |null->Invalidate()|.
--->
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="run();">
-<tree id="tree">
-  <treecols>
-    <treecol id="col"/>
-  </treecols>
-  <treechildren/>
-</tree>
-<script type="text/javascript"><![CDATA[
-var tree = null;
-
-function listener() {
-  tree.remove();
-}
-
-function run() {
-  col = document.getElementById("col");
-  col.addEventListener("DOMAttrModified", listener, true);
-  tree = document.getElementById("tree");
-  tree.columns.restoreNaturalOrder();
-}
-]]></script>
-</window>
-
--- a/layout/xul/tree/crashtests/crashtests.list
+++ b/layout/xul/tree/crashtests/crashtests.list
@@ -7,15 +7,12 @@ load 382444-1.html
 load 391178-1.xhtml
 load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/391178-2.xhtml
 load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/393665-1.xhtml
 load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/399227-1.xhtml
 load 399692-1.xhtml
 load 399715-1.xhtml
 load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/409807-1.xhtml
 load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/414170-1.xhtml
-load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/430394-1.xhtml
 load 479931-1.xhtml
 load 585815.html
 load 601427.html
-load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/730441-1.xhtml
-load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/730441-2.xhtml
 load chrome://reftest/content/crashtests/layout/xul/tree/crashtests/730441-3.xhtml
--- a/toolkit/content/xul.css
+++ b/toolkit/content/xul.css
@@ -610,20 +610,9 @@ label, button, image {
   [flex="6"] { -moz-box-flex: 6; }
   [flex="7"] { -moz-box-flex: 7; }
   [flex="8"] { -moz-box-flex: 8; }
   [flex="9"] { -moz-box-flex: 9; }
   [flex="100"] { -moz-box-flex: 100; }
   [flex="400"] { -moz-box-flex: 400; }
   [flex="1000"] { -moz-box-flex: 1000; }
   [flex="10000"] { -moz-box-flex: 10000; }
-
-  [ordinal="1"] { -moz-box-ordinal-group: 1; }
-  [ordinal="2"] { -moz-box-ordinal-group: 2; }
-  [ordinal="3"] { -moz-box-ordinal-group: 3; }
-  [ordinal="4"] { -moz-box-ordinal-group: 4; }
-  [ordinal="5"] { -moz-box-ordinal-group: 5; }
-  [ordinal="6"] { -moz-box-ordinal-group: 6; }
-  [ordinal="7"] { -moz-box-ordinal-group: 7; }
-  [ordinal="8"] { -moz-box-ordinal-group: 8; }
-  [ordinal="9"] { -moz-box-ordinal-group: 9; }
-  [ordinal="1000"] { -moz-box-ordinal-group: 1000; }
 }