Bug 1370833 Part 1 - make less table invalidations for non-border-collapse tables. r=mattwoodrow

For the most part, I tried to make less *manual* table invalidations
for non-border-collapse tables and relied the table invalidations on
the comparison of the display items. By doing so, we can avoid the
over-painting issue.

MozReview-Commit-ID: 4w1DUKHXIFO

--HG--
extra : rebase_source : ac5e6de35a2b20318c70f8eed4375a5673ef6c31
This commit is contained in:
Ya-Chieh Wu 2017-06-09 10:46:34 +08:00
parent b59d3c86ec
commit f9aeb057f1
4 changed files with 27 additions and 13 deletions

View File

@ -960,9 +960,10 @@ nsTableCellFrame::Reflow(nsPresContext* aPresContext,
FinishReflowChild(firstKid, aPresContext, kidSize, &kidReflowInput,
wm, kidOrigin, containerSize, 0);
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);

View File

@ -394,10 +394,14 @@ nsTableRowFrame::DidResize()
cellSize.BSize(wm) = cellBSize;
cellFrame->SetSize(wm, cellSize);
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
// skip this if the bsize didn't change... maybe. Hard to tell.
@ -957,8 +961,11 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
FinishReflowChild(kidFrame, aPresContext, desiredSize, nullptr,
wm, kidPosition, containerSize, 0);
nsTableFrame* tableFrame = GetTableFrame();
if (tableFrame->IsBorderCollapse()) {
nsTableFrame::InvalidateTableFrame(kidFrame, kidRect, kidVisualOverflow,
firstReflow);
}
iCoord += desiredSize.ISize(wm);
} else {

View File

@ -293,8 +293,11 @@ nsTableRowGroupFrame::PlaceChild(nsPresContext* aPresContext,
FinishReflowChild(aKidFrame, aPresContext, aDesiredSize, nullptr,
aWM, aKidPosition, aContainerSize, 0);
nsTableFrame* tableFrame = GetTableFrame();
if (tableFrame->IsBorderCollapse()) {
nsTableFrame::InvalidateTableFrame(aKidFrame, aOriginalKidRect,
aOriginalKidVisualOverflow, isFirstReflow);
}
// Adjust the running block-offset
aReflowInput.bCoord += aDesiredSize.BSize(aWM);

View File

@ -1036,9 +1036,12 @@ nsTableWrapperFrame::Reflow(nsPresContext* aPresContext,
wm, innerOrigin, containerSize, 0);
innerRI.reset();
if (InnerTableFrame()->IsBorderCollapse()) {
nsTableFrame::InvalidateTableFrame(InnerTableFrame(), origInnerRect,
origInnerVisualOverflow,
innerFirstReflow);
}
if (mCaptionFrames.NotEmpty()) {
nsTableFrame::InvalidateTableFrame(mCaptionFrames.FirstChild(),
origCaptionRect,