Bug 1362412 - Do not invalidate table cell's parent frame if it's not border collapse or there is no border. r=mattwoodrow
MozReview-Commit-ID: 5nTrJmMbm9d
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -440,17 +440,19 @@ 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)
{
nsIFrame::InvalidateFrame(aDisplayItemKey);
- GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) {
+ GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ }
}
void nsTableCellFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
// If we have filters applied that would affects our bounds, then
// we get an inactive layer created and this is computed
// within FrameLayerBuilder
--- a/layout/tables/nsTableColFrame.cpp
+++ b/layout/tables/nsTableColFrame.cpp
@@ -207,17 +207,19 @@ nsTableColFrame::GetSplittableType() con
{
return NS_FRAME_NOT_SPLITTABLE;
}
void
nsTableColFrame::InvalidateFrame(uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrame(aDisplayItemKey);
- GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) {
+ GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ }
}
void
nsTableColFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
// If we have filters applied that would affects our bounds, then
--- a/layout/tables/nsTableColGroupFrame.cpp
+++ b/layout/tables/nsTableColGroupFrame.cpp
@@ -463,17 +463,19 @@ NS_NewTableColGroupFrame(nsIPresShell* a
}
NS_IMPL_FRAMEARENA_HELPERS(nsTableColGroupFrame)
void
nsTableColGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrame(aDisplayItemKey);
- GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) {
+ GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ }
}
void
nsTableColGroupFrame::InvalidateFrameWithRect(const nsRect& aRect,
uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
// If we have filters applied that would affects our bounds, then
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -1439,17 +1439,19 @@ void nsTableRowFrame::InitHasCellWithSty
}
RemoveStateBits(NS_ROW_HAS_CELL_WITH_STYLE_BSIZE);
}
void
nsTableRowFrame::InvalidateFrame(uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrame(aDisplayItemKey);
- GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) {
+ GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ }
}
void
nsTableRowFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
// If we have filters applied that would affects our bounds, then
// we get an inactive layer created and this is computed
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -1990,17 +1990,19 @@ nsTableRowGroupFrame::FrameCursorData::A
mOverflowBelow = std::max(mOverflowBelow, overflowBelow);
return mFrames.AppendElement(aFrame) != nullptr;
}
void
nsTableRowGroupFrame::InvalidateFrame(uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrame(aDisplayItemKey);
- GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ if (GetTableFrame()->IsBorderCollapse() && StyleBorder()->HasBorder()) {
+ GetParent()->InvalidateFrameWithRect(GetVisualOverflowRect() + GetPosition(), aDisplayItemKey);
+ }
}
void
nsTableRowGroupFrame::InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey)
{
nsIFrame::InvalidateFrameWithRect(aRect, aDisplayItemKey);
// If we have filters applied that would affects our bounds, then
// we get an inactive layer created and this is computed