diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 2a768d4b760d..68c8694ff3ba 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -621,7 +621,8 @@ nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) return nsIFrame::kPopupList; #endif // MOZ_XUL } else { - NS_ASSERTION(aChildFrame->IsFloating(), "not a floated frame"); + NS_ASSERTION(aChildFrame->IsFloating(), + "not a floated frame"); id = nsIFrame::kFloatList; } @@ -659,10 +660,6 @@ nsLayoutUtils::GetChildListNameFor(nsIFrame* aChildFrame) else if (aChildFrame->IsFloating()) { found = parent->GetChildList(nsIFrame::kOverflowOutOfFlowList) .ContainsFrame(aChildFrame); - if (!found) { - found = parent->GetChildList(nsIFrame::kPushedFloatsList) - .ContainsFrame(aChildFrame); - } } // else it's positioned and should have been on the 'id' child list. NS_POSTCONDITION(found, "not in child list"); diff --git a/layout/generic/crashtests/847208.html b/layout/generic/crashtests/847208.html deleted file mode 100644 index 2128dbbb8e96..000000000000 --- a/layout/generic/crashtests/847208.html +++ /dev/null @@ -1,16 +0,0 @@ - - -
- - - -text
- - diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 3020554907ca..da3d4a3cdba7 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -448,4 +448,3 @@ test-pref(layout.css.flexbox.enabled,true) load 827168-1.html load 842132-1.html test-pref(layout.css.flexbox.enabled,true) load 844529-1.html load 847130.xhtml -load 847208.html diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index d18b92768aed..c9e1727f1a57 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -4954,8 +4954,16 @@ nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling) } void -nsBlockFrame::RemoveFloatFromFloatCache(nsIFrame* aFloat) +nsBlockFrame::RemoveFloat(nsIFrame* aFloat) { +#ifdef DEBUG + if (!mFloats.ContainsFrame(aFloat)) { + MOZ_ASSERT(GetOverflowOutOfFlows() && + GetOverflowOutOfFlows()->ContainsFrame(aFloat), + "aFloat is not our child or on an unexpected frame list"); + } +#endif + // Find which line contains the float, so we can update // the float cache. line_iterator line = begin_lines(), line_end = end_lines(); @@ -4964,45 +4972,19 @@ nsBlockFrame::RemoveFloatFromFloatCache(nsIFrame* aFloat) break; } } -} - -void -nsBlockFrame::RemoveFloat(nsIFrame* aFloat) -{ -#ifdef DEBUG - // Floats live in mFloats, or in the PushedFloat or OverflowOutOfFlows - // frame list properties. - if (!mFloats.ContainsFrame(aFloat)) { - MOZ_ASSERT((GetOverflowOutOfFlows() && - GetOverflowOutOfFlows()->ContainsFrame(aFloat)) || - (GetPushedFloats() && - GetPushedFloats()->ContainsFrame(aFloat)), - "aFloat is not our child or on an unexpected frame list"); - } -#endif if (mFloats.StartRemoveFrame(aFloat)) { return; } - nsFrameList* list = GetPushedFloats(); - if (list && list->ContinueRemoveFrame(aFloat)) { -#if 0 - // XXXmats not yet - need to investigate nsBlockReflowState::mPushedFloats - // first so we don't leave it pointing to a deleted list. - if (list->IsEmpty()) { - delete RemovePushedFloats(); - } -#endif - return; - } - { nsAutoOOFFrameList oofs(this); if (oofs.mList.ContinueRemoveFrame(aFloat)) { return; } } + + MOZ_ASSERT(false, "float child frame not found"); } static void MarkSameFloatManagerLinesDirty(nsBlockFrame* aBlock) @@ -5121,7 +5103,6 @@ nsBlockFrame::DoRemoveOutOfFlowFrame(nsIFrame* aFrame) ->DeleteNextInFlowChild(aFrame->PresContext(), nif, false); } // Now remove aFrame from its child list and Destroy it. - block->RemoveFloatFromFloatCache(aFrame); block->RemoveFloat(aFrame); aFrame->Destroy(); } diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 749481aaa207..82ec0f9fbd0c 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -518,13 +518,10 @@ protected: uint8_t FindTrailingClear(); /** - * Remove a float from our float list. - */ + * Remove a float from our float list and also the float cache + * for the line its placeholder is on. + */ void RemoveFloat(nsIFrame* aFloat); - /** - * Remove a float from the float cache for the line its placeholder is on. - */ - void RemoveFloatFromFloatCache(nsIFrame* aFloat); void CollectFloats(nsIFrame* aFrame, nsFrameList& aList, bool aCollectFromSiblings) {