summaryrefslogtreecommitdiffstats
path: root/layout/tables/nsTableFrame.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-11-02 23:07:40 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-11-02 23:10:06 +0100
commit0de40040f006c493feeff7d688c169b904b8a22e (patch)
tree2a2e856ce590fcea6523f029644d5010da151a47 /layout/tables/nsTableFrame.cpp
parent145527207538b6ee1018cb77e6705912c29f8a9f (diff)
downloadUXP-0de40040f006c493feeff7d688c169b904b8a22e.tar
UXP-0de40040f006c493feeff7d688c169b904b8a22e.tar.gz
UXP-0de40040f006c493feeff7d688c169b904b8a22e.tar.lz
UXP-0de40040f006c493feeff7d688c169b904b8a22e.tar.xz
UXP-0de40040f006c493feeff7d688c169b904b8a22e.zip
Issue #146 - Part 2: Remove custom table painting component.
Since we're now putting table borders and backgrounds properly in the display lists, we no longer need this custom component to do this work for us.
Diffstat (limited to 'layout/tables/nsTableFrame.cpp')
-rw-r--r--layout/tables/nsTableFrame.cpp84
1 files changed, 0 insertions, 84 deletions
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
index b5cd3b487..06a05292f 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -23,7 +23,6 @@
#include "nsTableRowFrame.h"
#include "nsTableRowGroupFrame.h"
#include "nsTableWrapperFrame.h"
-#include "nsTablePainter.h"
#include "BasicTableLayoutStrategy.h"
#include "FixedTableLayoutStrategy.h"
@@ -1167,36 +1166,6 @@ nsDisplayTableBorderCollapse::Paint(nsDisplayListBuilder* aBuilder,
static_cast<nsTableFrame*>(mFrame)->PaintBCBorders(*drawTarget, mVisibleRect - pt);
}
-class nsDisplayTableBorderBackground : public nsDisplayTableItem {
-public:
- nsDisplayTableBorderBackground(nsDisplayListBuilder* aBuilder,
- nsTableFrame* aFrame,
- bool aDrawsBackground) :
- nsDisplayTableItem(aBuilder, aFrame, aDrawsBackground) {
- MOZ_COUNT_CTOR(nsDisplayTableBorderBackground);
- }
-#ifdef NS_BUILD_REFCNT_LOGGING
- virtual ~nsDisplayTableBorderBackground() {
- MOZ_COUNT_DTOR(nsDisplayTableBorderBackground);
- }
-#endif
-
- virtual void Paint(nsDisplayListBuilder* aBuilder,
- nsRenderingContext* aCtx) override;
- NS_DISPLAY_DECL_NAME("TableBorderBackground", TYPE_TABLE_BORDER_BACKGROUND)
-};
-
-void
-nsDisplayTableBorderBackground::Paint(nsDisplayListBuilder* aBuilder,
- nsRenderingContext* aCtx)
-{
- DrawResult result = static_cast<nsTableFrame*>(mFrame)->
- PaintTableBorderBackground(aBuilder, *aCtx, mVisibleRect,
- ToReferenceFrame());
-
- nsDisplayTableItemGeometry::UpdateDrawResult(this, result);
-}
-
/* static */ void
nsTableFrame::GenericTraversal(nsDisplayListBuilder* aBuilder, nsFrame* aFrame,
const nsRect& aDirtyRect, const nsDisplayListSet& aLists)
@@ -1383,59 +1352,6 @@ nsTableFrame::GetDeflationForBackground(nsPresContext* aPresContext) const
return GetOuterBCBorder(wm).GetPhysicalMargin(wm);
}
-// XXX We don't put the borders and backgrounds in tree order like we should.
-// That requires some major surgery which we aren't going to do right now.
-DrawResult
-nsTableFrame::PaintTableBorderBackground(nsDisplayListBuilder* aBuilder,
- nsRenderingContext& aRenderingContext,
- const nsRect& aDirtyRect,
- nsPoint aPt)
-{
- nsPresContext* presContext = PresContext();
-
- uint32_t bgFlags = aBuilder->GetBackgroundPaintFlags();
- PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
- ? PaintBorderFlags::SYNC_DECODE_IMAGES
- : PaintBorderFlags();
-
- TableBackgroundPainter painter(this, TableBackgroundPainter::eOrigin_Table,
- presContext, aRenderingContext,
- aDirtyRect, aPt, bgFlags);
- nsMargin deflate = GetDeflationForBackground(presContext);
- // If 'deflate' is (0,0,0,0) then we'll paint the table background
- // in a separate display item, so don't do it here.
- DrawResult result =
- painter.PaintTable(this, deflate, deflate != nsMargin(0, 0, 0, 0));
-
- if (StyleVisibility()->IsVisible()) {
- if (!IsBorderCollapse()) {
- Sides skipSides = GetSkipSides();
- nsRect rect(aPt, mRect.Size());
-
- result &=
- nsCSSRendering::PaintBorder(presContext, aRenderingContext, this,
- aDirtyRect, rect, mStyleContext,
- borderFlags, skipSides);
- } else {
- DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
-
- gfxPoint devPixelOffset =
- nsLayoutUtils::PointToGfxPoint(aPt,
- PresContext()->AppUnitsPerDevPixel());
-
- // XXX we should probably get rid of this translation at some stage
- // But that would mean modifying PaintBCBorders, ugh
- AutoRestoreTransform autoRestoreTransform(drawTarget);
- drawTarget->SetTransform(
- drawTarget->GetTransform().PreTranslate(ToPoint(devPixelOffset)));
-
- PaintBCBorders(*drawTarget, aDirtyRect - aPt);
- }
- }
-
- return result;
-}
-
nsIFrame::LogicalSides
nsTableFrame::GetLogicalSkipSides(const ReflowInput* aReflowInput) const
{