diff --git a/mozilla/layout/generic/crashtests/472950-1.html b/mozilla/layout/generic/crashtests/472950-1.html new file mode 100644 index 00000000000..cd2a49aa3df --- /dev/null +++ b/mozilla/layout/generic/crashtests/472950-1.html @@ -0,0 +1,21 @@ + + + + + + + +
+ + A B
+ + diff --git a/mozilla/layout/generic/crashtests/crashtests.list b/mozilla/layout/generic/crashtests/crashtests.list index c2f453820a5..0f1fdba15f6 100644 --- a/mozilla/layout/generic/crashtests/crashtests.list +++ b/mozilla/layout/generic/crashtests/crashtests.list @@ -145,4 +145,5 @@ load 431260-1.html load 431260-2.html load 445288.html load 472776-1.html +load 472950-1.html load 477928.html diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index 9bf743720eb..7b32a108355 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -316,14 +316,19 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext, nsHTMLContainerFrame::ReparentFrameViewList(aPresContext, prevOverflowFrames, prevInFlow, this); - if (GetStateBits() & NS_FRAME_FIRST_REFLOW) { - // If it's the initial reflow, then our child list must be empty, so - // just set the child list rather than calling InsertFrame(). This avoids - // having to get the last child frame in the list. + // Check if we should do the lazilySetParentPointer optimization. + // Only do it in simple cases where we're being reflowed for the + // first time, nothing (e.g. bidi resolution) has already given + // us children, and there's no next-in-flow, so all our frames + // will be taken from prevOverflowFrames. + if ((GetStateBits() & NS_FRAME_FIRST_REFLOW) && mFrames.IsEmpty() && + !GetNextInFlow()) { + // If our child list is empty, just set the child list rather than + // calling InsertFrame(). This avoids having to get the last child + // frame in the list. // Note that we don't set the parent pointer for the new frames. Instead wait // to do this until we actually reflow the frame. If the overflow list contains // thousands of frames this is a big performance issue (see bug #5588) - NS_ASSERTION(mFrames.IsEmpty(), "child list is not empty for initial reflow"); mFrames.SetFrames(prevOverflowFrames); lazilySetParentPointer = PR_TRUE; } else {