From 79986e1bf809ef71226ace7df941d8991cddc7a3 Mon Sep 17 00:00:00 2001 From: Alexis Beingessner Date: Mon, 23 Apr 2018 15:08:04 -0400 Subject: [PATCH] Bug 1430869 - use mVisibleRect instead of GetRect. r=mstange An ancient comment from 1998 assures us that GetRect is wrong if there are captions. The painting code instead uses mVisibleRect which appears to be correct. MozReview-Commit-ID: 6Lax4sjInJu --HG-- extra : rebase_source : 79dd527173443fba8d0718c581852d7bfcc47a3c --- layout/tables/nsTableFrame.cpp | 6 ++++-- layout/tables/nsTableFrame.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 205959d7ec84..3afa357d3531 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1295,6 +1295,7 @@ nsDisplayTableBorderCollapse::CreateWebRenderCommands(mozilla::wr::DisplayListBu { static_cast(mFrame)->CreateWebRenderCommandsForBCBorders(aBuilder, aSc, + mVisibleRect, ToReferenceFrame()); return true; } @@ -8029,12 +8030,13 @@ nsTableFrame::PaintBCBorders(DrawTarget& aDrawTarget, const nsRect& aDirtyRect) void nsTableFrame::CreateWebRenderCommandsForBCBorders(wr::DisplayListBuilder& aBuilder, const mozilla::layers::StackingContextHelper& aSc, + const nsRect& aVisibleRect, const nsPoint& aOffsetToReferenceFrame) { BCPaintBorderAction action(aBuilder, aSc, aOffsetToReferenceFrame); - // We always draw whole table border for webrender. Passing the table rect as + // We always draw whole table border for webrender. Passing the visible rect // dirty rect. - IterateBCBorders(action, GetRect()); + IterateBCBorders(action, aVisibleRect - aOffsetToReferenceFrame); LayoutDeviceRect allBorderRect; wr::BorderSide wrSide[4]; diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h index aeae0f894055..594dcc53b2fe 100644 --- a/layout/tables/nsTableFrame.h +++ b/layout/tables/nsTableFrame.h @@ -301,7 +301,8 @@ public: void PaintBCBorders(DrawTarget& aDrawTarget, const nsRect& aDirtyRect); void CreateWebRenderCommandsForBCBorders(mozilla::wr::DisplayListBuilder& aBuilder, const mozilla::layers::StackingContextHelper& aSc, - const nsPoint& aPt); + const nsRect& aVisibleRect, + const nsPoint& aOffsetToReferenceFrame); virtual void MarkIntrinsicISizesDirty() override; // For border-collapse tables, the caller must not add padding and