summaryrefslogtreecommitdiffstats
path: root/layout/tables/nsTableCellFrame.h
diff options
context:
space:
mode:
Diffstat (limited to 'layout/tables/nsTableCellFrame.h')
-rw-r--r--layout/tables/nsTableCellFrame.h55
1 files changed, 47 insertions, 8 deletions
diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h
index 5f87c5f6d..f626a45b0 100644
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -165,11 +165,11 @@ public:
/**
* return the cell's specified row span. this is what was specified in the
- * content model or in the style info, and is always >= 1.
+ * content model or in the style info, and is always >= 0.
* to get the effective row span (the actual value that applies), use GetEffectiveRowSpan()
* @see nsTableFrame::GetEffectiveRowSpan()
*/
- virtual int32_t GetRowSpan();
+ int32_t GetRowSpan();
// there is no set row index because row index depends on the cell's parent row only
@@ -183,7 +183,10 @@ public:
NS_IMETHOD GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex) override;
/** return the mapped cell's row index (starting at 0 for the first row) */
- virtual nsresult GetRowIndex(int32_t &aRowIndex) const override;
+ uint32_t RowIndex() const
+ {
+ return static_cast<nsTableRowFrame*>(GetParent())->GetRowIndex();
+ }
/**
* return the cell's specified col span. this is what was specified in the
@@ -191,10 +194,19 @@ public:
* to get the effective col span (the actual value that applies), use GetEffectiveColSpan()
* @see nsTableFrame::GetEffectiveColSpan()
*/
- virtual int32_t GetColSpan();
+ int32_t GetColSpan();
/** return the cell's column index (starting at 0 for the first column) */
- virtual nsresult GetColIndex(int32_t &aColIndex) const override;
+ uint32_t ColIndex() const
+ {
+ // NOTE: We copy this from previous continuations, and we don't ever have
+ // dynamic updates when tables split, so our mColIndex always matches our
+ // first continuation's.
+ MOZ_ASSERT(static_cast<nsTableCellFrame*>(FirstContinuation())->mColIndex ==
+ mColIndex,
+ "mColIndex out of sync with first continuation");
+ return mColIndex;
+ }
void SetColIndex(int32_t aColIndex);
/** return the available isize given to this frame during its last reflow */
@@ -209,13 +221,23 @@ public:
/** set the desired size returned by this frame during its last reflow */
inline void SetDesiredSize(const ReflowOutput & aDesiredSize);
- bool GetContentEmpty();
+ bool GetContentEmpty() const;
void SetContentEmpty(bool aContentEmpty);
bool HasPctOverBSize();
void SetHasPctOverBSize(bool aValue);
- nsTableCellFrame* GetNextCell() const;
+ nsTableCellFrame* GetNextCell() const
+ {
+ nsIFrame* sibling = GetNextSibling();
+#ifdef DEBUG
+ if (sibling) {
+ nsTableCellFrame* cellFrame = do_QueryFrame(sibling);
+ MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
+ }
+#endif // DEBUG
+ return static_cast<nsTableCellFrame*>(sibling);
+ }
virtual LogicalMargin GetBorderWidth(WritingMode aWM) const;
@@ -237,6 +259,10 @@ public:
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); }
+ bool ShouldPaintBordersAndBackgrounds() const;
+
+ bool ShouldPaintBackground(nsDisplayListBuilder* aBuilder);
+
protected:
virtual LogicalSides
GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
@@ -273,7 +299,7 @@ inline void nsTableCellFrame::SetDesiredSize(const ReflowOutput & aDesiredSize)
mDesiredSize = aDesiredSize.Size(wm).ConvertTo(GetWritingMode(), wm);
}
-inline bool nsTableCellFrame::GetContentEmpty()
+inline bool nsTableCellFrame::GetContentEmpty() const
{
return HasAnyStateBits(NS_TABLE_CELL_CONTENT_EMPTY);
}
@@ -350,4 +376,17 @@ private:
BCPixelSize mIStartBorder;
};
+// Implemented here because that's a sane-ish way to make the includes work out.
+inline nsTableCellFrame* nsTableRowFrame::GetFirstCell() const
+{
+ nsIFrame* firstChild = mFrames.FirstChild();
+#ifdef DEBUG
+ if (firstChild) {
+ nsTableCellFrame* cellFrame = do_QueryFrame(firstChild);
+ MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
+ }
+#endif // DEBUG
+ return static_cast<nsTableCellFrame*>(firstChild);
+}
+
#endif