зеркало из https://github.com/mozilla/pjs.git
Batching removal and making sure I get notified (in an attempt to fix some
of the out of sync problems the tree widget is having).
This commit is contained in:
Родитель
30f8e4f243
Коммит
7e86878e70
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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<nsIReflowCommand> reflowCmd;
|
||||
|
||||
nsresult rv = NS_NewHTMLReflowCommand(getter_AddRefs(reflowCmd), treeFrame,
|
||||
nsIReflowCommand::FrameRemoved, nsnull);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsCOMPtr<nsIPresShell> presShell;
|
||||
aPresContext.GetShell(getter_AddRefs(presShell));
|
||||
presShell->AppendReflowCommand(reflowCmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void nsTreeRowGroupFrame::SetContentChain(nsISupportsArray* aContentChain)
|
||||
|
|
Загрузка…
Ссылка в новой задаче