Make the simple cases of dynamic changes of -moz-box-ordinal-group work correctly. (Bug 555987) r=dbaron
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 28 Jun 2010 13:47:58 -0700
changeset 46371 ce2f6b5e05254982a67feda05731b6c67a352ad5
parent 46370 c51bb774fb71a1cf2d33713fbfcd257bd7196b92
child 46372 00bf38db60e2ad16769ead966d6501bf2089c12b
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs555987
milestone1.9.3a6pre
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
Make the simple cases of dynamic changes of -moz-box-ordinal-group work correctly. (Bug 555987) r=dbaron
layout/reftests/box-ordinal/reftest.list
layout/xul/base/src/nsBoxFrame.cpp
--- a/layout/reftests/box-ordinal/reftest.list
+++ b/layout/reftests/box-ordinal/reftest.list
@@ -1,6 +1,6 @@
 == dynamic-1-remove-to-none-grouped.xul dynamic-1-ref.xul
-fails == dynamic-1-add-to-one-grouped.xul dynamic-1-ref.xul
+== dynamic-1-add-to-one-grouped.xul dynamic-1-ref.xul
 == dynamic-1-remove-to-one-grouped-1.xul dynamic-1-ref.xul
 fails == dynamic-1-remove-to-one-grouped-2.xul dynamic-1-ref.xul
 == dynamic-1-add-to-two-grouped-1.xul dynamic-1-ref.xul
-fails == dynamic-1-add-to-two-grouped-2.xul dynamic-1-ref.xul
+== dynamic-1-add-to-two-grouped-2.xul dynamic-1-ref.xul
--- a/layout/xul/base/src/nsBoxFrame.cpp
+++ b/layout/xul/base/src/nsBoxFrame.cpp
@@ -1049,16 +1049,22 @@ nsBoxFrame::InsertFrames(nsIAtom*       
    // insert the child frames
    const nsFrameList::Slice& newFrames =
      mFrames.InsertFrames(this, aPrevFrame, aFrameList);
 
    // notify the layout manager
    if (mLayoutManager)
      mLayoutManager->ChildrenInserted(this, state, aPrevFrame, newFrames);
 
+   // Make sure to check box order _after_ notifying the layout
+   // manager; otherwise the slice we give the layout manager will
+   // just be bogus.  If the layout manager cares about the order, we
+   // just lose.
+   CheckBoxOrder(state);
+
 #ifdef DEBUG_LAYOUT
    // if we are in debug make sure our children are in debug as well.
    if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
        SetDebugOnChildList(state, mFrames.FirstChild(), PR_TRUE);
 #endif
 
    PresContext()->PresShell()->
      FrameNeedsReflow(this, nsIPresShell::eTreeChange,
@@ -1076,16 +1082,22 @@ nsBoxFrame::AppendFrames(nsIAtom*       
 
    // append the new frames
    const nsFrameList::Slice& newFrames = mFrames.AppendFrames(this, aFrameList);
 
    // notify the layout manager
    if (mLayoutManager)
      mLayoutManager->ChildrenAppended(this, state, newFrames);
 
+   // Make sure to check box order _after_ notifying the layout
+   // manager; otherwise the slice we give the layout manager will
+   // just be bogus.  If the layout manager cares about the order, we
+   // just lose.
+   CheckBoxOrder(state);
+
 #ifdef DEBUG_LAYOUT
    // if we are in debug make sure our children are in debug as well.
    if (mState & NS_STATE_CURRENTLY_IN_DEBUG)
        SetDebugOnChildList(state, mFrames.FirstChild(), PR_TRUE);
 #endif
 
    // XXXbz why is this NS_FRAME_FIRST_REFLOW check here?
    if (!(GetStateBits() & NS_FRAME_FIRST_REFLOW)) {