Bug 1430869 - use mVisibleRect instead of GetRect. r=mstange
authorAlexis Beingessner <a.beingessner@gmail.com>
Mon, 23 Apr 2018 15:08:04 -0400
changeset 415735 04465c06888b1375502e4d33c2c7792e09ec6a49
parent 415734 ac0b202721dcfa1e57be7e004565996d47348cfa
child 415736 9536d401ce06feb399bf4b89c295fa3502354882
push id63253
push userryanvm@gmail.com
push dateThu, 26 Apr 2018 08:05:05 +0000
treeherderautoland@9536d401ce06 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1430869
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -1290,16 +1290,17 @@ bool
 nsDisplayTableBorderCollapse::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                                       wr::IpcResourceUpdateQueue& aResources,
                                                       const StackingContextHelper& aSc,
                                                       mozilla::layers::WebRenderLayerManager* aManager,
                                                       nsDisplayListBuilder* aDisplayListBuilder)
 {
   static_cast<nsTableFrame *>(mFrame)->CreateWebRenderCommandsForBCBorders(aBuilder,
                                                                           aSc,
+                                                                          mVisibleRect,
                                                                           ToReferenceFrame());
   return true;
 }
 
 /* static */ void
 nsTableFrame::GenericTraversal(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
                                const nsDisplayListSet& aLists)
 {
@@ -8024,22 +8025,23 @@ nsTableFrame::PaintBCBorders(DrawTarget&
 {
   BCPaintBorderAction action(aDrawTarget);
   IterateBCBorders(action, 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];
   wr::BorderWidths wrWidths;
   wr::BorderRadius borderRadii = wr::EmptyBorderRadius();
   bool backfaceIsVisible = false;
   NS_FOR_CSS_SIDES(side) {
     auto param = action.mCreateWebRenderCommandsData.mBevelBorders[side];
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -296,17 +296,18 @@ public:
   friend class nsDelayedCalcBCBorders;
 
   void AddBCDamageArea(const mozilla::TableArea& aValue);
   bool BCRecalcNeeded(ComputedStyle* aOldComputedStyle,
                         ComputedStyle* aNewComputedStyle);
   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
   // border to the results of these functions.
   virtual nscoord GetMinISize(gfxContext *aRenderingContext) override;
   virtual nscoord GetPrefISize(gfxContext *aRenderingContext) override;
   IntrinsicISizeOffsetData IntrinsicISizeOffsets(nscoord aPercentageBasis =
                                                  NS_UNCONSTRAINEDSIZE) override;