Bug 1430869 - use mVisibleRect instead of GetRect. r?jrmuizel
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
--- 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;