From da4a20a23d045e5a5276481566011a277618c977 Mon Sep 17 00:00:00 2001 From: "mats.palmgren%bredband.net" Date: Thu, 17 Aug 2006 13:15:26 +0000 Subject: [PATCH] Leave the placeholder's pointer to the out-of-flow intact because the float cache depends on it later on. b=348688 r=bzbarsky sr=roc --- layout/base/nsCSSFrameConstructor.cpp | 3 ++- layout/generic/nsBlockFrame.cpp | 6 ------ layout/generic/nsLineBox.cpp | 28 --------------------------- layout/generic/nsLineBox.h | 1 - 4 files changed, 2 insertions(+), 36 deletions(-) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index f206e09c214..795dfe24fd7 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -9772,7 +9772,8 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager, // Remove the mapping from the out-of-flow frame to its placeholder. aFrameManager->UnregisterPlaceholderFrame((nsPlaceholderFrame*)childFrame); - ((nsPlaceholderFrame*)childFrame)->SetOutOfFlowFrame(nsnull); + // Don't SetOutOfFlowFrame(nsnull) here because the float cache depends + // on it when the float is removed later on, see bug 348688 comment 6. // Queue the out-of-flow frame to be destroyed only if aRemovedFrame is _not_ // one of its ancestor frames or if it is a popup frame. diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 06855fbd8bf..7263fdae249 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -5879,12 +5879,6 @@ found_frame:; printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation); #endif - if (!aDeletedFrame->IsFloatContainingBlock()) { - // Clear the float cache from placeholders that are descendants - // of aDeletedFrame (bug 337883). - line->RemovePlaceholderDescendantsOf(aDeletedFrame); - } - if (aDestroyFrames) { aDeletedFrame->Destroy(); } else { diff --git a/layout/generic/nsLineBox.cpp b/layout/generic/nsLineBox.cpp index 731dacd3498..3e075b72ca9 100644 --- a/layout/generic/nsLineBox.cpp +++ b/layout/generic/nsLineBox.cpp @@ -523,34 +523,6 @@ nsLineBox::RemoveFloat(nsIFrame* aFrame) return PR_FALSE; } -void -nsLineBox::RemovePlaceholderDescendantsOf(nsIFrame* aFrame) -{ - if (IsInline() && mInlineData) { - nsFloatCache* fc = mInlineData->mFloats.Head(); - while (fc) { - nsIFrame* frame = fc->mPlaceholder; - while (frame && frame != aFrame) { - if (frame->IsFloatContainingBlock()) { - frame = nsnull; - break; - } - frame = frame->GetParent(); - } - if (NS_UNLIKELY(frame != nsnull)) { - nsFloatCache* next = fc->Next(); - mInlineData->mFloats.Remove(fc); - delete fc; - MaybeFreeData(); - fc = next; - } - else { - fc = fc->Next(); - } - } - } -} - void nsLineBox::SetCombinedArea(const nsRect& aCombinedArea) { diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index f495736b222..5ab6474b2c9 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -402,7 +402,6 @@ public: void FreeFloats(nsFloatCacheFreeList& aFreeList); void AppendFloats(nsFloatCacheFreeList& aFreeList); PRBool RemoveFloat(nsIFrame* aFrame); - void RemovePlaceholderDescendantsOf(nsIFrame* aFrame); // Combined area is the area of the line that should influence the // overflow area of its parent block. The combined area should be