diff --git a/layout/xul/base/src/nsTreeRowGroupFrame.cpp b/layout/xul/base/src/nsTreeRowGroupFrame.cpp index da0d61b8810e..35622644c4f8 100644 --- a/layout/xul/base/src/nsTreeRowGroupFrame.cpp +++ b/layout/xul/base/src/nsTreeRowGroupFrame.cpp @@ -1488,6 +1488,13 @@ void nsTreeRowGroupFrame::OnContentRemoved(nsIPresContext* aPresContext, mScrollbar->GetContent(getter_AddRefs(scrollbarContent)); scrollbarContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::curpos, indexStr, /* notify */ PR_TRUE); + + // Now force the reflow to happen immediately, because we need to + // deal with cleaning out the content chain. + nsCOMPtr shell; + aPresContext->GetShell(getter_AddRefs(shell)); + shell->ProcessReflowCommands(PR_FALSE); + return; // All frames got deleted anyway by the pos change. }