diff --git a/mozilla/layout/base/src/nsContainerFrame.h b/mozilla/layout/base/src/nsContainerFrame.h index 4611eac39a8..c70fa2acbe0 100644 --- a/mozilla/layout/base/src/nsContainerFrame.h +++ b/mozilla/layout/base/src/nsContainerFrame.h @@ -290,18 +290,6 @@ protected: // Returns true if aChild is being used as a pseudo frame PRBool ChildIsPseudoFrame(const nsIFrame* aChild) const; - /** - * Sets the first content offset based on the first child frame. - */ - void SetFirstContentOffset(const nsIFrame* aFirstChild); - - /** - * Sets the last content offset based on the last child frame. If the last - * child is a pseudo frame then it sets mLastContentIsComplete to be the same - * as the last child's mLastContentIsComplete - */ - void SetLastContentOffset(const nsIFrame* aLastChild); - virtual void WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow); #ifdef NS_DEBUG @@ -359,6 +347,20 @@ protected: nsIFrame* mOverflowList; private: + /** + * Sets the first content offset based on the first child frame. + * @deprecated + */ + void SetFirstContentOffset(const nsIFrame* aFirstChild); + + /** + * Sets the last content offset based on the last child frame. If the last + * child is a pseudo frame then it sets mLastContentIsComplete to be the same + * as the last child's mLastContentIsComplete + * @deprecated + */ + void SetLastContentOffset(const nsIFrame* aLastChild); + #ifdef NS_DEBUG /** * Helper function to verify that the first/last content offsets diff --git a/mozilla/layout/css/layout/src/nsCSSInlineFrame.cpp b/mozilla/layout/css/layout/src/nsCSSInlineFrame.cpp index 59f2f92d45a..7ecdfeab316 100644 --- a/mozilla/layout/css/layout/src/nsCSSInlineFrame.cpp +++ b/mozilla/layout/css/layout/src/nsCSSInlineFrame.cpp @@ -879,7 +879,9 @@ nsCSSInlineFrame::PullOneChild(nsCSSInlineFrame* aNextInFlow, kidFrame->GetNextSibling(aNextInFlow->mFirstChild); aNextInFlow->mChildCount--; if (nsnull != aNextInFlow->mFirstChild) { - aNextInFlow->SetFirstContentOffset(aNextInFlow->mFirstChild); + PRInt32 contentIndex; + aNextInFlow->mFirstChild->GetContentIndex(contentIndex); + aNextInFlow->SetFirstContentOffset(contentIndex); } } @@ -894,7 +896,9 @@ nsCSSInlineFrame::PullOneChild(nsCSSInlineFrame* aNextInFlow, // Add the frame on our list if (nsnull == aLastChild) { mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + PRInt32 contentIndex; + kidFrame->GetContentIndex(contentIndex); + SetFirstContentOffset(contentIndex); } else { NS_ASSERTION(IsLastChild(aLastChild), "bad last child"); aLastChild->SetNextSibling(kidFrame); diff --git a/mozilla/layout/html/forms/src/nsInputFile.cpp b/mozilla/layout/html/forms/src/nsInputFile.cpp index 9504fecadbd..a240a082933 100644 --- a/mozilla/layout/html/forms/src/nsInputFile.cpp +++ b/mozilla/layout/html/forms/src/nsInputFile.cpp @@ -171,11 +171,17 @@ NS_IMETHODIMP nsInputFileFrame::Reflow(nsIPresContext* aCX, childContent->CreateFrame(aCX, this, mStyleContext, childFrame); if (0 == i) { mFirstChild = childFrame; - SetFirstContentOffset(mFirstChild); + PRInt32 contentIndex; + mFirstChild->GetContentIndex(contentIndex); + SetFirstContentOffset(contentIndex); } else { mFirstChild->SetNextSibling(childFrame); - SetLastContentOffset(childFrame); + // XXX We shouldn't be setting this inside of a loop. Plus using + // GetContentIndex() is very slow... + PRInt32 contentIndex; + childFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } NS_RELEASE(childContent); mChildCount++; diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index a66a2fcbe6c..3e3c60a90cd 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -161,7 +161,7 @@ void nsTableCellFrame::CreatePsuedoFrame(nsIPresContext* aPresContext) { // Do we have a prev-in-flow? if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame + // No, create a body pseudo frame nsBodyFrame::NewFrame(&mFirstChild, mContent, this); mChildCount = 1; @@ -306,8 +306,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, this, kidSize.width, kidSize.height); } - SetFirstContentOffset(mFirstChild); - SetLastContentOffset(mFirstChild); + // Set our last content offset based on the pseudo-frame + nsBodyFrame* bodyPseudoFrame = (nsBodyFrame*)mFirstChild; + mLastContentOffset = bodyPseudoFrame->GetLastContentOffset(); // Place the child mFirstChild->SetRect(nsRect(leftInset, topInset, diff --git a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp index 13b2dfa02f6..ba9bd033e8b 100644 --- a/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableColGroupFrame.cpp @@ -104,7 +104,7 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext, prevKidFrame->SetNextSibling(kidFrame); } else { mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); } prevKidFrame = kidFrame; mChildCount++; diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 36b556f9c02..c983dd63f94 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -1328,7 +1328,7 @@ nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, } else { // Our first child mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); if (gsDebug) printf("INNER: set first content offset to %d\n", GetFirstContentOffset()); //@@@ } mChildCount++; @@ -1689,7 +1689,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, // give it our original mLastContentIsComplete too (in case we // are pushing into an empty next-in-flow) PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); result = PR_FALSE; break; @@ -1756,7 +1758,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, kidFrame->GetNextSibling(nextSibling); if (nsnull != nextSibling) { PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } result = PR_FALSE; break; @@ -1934,7 +1938,9 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, nextInFlow->mChildCount--; // Update the next-in-flows first content offset if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); + PRInt32 contentIndex; + nextInFlow->mFirstChild->GetContentIndex(contentIndex); + nextInFlow->SetFirstContentOffset(contentIndex); } // Link the frame into our list of children @@ -1947,7 +1953,9 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + PRInt32 contentIndex; + kidFrame->GetContentIndex(contentIndex); + SetFirstContentOffset(contentIndex); } else { prevKidFrame->SetNextSibling(kidFrame); } @@ -2003,7 +2011,9 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, // Update our last content offset if (nsnull != prevKidFrame) { NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } // We need to make sure the first content offset is correct for any empty @@ -2113,7 +2123,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, prevKidFrame->SetNextSibling(kidFrame); } else { mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); } mChildCount++; @@ -2169,7 +2179,9 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Update the content mapping NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); #ifdef NS_DEBUG PRInt32 len = LengthOf(mFirstChild); NS_ASSERTION(len == mChildCount, "bad child count"); diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 0515fcd3bb0..15408d8a8b9 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -761,7 +761,9 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild) if (parent->mFirstChild == nextInFlow) { nextInFlow->GetNextSibling(parent->mFirstChild); if (nsnull != parent->mFirstChild) { - parent->SetFirstContentOffset(parent->mFirstChild); + PRInt32 contentIndex; + parent->mFirstChild->GetContentIndex(contentIndex); + parent->SetFirstContentOffset(contentIndex); if (parent->IsPseudoFrame()) { // Tell the parent's parent to update its content offsets nsContainerFrame* pp = (nsContainerFrame*) parent->mGeometricParent; diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 349465431aa..8c977341c19 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -323,7 +323,9 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon // give it our original mLastContentIsComplete, too (in case we // are pushing into an empty next-in-flow) PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); // Our mLastContentIsComplete was already set by the last kid we // reflowed reflow's status @@ -391,7 +393,9 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon kidFrame->GetNextSibling(nextSibling); if (nsnull != nextSibling) { PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } result = PR_FALSE; break; @@ -563,7 +567,9 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, nextInFlow->mChildCount--; // Update the next-in-flows first content offset if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); + PRInt32 contentIndex; + nextInFlow->mFirstChild->GetContentIndex(contentIndex); + nextInFlow->SetFirstContentOffset(contentIndex); } // Link the frame into our list of children @@ -576,7 +582,9 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + PRInt32 contentIndex; + kidFrame->GetContentIndex(contentIndex); + SetFirstContentOffset(contentIndex); } else { prevKidFrame->SetNextSibling(kidFrame); } @@ -632,7 +640,9 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, // Update our last content offset if (nsnull != prevKidFrame) { NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } // We need to make sure the first content offset is correct for any empty @@ -769,7 +779,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, prevKidFrame->SetNextSibling(kidFrame); } else { mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); } mChildCount++; @@ -816,7 +826,9 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Update the content mapping NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); #ifdef NS_DEBUG PRInt32 len = LengthOf(mFirstChild); NS_ASSERTION(len == mChildCount, "bad child count"); diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index a66a2fcbe6c..3e3c60a90cd 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -161,7 +161,7 @@ void nsTableCellFrame::CreatePsuedoFrame(nsIPresContext* aPresContext) { // Do we have a prev-in-flow? if (nsnull == mPrevInFlow) { - // No, create a column pseudo frame + // No, create a body pseudo frame nsBodyFrame::NewFrame(&mFirstChild, mContent, this); mChildCount = 1; @@ -306,8 +306,9 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext, this, kidSize.width, kidSize.height); } - SetFirstContentOffset(mFirstChild); - SetLastContentOffset(mFirstChild); + // Set our last content offset based on the pseudo-frame + nsBodyFrame* bodyPseudoFrame = (nsBodyFrame*)mFirstChild; + mLastContentOffset = bodyPseudoFrame->GetLastContentOffset(); // Place the child mFirstChild->SetRect(nsRect(leftInset, topInset, diff --git a/mozilla/layout/tables/nsTableColGroupFrame.cpp b/mozilla/layout/tables/nsTableColGroupFrame.cpp index 13b2dfa02f6..ba9bd033e8b 100644 --- a/mozilla/layout/tables/nsTableColGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableColGroupFrame.cpp @@ -104,7 +104,7 @@ NS_METHOD nsTableColGroupFrame::Reflow(nsIPresContext* aPresContext, prevKidFrame->SetNextSibling(kidFrame); } else { mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); } prevKidFrame = kidFrame; mChildCount++; diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 36b556f9c02..c983dd63f94 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -1328,7 +1328,7 @@ nsReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresContext, } else { // Our first child mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); if (gsDebug) printf("INNER: set first content offset to %d\n", GetFirstContentOffset()); //@@@ } mChildCount++; @@ -1689,7 +1689,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, // give it our original mLastContentIsComplete too (in case we // are pushing into an empty next-in-flow) PushChildren(kidFrame, prevKidFrame, originalLastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); result = PR_FALSE; break; @@ -1756,7 +1758,9 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext, kidFrame->GetNextSibling(nextSibling); if (nsnull != nextSibling) { PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } result = PR_FALSE; break; @@ -1934,7 +1938,9 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, nextInFlow->mChildCount--; // Update the next-in-flows first content offset if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); + PRInt32 contentIndex; + nextInFlow->mFirstChild->GetContentIndex(contentIndex); + nextInFlow->SetFirstContentOffset(contentIndex); } // Link the frame into our list of children @@ -1947,7 +1953,9 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + PRInt32 contentIndex; + kidFrame->GetContentIndex(contentIndex); + SetFirstContentOffset(contentIndex); } else { prevKidFrame->SetNextSibling(kidFrame); } @@ -2003,7 +2011,9 @@ PRBool nsTableFrame::PullUpChildren(nsIPresContext* aPresContext, // Update our last content offset if (nsnull != prevKidFrame) { NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } // We need to make sure the first content offset is correct for any empty @@ -2113,7 +2123,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, prevKidFrame->SetNextSibling(kidFrame); } else { mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); } mChildCount++; @@ -2169,7 +2179,9 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Update the content mapping NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); #ifdef NS_DEBUG PRInt32 len = LengthOf(mFirstChild); NS_ASSERTION(len == mChildCount, "bad child count"); diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 0515fcd3bb0..15408d8a8b9 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -761,7 +761,9 @@ PRBool nsTableOuterFrame::DeleteChildsNextInFlow(nsIFrame* aChild) if (parent->mFirstChild == nextInFlow) { nextInFlow->GetNextSibling(parent->mFirstChild); if (nsnull != parent->mFirstChild) { - parent->SetFirstContentOffset(parent->mFirstChild); + PRInt32 contentIndex; + parent->mFirstChild->GetContentIndex(contentIndex); + parent->SetFirstContentOffset(contentIndex); if (parent->IsPseudoFrame()) { // Tell the parent's parent to update its content offsets nsContainerFrame* pp = (nsContainerFrame*) parent->mGeometricParent; diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 349465431aa..8c977341c19 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -323,7 +323,9 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon // give it our original mLastContentIsComplete, too (in case we // are pushing into an empty next-in-flow) PushChildren(kidFrame, prevKidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); // Our mLastContentIsComplete was already set by the last kid we // reflowed reflow's status @@ -391,7 +393,9 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon kidFrame->GetNextSibling(nextSibling); if (nsnull != nextSibling) { PushChildren(nextSibling, kidFrame, lastContentIsComplete); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } result = PR_FALSE; break; @@ -563,7 +567,9 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, nextInFlow->mChildCount--; // Update the next-in-flows first content offset if (nsnull != nextInFlow->mFirstChild) { - nextInFlow->SetFirstContentOffset(nextInFlow->mFirstChild); + PRInt32 contentIndex; + nextInFlow->mFirstChild->GetContentIndex(contentIndex); + nextInFlow->SetFirstContentOffset(contentIndex); } // Link the frame into our list of children @@ -576,7 +582,9 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, } if (nsnull == prevKidFrame) { mFirstChild = kidFrame; - SetFirstContentOffset(kidFrame); + PRInt32 contentIndex; + kidFrame->GetContentIndex(contentIndex); + SetFirstContentOffset(contentIndex); } else { prevKidFrame->SetNextSibling(kidFrame); } @@ -632,7 +640,9 @@ PRBool nsTableRowGroupFrame::PullUpChildren(nsIPresContext* aPresContext, // Update our last content offset if (nsnull != prevKidFrame) { NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); } // We need to make sure the first content offset is correct for any empty @@ -769,7 +779,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, prevKidFrame->SetNextSibling(kidFrame); } else { mFirstChild = kidFrame; // our first child - SetFirstContentOffset(kidFrame); + SetFirstContentOffset(kidIndex); } mChildCount++; @@ -816,7 +826,9 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, // Update the content mapping NS_ASSERTION(IsLastChild(prevKidFrame), "bad last child"); - SetLastContentOffset(prevKidFrame); + PRInt32 contentIndex; + prevKidFrame->GetContentIndex(contentIndex); + SetLastContentOffset(contentIndex); #ifdef NS_DEBUG PRInt32 len = LengthOf(mFirstChild); NS_ASSERTION(len == mChildCount, "bad child count");