From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- layout/tables/nsTableCellFrame.h | 90 ++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 59 deletions(-) (limited to 'layout/tables/nsTableCellFrame.h') diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h index f9b6f3ccac..ae1a881819 100644 --- a/layout/tables/nsTableCellFrame.h +++ b/layout/tables/nsTableCellFrame.h @@ -34,9 +34,6 @@ class PresShell; class nsTableCellFrame : public nsContainerFrame, public nsITableCellLayout, public nsIPercentBSizeObserver { - typedef mozilla::gfx::DrawTarget DrawTarget; - typedef mozilla::image::ImgDrawResult ImgDrawResult; - friend nsTableCellFrame* NS_NewTableCellFrame(mozilla::PresShell* aPresShell, ComputedStyle* aStyle, nsTableFrame* aTableFrame); @@ -44,11 +41,6 @@ class nsTableCellFrame : public nsContainerFrame, nsTableCellFrame(ComputedStyle* aStyle, nsTableFrame* aTableFrame) : nsTableCellFrame(aStyle, aTableFrame, kClassID) {} - protected: - typedef mozilla::WritingMode WritingMode; - typedef mozilla::LogicalSide LogicalSide; - typedef mozilla::LogicalMargin LogicalMargin; - public: NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS(nsTableCellFrame) @@ -122,7 +114,9 @@ class nsTableCellFrame : public nsContainerFrame, nsresult GetFrameName(nsAString& aResult) const override; #endif - void BlockDirAlignChild(mozilla::WritingMode aWM, nscoord aMaxAscent); + // Align the cell's child frame within the cell. + void BlockDirAlignChild(mozilla::WritingMode aWM, nscoord aMaxAscent, + mozilla::ForceAlignTopForTableCell aForceAlignTop); /* * Get the value of vertical-align adjusted for CSS 2's rules for a @@ -193,20 +187,24 @@ class nsTableCellFrame : public nsContainerFrame, void SetColIndex(int32_t aColIndex); - /** return the available isize given to this frame during its last reflow */ - inline nscoord GetPriorAvailISize(); - - /** set the available isize given to this frame during its last reflow */ - inline void SetPriorAvailISize(nscoord aPriorAvailISize); - - /** return the desired size returned by this frame during its last reflow */ - inline mozilla::LogicalSize GetDesiredSize(); + // Get or set the available isize given to this frame during its last reflow. + nscoord GetPriorAvailISize() const { return mPriorAvailISize; } + void SetPriorAvailISize(nscoord aPriorAvailISize) { + mPriorAvailISize = aPriorAvailISize; + } - /** set the desired size returned by this frame during its last reflow */ - inline void SetDesiredSize(const ReflowOutput& aDesiredSize); + // Get or set the desired size returned by this frame during its last reflow. + mozilla::LogicalSize GetDesiredSize() const { return mDesiredSize; } + void SetDesiredSize(const ReflowOutput& aDesiredSize) { + mDesiredSize = aDesiredSize.Size(GetWritingMode()); + } - bool GetContentEmpty() const; - void SetContentEmpty(bool aContentEmpty); + bool GetContentEmpty() const { + return HasAnyStateBits(NS_TABLE_CELL_CONTENT_EMPTY); + } + void SetContentEmpty(bool aContentEmpty) { + AddOrRemoveStateBits(NS_TABLE_CELL_CONTENT_EMPTY, aContentEmpty); + } nsTableCellFrame* GetNextCell() const { nsIFrame* sibling = GetNextSibling(); @@ -216,7 +214,7 @@ class nsTableCellFrame : public nsContainerFrame, return static_cast(sibling); } - virtual LogicalMargin GetBorderWidth(WritingMode aWM) const; + virtual mozilla::LogicalMargin GetBorderWidth(mozilla::WritingMode aWM) const; void DecorateForSelection(DrawTarget* aDrawTarget, nsPoint aPt); @@ -251,44 +249,17 @@ class nsTableCellFrame : public nsContainerFrame, friend class nsTableRowFrame; - uint32_t mColIndex; // the starting column for this cell - - nscoord mPriorAvailISize; // the avail isize during the last reflow - mozilla::LogicalSize mDesiredSize; // the last desired inline and block size -}; - -inline nscoord nsTableCellFrame::GetPriorAvailISize() { - return mPriorAvailISize; -} - -inline void nsTableCellFrame::SetPriorAvailISize(nscoord aPriorAvailISize) { - mPriorAvailISize = aPriorAvailISize; -} - -inline mozilla::LogicalSize nsTableCellFrame::GetDesiredSize() { - return mDesiredSize; -} - -inline void nsTableCellFrame::SetDesiredSize(const ReflowOutput& aDesiredSize) { - mDesiredSize = aDesiredSize.Size(GetWritingMode()); -} + // The starting column for this cell + uint32_t mColIndex = 0; -inline bool nsTableCellFrame::GetContentEmpty() const { - return HasAnyStateBits(NS_TABLE_CELL_CONTENT_EMPTY); -} + // The avail isize during the last reflow + nscoord mPriorAvailISize = 0; -inline void nsTableCellFrame::SetContentEmpty(bool aContentEmpty) { - if (aContentEmpty) { - AddStateBits(NS_TABLE_CELL_CONTENT_EMPTY); - } else { - RemoveStateBits(NS_TABLE_CELL_CONTENT_EMPTY); - } -} + // The last desired inline and block size + mozilla::LogicalSize mDesiredSize; +}; -// nsBCTableCellFrame class nsBCTableCellFrame final : public nsTableCellFrame { - typedef mozilla::image::ImgDrawResult ImgDrawResult; - public: NS_DECL_FRAMEARENA_HELPERS(nsBCTableCellFrame) @@ -299,13 +270,14 @@ class nsBCTableCellFrame final : public nsTableCellFrame { nsMargin GetUsedBorder() const override; // Get the *inner half of the border only*, in twips. - LogicalMargin GetBorderWidth(WritingMode aWM) const override; + mozilla::LogicalMargin GetBorderWidth( + mozilla::WritingMode aWM) const override; // Get the *inner half of the border only*, in pixels. - BCPixelSize GetBorderWidth(LogicalSide aSide) const; + BCPixelSize GetBorderWidth(mozilla::LogicalSide aSide) const; // Set the full (both halves) width of the border - void SetBorderWidth(LogicalSide aSide, BCPixelSize aPixelValue); + void SetBorderWidth(mozilla::LogicalSide aSide, BCPixelSize aPixelValue); nsMargin GetBorderOverflow() override; -- cgit v1.2.3