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

This commit is contained in:
mats.palmgren%bredband.net 2006-08-17 13:15:26 +00:00
Родитель 81f9cc6766
Коммит da4a20a23d
4 изменённых файлов: 2 добавлений и 36 удалений

Просмотреть файл

@ -9772,7 +9772,8 @@ DoDeletingFrameSubtree(nsFrameManager* aFrameManager,
// Remove the mapping from the out-of-flow frame to its placeholder. // Remove the mapping from the out-of-flow frame to its placeholder.
aFrameManager->UnregisterPlaceholderFrame((nsPlaceholderFrame*)childFrame); 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_ // 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. // one of its ancestor frames or if it is a popup frame.

Просмотреть файл

@ -5879,12 +5879,6 @@ found_frame:;
printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation); printf(" prevSibling=%p deletedNextContinuation=%p\n", prevSibling, deletedNextContinuation);
#endif #endif
if (!aDeletedFrame->IsFloatContainingBlock()) {
// Clear the float cache from placeholders that are descendants
// of aDeletedFrame (bug 337883).
line->RemovePlaceholderDescendantsOf(aDeletedFrame);
}
if (aDestroyFrames) { if (aDestroyFrames) {
aDeletedFrame->Destroy(); aDeletedFrame->Destroy();
} else { } else {

Просмотреть файл

@ -523,34 +523,6 @@ nsLineBox::RemoveFloat(nsIFrame* aFrame)
return PR_FALSE; 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 void
nsLineBox::SetCombinedArea(const nsRect& aCombinedArea) nsLineBox::SetCombinedArea(const nsRect& aCombinedArea)
{ {

Просмотреть файл

@ -402,7 +402,6 @@ public:
void FreeFloats(nsFloatCacheFreeList& aFreeList); void FreeFloats(nsFloatCacheFreeList& aFreeList);
void AppendFloats(nsFloatCacheFreeList& aFreeList); void AppendFloats(nsFloatCacheFreeList& aFreeList);
PRBool RemoveFloat(nsIFrame* aFrame); PRBool RemoveFloat(nsIFrame* aFrame);
void RemovePlaceholderDescendantsOf(nsIFrame* aFrame);
// Combined area is the area of the line that should influence the // Combined area is the area of the line that should influence the
// overflow area of its parent block. The combined area should be // overflow area of its parent block. The combined area should be