diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 7da641d0491..ba74b709cd5 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4613,6 +4613,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext, nsTreeRowGroupFrame* treeRowGroup = (nsTreeRowGroupFrame*)parentFrame; if (treeRowGroup && treeRowGroup->IsLazy()) { treeRowGroup->OnContentRemoved(*aPresContext, childFrame); + return NS_OK; } } #endif // INCLUDE_XUL diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 7da641d0491..ba74b709cd5 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -4613,6 +4613,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIPresContext* aPresContext, nsTreeRowGroupFrame* treeRowGroup = (nsTreeRowGroupFrame*)parentFrame; if (treeRowGroup && treeRowGroup->IsLazy()) { treeRowGroup->OnContentRemoved(*aPresContext, childFrame); + return NS_OK; } } #endif // INCLUDE_XUL diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index f8a6f549dc9..fb3c469045a 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -3284,7 +3284,9 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext, */ case nsIReflowCommand::FrameRemoved : - NS_ASSERTION(nsnull!=objectFrame, "bad objectFrame"); + if (!objectFrame) + break; + NS_ASSERTION(nsnull!=childDisplay, "bad childDisplay"); if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) { diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index f8a6f549dc9..fb3c469045a 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -3284,7 +3284,9 @@ NS_METHOD nsTableFrame::IR_TargetIsMe(nsIPresContext& aPresContext, */ case nsIReflowCommand::FrameRemoved : - NS_ASSERTION(nsnull!=objectFrame, "bad objectFrame"); + if (!objectFrame) + break; + NS_ASSERTION(nsnull!=childDisplay, "bad childDisplay"); if (NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP == childDisplay->mDisplay) { diff --git a/layout/xul/base/src/nsTreeRowGroupFrame.cpp b/layout/xul/base/src/nsTreeRowGroupFrame.cpp index 00f2dc6b39b..32b3a50bd86 100644 --- a/layout/xul/base/src/nsTreeRowGroupFrame.cpp +++ b/layout/xul/base/src/nsTreeRowGroupFrame.cpp @@ -978,6 +978,32 @@ void nsTreeRowGroupFrame::OnContentRemoved(nsIPresContext& aPresContext, // We need to make sure we update things when content gets removed. // Clear out our top and bottom frames. mTopFrame = mBottomFrame = nsnull; + + nsTableFrame* tableFrame; + nsTableFrame::GetTableFrame(this, tableFrame); + + nsTreeFrame* treeFrame = (nsTreeFrame*)tableFrame; + + // Go ahead and delete the frame. + mFrameConstructor->RemoveMappingsForFrameSubtree(&aPresContext, aChildFrame); + mFrames.DeleteFrame(aPresContext, aChildFrame); + treeFrame->InvalidateCellMap(); + treeFrame->InvalidateColumnCache(); + + if (IsLazy() && !treeFrame->IsSlatedForReflow()) { + treeFrame->SlateForReflow(); + + // Schedule a reflow for us. + nsCOMPtr reflowCmd; + + nsresult rv = NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), treeFrame, + nsIReflowCommand::FrameRemoved, nsnull); + if (NS_SUCCEEDED(rv)) { + nsCOMPtr presShell; + aPresContext.GetShell(getter_AddRefs(presShell)); + presShell->AppendReflowCommand(reflowCmd); + } + } } void nsTreeRowGroupFrame::SetContentChain(nsISupportsArray* aContentChain)