diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 63aa0b61ee0..4b31d291426 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -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; } } diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 63aa0b61ee0..4b31d291426 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -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; } } diff --git a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp index ec6ccf503da..69f6730cd1e 100644 --- a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp +++ b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.cpp @@ -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) { diff --git a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.h b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.h index cedb46ad861..93488607b55 100644 --- a/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.h +++ b/mozilla/layout/xul/base/src/nsTreeRowGroupFrame.h @@ -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();