From 4e2a495fcaa6bd29c704465221fa99db3bf59e89 Mon Sep 17 00:00:00 2001 From: "karnaze%netscape.com" Date: Mon, 22 Oct 2001 14:37:03 +0000 Subject: [PATCH] bug 96343 - skip cellspacing logic when child is not a row. sr=attinasi, r=alexsavulov --- .../html/table/src/nsTableRowGroupFrame.cpp | 26 +++++++++---------- layout/tables/nsTableRowGroupFrame.cpp | 26 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/layout/html/table/src/nsTableRowGroupFrame.cpp b/layout/html/table/src/nsTableRowGroupFrame.cpp index 031f10c4cae..9406a189907 100644 --- a/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -1330,20 +1330,20 @@ nsTableRowGroupFrame::RecoverState(nsRowGroupReflowState& aReflowState, nsTableFrame::GetTableFrame(this, tableFrame); nscoord cellSpacingY = tableFrame->GetCellSpacingY(); - // Walk the list of children looking for aKidFrame - for (nsIFrame* frame = mFrames.FirstChild(); frame; frame->GetNextSibling(&frame)) { - if (frame == aKidFrame) { - break; - } + // Walk the list of children up to aKidFrame + for (nsIFrame* frame = mFrames.FirstChild(); frame && (frame != aKidFrame); frame->GetNextSibling(&frame)) { + nsCOMPtr fType; + frame->GetFrameType(getter_AddRefs(fType)); + if (fType.get() == nsLayoutAtoms::tableRowFrame) { + // Update the running y-offset + nsSize kidSize; + frame->GetSize(kidSize); + aReflowState.y += kidSize.height + cellSpacingY; - // Update the running y-offset - nsSize kidSize; - frame->GetSize(kidSize); - aReflowState.y += cellSpacingY + kidSize.height; - - // If our height is constrained then update the available height - if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) { - aReflowState.availSize.height -= kidSize.height; + // If our height is constrained then update the available height + if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) { + aReflowState.availSize.height -= kidSize.height; + } } } diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 031f10c4cae..9406a189907 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1330,20 +1330,20 @@ nsTableRowGroupFrame::RecoverState(nsRowGroupReflowState& aReflowState, nsTableFrame::GetTableFrame(this, tableFrame); nscoord cellSpacingY = tableFrame->GetCellSpacingY(); - // Walk the list of children looking for aKidFrame - for (nsIFrame* frame = mFrames.FirstChild(); frame; frame->GetNextSibling(&frame)) { - if (frame == aKidFrame) { - break; - } + // Walk the list of children up to aKidFrame + for (nsIFrame* frame = mFrames.FirstChild(); frame && (frame != aKidFrame); frame->GetNextSibling(&frame)) { + nsCOMPtr fType; + frame->GetFrameType(getter_AddRefs(fType)); + if (fType.get() == nsLayoutAtoms::tableRowFrame) { + // Update the running y-offset + nsSize kidSize; + frame->GetSize(kidSize); + aReflowState.y += kidSize.height + cellSpacingY; - // Update the running y-offset - nsSize kidSize; - frame->GetSize(kidSize); - aReflowState.y += cellSpacingY + kidSize.height; - - // If our height is constrained then update the available height - if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) { - aReflowState.availSize.height -= kidSize.height; + // If our height is constrained then update the available height + if (NS_UNCONSTRAINEDSIZE != aReflowState.availSize.height) { + aReflowState.availSize.height -= kidSize.height; + } } }