diff --git a/mozilla/layout/base/src/nsFrameList.cpp b/mozilla/layout/base/src/nsFrameList.cpp index 3d223eb092f..7f02b207e7b 100644 --- a/mozilla/layout/base/src/nsFrameList.cpp +++ b/mozilla/layout/base/src/nsFrameList.cpp @@ -186,6 +186,7 @@ nsFrameList::RemoveFrame(nsIFrame* aFrame) } else { nsIFrame* prevSibling = GetPrevSiblingFor(aFrame); + NS_ASSERTION(prevSibling, "removing frame not in list"); if (nsnull != prevSibling) { prevSibling->SetNextSibling(nextFrame); return PR_TRUE; diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index b7a43813a58..df8adf99b92 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -4841,8 +4841,12 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext, printf("\n"); #endif - if (nsLayoutAtoms::absoluteList == aListName) { - return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, aListName, aOldFrame); + if (nsnull == aListName) { + rv = DoRemoveFrame(aPresContext, aOldFrame); + } + else if (nsLayoutAtoms::absoluteList == aListName) { + return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, + aListName, aOldFrame); } else if (nsLayoutAtoms::floaterList == aListName) { // Find which line contains the floater @@ -4863,19 +4867,14 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext, } #ifdef IBMBIDI else if (nsLayoutAtoms::nextBidi == aListName) { - rv = DoRemoveFrame(aPresContext, aOldFrame); + // Skip the call to |ReflowDirtyChild| below by returning now. + return DoRemoveFrame(aPresContext, aOldFrame); } #endif // IBMBIDI - else if (nsnull != aListName) { + else { rv = NS_ERROR_INVALID_ARG; } - else { - rv = DoRemoveFrame(aPresContext, aOldFrame); - } -#ifdef IBMBIDI - if (nsLayoutAtoms::nextBidi != aListName) -#endif // IBMBIDI if (NS_SUCCEEDED(rv)) { // Ask the parent frame to reflow me. ReflowDirtyChild(&aPresShell, nsnull); diff --git a/mozilla/layout/generic/nsFrameList.cpp b/mozilla/layout/generic/nsFrameList.cpp index 3d223eb092f..7f02b207e7b 100644 --- a/mozilla/layout/generic/nsFrameList.cpp +++ b/mozilla/layout/generic/nsFrameList.cpp @@ -186,6 +186,7 @@ nsFrameList::RemoveFrame(nsIFrame* aFrame) } else { nsIFrame* prevSibling = GetPrevSiblingFor(aFrame); + NS_ASSERTION(prevSibling, "removing frame not in list"); if (nsnull != prevSibling) { prevSibling->SetNextSibling(nextFrame); return PR_TRUE; diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index b7a43813a58..df8adf99b92 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -4841,8 +4841,12 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext, printf("\n"); #endif - if (nsLayoutAtoms::absoluteList == aListName) { - return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, aListName, aOldFrame); + if (nsnull == aListName) { + rv = DoRemoveFrame(aPresContext, aOldFrame); + } + else if (nsLayoutAtoms::absoluteList == aListName) { + return mAbsoluteContainer.RemoveFrame(this, aPresContext, aPresShell, + aListName, aOldFrame); } else if (nsLayoutAtoms::floaterList == aListName) { // Find which line contains the floater @@ -4863,19 +4867,14 @@ nsBlockFrame::RemoveFrame(nsIPresContext* aPresContext, } #ifdef IBMBIDI else if (nsLayoutAtoms::nextBidi == aListName) { - rv = DoRemoveFrame(aPresContext, aOldFrame); + // Skip the call to |ReflowDirtyChild| below by returning now. + return DoRemoveFrame(aPresContext, aOldFrame); } #endif // IBMBIDI - else if (nsnull != aListName) { + else { rv = NS_ERROR_INVALID_ARG; } - else { - rv = DoRemoveFrame(aPresContext, aOldFrame); - } -#ifdef IBMBIDI - if (nsLayoutAtoms::nextBidi != aListName) -#endif // IBMBIDI if (NS_SUCCEEDED(rv)) { // Ask the parent frame to reflow me. ReflowDirtyChild(&aPresShell, nsnull);