diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 1b8d96e34550..6d81b0ed084e 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -960,9 +960,10 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext, FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput, wm, kidOrigin, containerSize, 0); - nsTableFrame::InvalidateTableFrame(firstKid, origRect, origVisualOverflow, - firstReflow); - + if (tableFrame->IsBorderCollapse()) { + nsTableFrame::InvalidateTableFrame(firstKid, origRect, origVisualOverflow, + firstReflow); + } // first, compute the bsize which can be set w/o being restricted by // available bsize LogicalSize cellSize(wm); diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp index f6b22ea51f06..d45dc7fd0249 100644 --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -394,9 +394,13 @@ nsTableRowFrame::DidResize() cellSize.BSize(wm) = cellBSize; cellFrame->SetSize(wm, cellSize); - nsTableFrame::InvalidateTableFrame(cellFrame, cellOldRect, - cellVisualOverflow, - false); + + nsTableFrame* tableFrame = GetTableFrame(); + if (tableFrame->IsBorderCollapse()) { + nsTableFrame::InvalidateTableFrame(cellFrame, cellOldRect, + cellVisualOverflow, + false); + } } // realign cell content based on the new bsize. We might be able to @@ -957,8 +961,11 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr, wm, kidPosition, containerSize, 0); - nsTableFrame::InvalidateTableFrame(kidFrame, kidRect, kidVisualOverflow, - firstReflow); + nsTableFrame* tableFrame = GetTableFrame(); + if (tableFrame->IsBorderCollapse()) { + nsTableFrame::InvalidateTableFrame(kidFrame, kidRect, kidVisualOverflow, + firstReflow); + } iCoord += desiredSize.ISize(wm); } else { diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 87aabc6c48b0..368dc5b1ec07 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -293,8 +293,11 @@ nsTableRowGroupFrame::PlaceChild(nsPresContext* aPresContext, FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr, aWM, aKidPosition, aContainerSize, 0); - nsTableFrame::InvalidateTableFrame(aKidFrame, aOriginalKidRect, - aOriginalKidVisualOverflow, isFirstReflow); + nsTableFrame* tableFrame = GetTableFrame(); + if (tableFrame->IsBorderCollapse()) { + nsTableFrame::InvalidateTableFrame(aKidFrame, aOriginalKidRect, + aOriginalKidVisualOverflow, isFirstReflow); + } // Adjust the running block-offset aReflowInput.bCoord += aDesiredSize.BSize(aWM); diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp index cbdabcb30872..b0531a18dc44 100644 --- a/layout/tables/nsTableWrapperFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -1036,9 +1036,12 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext, wm, innerOrigin, containerSize, 0); innerRI.reset(); - nsTableFrame::InvalidateTableFrame(InnerTableFrame(), origInnerRect, - origInnerVisualOverflow, - innerFirstReflow); + if (InnerTableFrame()->IsBorderCollapse()) { + nsTableFrame::InvalidateTableFrame(InnerTableFrame(), origInnerRect, + origInnerVisualOverflow, + innerFirstReflow); + } + if (mCaptionFrames.NotEmpty()) { nsTableFrame::InvalidateTableFrame(mCaptionFrames.FirstChild(), origCaptionRect,