Bug 468491. When removing the continuations of a text frame, remove them starting at the end to avoid disrupting frame invariants by removing frames from the middle of the flow. r=dbaron

This commit is contained in:
Robert O'Callahan
2009-04-10 13:19:06 +12:00
parent ad7be4fe95
commit 6246193e2c
5 changed files with 26 additions and 35 deletions

View File

@@ -10169,15 +10169,15 @@ nsCSSFrameConstructor::RemoveFloatingFirstLetterFrames(
// Destroy the old text frame's continuations (the old text frame
// will be destroyed when its letter frame is destroyed).
nsIFrame* nextTextFrame = textFrame->GetNextContinuation();
while (nextTextFrame) {
nsIFrame* nextTextParent = nextTextFrame->GetParent();
if (nextTextParent) {
nsSplittableFrame::RemoveFromFlow(nextTextFrame);
::DeletingFrameSubtree(aFrameManager, nextTextFrame);
aFrameManager->RemoveFrame(nextTextParent, nsnull, nextTextFrame);
nsIFrame* frameToDelete = textFrame->GetLastContinuation();
while (frameToDelete != textFrame) {
nsIFrame* frameToDeleteParent = frameToDelete->GetParent();
nsIFrame* nextFrameToDelete = frameToDelete->GetPrevContinuation();
if (frameToDeleteParent) {
::DeletingFrameSubtree(aFrameManager, frameToDelete);
aFrameManager->RemoveFrame(frameToDeleteParent, nsnull, frameToDelete);
}
nextTextFrame = textFrame->GetNextContinuation();
frameToDelete = nextFrameToDelete;
}
// First find out where (in the content) the placeholder frames