diff options
Diffstat (limited to 'layout/generic/ReflowInput.h')
-rw-r--r-- | layout/generic/ReflowInput.h | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index 620ad0f413..7bf7c4fc73 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -178,20 +178,6 @@ struct SizeComputationInput { const mozilla::Maybe<mozilla::LogicalMargin>& aPadding = mozilla::Nothing()); -#ifdef DEBUG - // Reflow trace methods. Defined in nsFrame.cpp so they have access - // to the display-reflow infrastructure. - static void* DisplayInitOffsetsEnter(nsIFrame* aFrame, - SizeComputationInput* aState, - nscoord aPercentBasis, - mozilla::WritingMode aCBWritingMode, - const nsMargin* aBorder, - const nsMargin* aPadding); - static void DisplayInitOffsetsExit(nsIFrame* aFrame, - SizeComputationInput* aState, - void* aValue); -#endif - private: /** * Computes margin values from the specified margin style information, and @@ -367,6 +353,16 @@ struct ReflowInput : public SizeComputationInput { mozilla::LogicalSize AvailableSize() const { return mAvailableSize; } mozilla::LogicalSize ComputedSize() const { return mComputedSize; } + + template <typename F> + mozilla::LogicalSize ComputedSizeWithBSizeFallback(F&& aFallback) const { + auto size = mComputedSize; + if (size.BSize(mWritingMode) == NS_UNCONSTRAINEDSIZE) { + size.BSize(mWritingMode) = ApplyMinMaxBSize(aFallback()); + } + return size; + } + mozilla::LogicalSize ComputedMinSize() const { return mComputedMinSize; } mozilla::LogicalSize ComputedMaxSize() const { return mComputedMaxSize; } @@ -745,6 +741,15 @@ struct ReflowInput : public SizeComputationInput { const nsIContent* aContent, nscoord aBlockBSize, float aFontSizeInflation); + static nscoord CalcLineHeightForCanvas(const StyleLineHeight& aLh, + const nsFont& aRelativeToFont, + nsAtom* aLanguage, + bool aExplicitLanguage, + nsPresContext* aPresContext, + mozilla::WritingMode aWM); + + static constexpr float kNormalLineHeightFactor = 1.2f; + mozilla::LogicalSize ComputeContainingBlockRectangle( nsPresContext* aPresContext, const ReflowInput* aContainingBlockRI) const; @@ -888,21 +893,6 @@ struct ReflowInput : public SizeComputationInput { LogicalMargin& aMargin, LogicalMargin& aOffsets); -#ifdef DEBUG - // Reflow trace methods. Defined in nsFrame.cpp so they have access - // to the display-reflow infrastructure. - static void* DisplayInitConstraintsEnter(nsIFrame* aFrame, - ReflowInput* aState, - nscoord aCBISize, nscoord aCBBSize, - const nsMargin* aBorder, - const nsMargin* aPadding); - static void DisplayInitConstraintsExit(nsIFrame* aFrame, ReflowInput* aState, - void* aValue); - static void* DisplayInitFrameTypeEnter(nsIFrame* aFrame, ReflowInput* aState); - static void DisplayInitFrameTypeExit(nsIFrame* aFrame, ReflowInput* aState, - void* aValue); -#endif - protected: void InitCBReflowInput(); void InitResizeFlags(nsPresContext* aPresContext, |