Fix for 13815. Implement OnContentInserted. Approved by chofmann and reviewed by hyatt.

git-svn-id: svn://10.0.0.236/trunk@48921 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
putterman%netscape.com
1999-09-23 21:11:02 +00:00
parent 15b6d9b0f8
commit bc9bc357be
4 changed files with 38 additions and 2 deletions

View File

@@ -5713,7 +5713,15 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
// Convert to a tree row group frame.
nsTreeRowGroupFrame* treeRowGroup = (nsTreeRowGroupFrame*)parentFrame;
if (treeRowGroup && treeRowGroup->IsLazy()) {
treeRowGroup->OnContentAdded(*aPresContext);
nsIFrame* nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer);
if(!nextSibling)
treeRowGroup->OnContentAdded(*aPresContext);
else {
nsIFrame* frame = GetFrameFor(shell, aPresContext, aContainer);
nsTreeRowGroupFrame* frameTreeRowGroup = (nsTreeRowGroupFrame*)frame;
if(frameTreeRowGroup)
frameTreeRowGroup->OnContentInserted(*aPresContext, nextSibling);
}
return NS_OK;
}
}

View File

@@ -5713,7 +5713,15 @@ nsCSSFrameConstructor::ContentInserted(nsIPresContext* aPresContext,
// Convert to a tree row group frame.
nsTreeRowGroupFrame* treeRowGroup = (nsTreeRowGroupFrame*)parentFrame;
if (treeRowGroup && treeRowGroup->IsLazy()) {
treeRowGroup->OnContentAdded(*aPresContext);
nsIFrame* nextSibling = FindNextSibling(shell, aContainer, aIndexInContainer);
if(!nextSibling)
treeRowGroup->OnContentAdded(*aPresContext);
else {
nsIFrame* frame = GetFrameFor(shell, aPresContext, aContainer);
nsTreeRowGroupFrame* frameTreeRowGroup = (nsTreeRowGroupFrame*)frame;
if(frameTreeRowGroup)
frameTreeRowGroup->OnContentInserted(*aPresContext, nextSibling);
}
return NS_OK;
}
}

View File

@@ -1129,6 +1129,25 @@ void nsTreeRowGroupFrame::OnContentAdded(nsIPresContext& aPresContext)
}
}
void nsTreeRowGroupFrame::OnContentInserted(nsIPresContext& aPresContext, nsIFrame* aNextSibling)
{
nsIFrame* currFrame = aNextSibling;
if(aNextSibling == mTopFrame)
mTopFrame = nsnull;
while (currFrame) {
nsIFrame* nextFrame;
currFrame->GetNextSibling(&nextFrame);
mFrameConstructor->RemoveMappingsForFrameSubtree(&aPresContext, currFrame);
mFrames.DestroyFrame(aPresContext, currFrame);
currFrame = nextFrame;
//printf("Nuked one off the end.\n");
}
OnContentAdded(aPresContext);
}
void nsTreeRowGroupFrame::OnContentRemoved(nsIPresContext& aPresContext,
nsIFrame* aChildFrame)
{

View File

@@ -62,6 +62,7 @@ public:
// Responses to changes
void OnContentAdded(nsIPresContext& aPresContext);
void OnContentInserted(nsIPresContext& aPresContext, nsIFrame* aNextSibling);
void OnContentRemoved(nsIPresContext& aPresContext, nsIFrame* aChildFrame);
virtual nsIFrame* GetFirstFrame();