# HG changeset patch # User Matt Woodrow # Date 1528360298 -43200 # Node ID 60e4f650a3eb3626a1daaeec1004b28365086f9b # Parent c0c1dea29b1728bc69f13dd4cf0f2eb9756f29bf Bug 1464928 - Invalidate border-collapse tables when we remove the border from a cell. r=mstange MozReview-Commit-ID: 4LWdFJkr72v diff --git a/layout/reftests/invalidation/reftest.list b/layout/reftests/invalidation/reftest.list --- a/layout/reftests/invalidation/reftest.list +++ b/layout/reftests/invalidation/reftest.list @@ -1,13 +1,14 @@ == table-repaint-a.html table-repaint-a-ref.html == table-repaint-b.html table-repaint-b-ref.html == table-repaint-border-collapse.html table-repaint-border-collapse-ref.html == table-repaint-c.html table-repaint-c-ref.html == table-repaint-d.html table-repaint-d-ref.html +== table-repaint-e.html table-repaint-e-ref.html == table-repaint-non-border-collapse.html table-repaint-non-border-collapse-ref.html == 540247-1.xul 540247-1-ref.xul == 543681-1.html 543681-1-ref.html == 1243409-1.html 1243409-1-ref.html skip == test-image-layers.html test-image-layers-ref.html # Bug 1067360 skip == test-image-layers-multiple-displayitem.html test-image-layers-ref.html # Bug 1067360 pref(layout.animated-image-layers.enabled,true) skip-if(Android||gtkWidget) == test-animated-image-layers.html test-animated-image-layers-ref.html pref(layout.animated-image-layers.enabled,true) skip-if(Android||gtkWidget) == test-animated-image-layers-background.html test-animated-image-layers-ref.html diff --git a/layout/reftests/invalidation/table-repaint-e-ref.html b/layout/reftests/invalidation/table-repaint-e-ref.html new file mode 100644 --- /dev/null +++ b/layout/reftests/invalidation/table-repaint-e-ref.html @@ -0,0 +1,34 @@ + + + +table-repaint-e + + + + + + + + + + +
+
one
+
+
two
+
+
three
+
+
four
+
+ + diff --git a/layout/reftests/invalidation/table-repaint-e.html b/layout/reftests/invalidation/table-repaint-e.html new file mode 100644 --- /dev/null +++ b/layout/reftests/invalidation/table-repaint-e.html @@ -0,0 +1,42 @@ + + + +table-repaint-e + + + + + + + + + + +
+
one
+
+
two
+
+
three
+
+
four
+
+ + + diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -436,17 +436,17 @@ nsDisplayTableCellBackground::GetBounds( // revert from nsDisplayTableItem's implementation ... cell backgrounds // don't overflow the cell return nsDisplayItem::GetBounds(aBuilder, aSnap); } void nsTableCellFrame::InvalidateFrame(uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrame(aDisplayItemKey, aRebuildDisplayItems); - if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) { + if (GetTableFrame()->IsBorderCollapse()) { GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey, false); } } void nsTableCellFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey, aRebuildDisplayItems); // If we have filters applied that would affects our bounds, then diff --git a/layout/tables/nsTableColFrame.cpp b/layout/tables/nsTableColFrame.cpp --- a/layout/tables/nsTableColFrame.cpp +++ b/layout/tables/nsTableColFrame.cpp @@ -207,17 +207,17 @@ nsTableColFrame::GetSplittableType() con { return NS_FRAME_NOT_SPLITTABLE; } void nsTableColFrame::InvalidateFrame(uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrame(aDisplayItemKey, aRebuildDisplayItems); - if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) { + if (GetTableFrame()->IsBorderCollapse()) { GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey, false); } } void nsTableColFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey, aRebuildDisplayItems); diff --git a/layout/tables/nsTableColGroupFrame.cpp b/layout/tables/nsTableColGroupFrame.cpp --- a/layout/tables/nsTableColGroupFrame.cpp +++ b/layout/tables/nsTableColGroupFrame.cpp @@ -447,17 +447,17 @@ NS_NewTableColGroupFrame(nsIPresShell* a } NS_IMPL_FRAMEARENA_HELPERS(nsTableColGroupFrame) void nsTableColGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrame(aDisplayItemKey, aRebuildDisplayItems); - if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) { + if (GetTableFrame()->IsBorderCollapse()) { GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey, false); } } void nsTableColGroupFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey, bool aRebuildDisplayItems) diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp --- a/layout/tables/nsTableRowFrame.cpp +++ b/layout/tables/nsTableRowFrame.cpp @@ -1439,17 +1439,17 @@ void nsTableRowFrame::InitHasCellWithSty } RemoveStateBits(NS_ROW_HAS_CELL_WITH_STYLE_BSIZE); } void nsTableRowFrame::InvalidateFrame(uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrame(aDisplayItemKey, aRebuildDisplayItems); - if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) { + if (GetTableFrame()->IsBorderCollapse()) { GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey, false); } } void nsTableRowFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey, aRebuildDisplayItems); diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1984,17 +1984,17 @@ nsTableRowGroupFrame::FrameCursorData::A mOverflowBelow = std::max(mOverflowBelow, overflowBelow); return mFrames.AppendElement(aFrame) != nullptr; } void nsTableRowGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrame(aDisplayItemKey, aRebuildDisplayItems); - if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) { + if (GetTableFrame()->IsBorderCollapse()) { GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey, false); } } void nsTableRowGroupFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey, bool aRebuildDisplayItems) { nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey, aRebuildDisplayItems);