mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 21:35:39 +00:00
Clear the float cache from placeholders that are descendants of the frame we remove. b=337883 r+sr=roc
This commit is contained in:
parent
297a8f5ac0
commit
a5a64a9fb9
@ -5573,10 +5573,10 @@ nsBlockFrame::RemoveFrame(nsIAtom* aListName,
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef NOISY_REFLOW_REASON
|
||||
ListTag(stdout);
|
||||
printf(": remove ");
|
||||
nsFrame::ListTag(stdout, aOldFrame);
|
||||
printf("\n");
|
||||
ListTag(stdout);
|
||||
printf(": remove ");
|
||||
nsFrame::ListTag(stdout, aOldFrame);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
if (nsnull == aListName) {
|
||||
@ -5790,6 +5790,13 @@ found_frame:;
|
||||
nsFrame::ListTag(stdout, aDeletedFrame);
|
||||
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 {
|
||||
|
@ -501,6 +501,34 @@ 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)) {
|
||||
nsFloatCache* next = fc->Next();
|
||||
mInlineData->mFloats.Remove(fc);
|
||||
delete fc;
|
||||
MaybeFreeData();
|
||||
fc = next;
|
||||
}
|
||||
else {
|
||||
fc = fc->Next();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsLineBox::SetCombinedArea(const nsRect& aCombinedArea)
|
||||
{
|
||||
|
@ -372,6 +372,7 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user