From 83459c927715bd6d2be1e339ff723b4feb3e5fe7 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Fri, 20 Jul 2018 09:13:56 +0200 Subject: Bug 958714 Simplify percent-margin/padding resolution code to pass around a single length as the percent basis --- layout/generic/ReflowInput.h | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'layout/generic/ReflowInput.h') diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index 09c980b72..1d2df6af6 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -245,7 +245,7 @@ public: static void* DisplayInitOffsetsEnter( nsIFrame* aFrame, SizeComputationInput* aState, - const mozilla::LogicalSize& aPercentBasis, + nscoord aPercentBasis, const nsMargin* aBorder, const nsMargin* aPadding); static void DisplayInitOffsetsExit(nsIFrame* aFrame, @@ -260,19 +260,12 @@ private: * * @param aWM Writing mode of the containing block * @param aPercentBasis - * Logical size in the writing mode of the containing block to use - * for resolving percentage margin values in the inline and block - * axes. - * The inline size is usually the containing block inline-size - * (width if writing mode is horizontal, and height if vertical). - * The block size is usually the containing block inline-size, per - * CSS21 sec 8.3 (read in conjunction with CSS Writing Modes sec - * 7.2), but may be the containing block block-size, e.g. in CSS3 - * Flexbox and Grid. + * Inline size of the containing block (in its own writing mode), to use + * for resolving percentage margin values in the inline and block axes. * @return true if the margin is dependent on the containing block size. */ bool ComputeMargin(mozilla::WritingMode aWM, - const mozilla::LogicalSize& aPercentBasis); + nscoord aPercentBasis); /** * Computes padding values from the specified padding style information, and @@ -280,25 +273,18 @@ private: * * @param aWM Writing mode of the containing block * @param aPercentBasis - * Logical size in the writing mode of the containing block to use - * for resolving percentage padding values in the inline and block - * axes. - * The inline size is usually the containing block inline-size - * (width if writing mode is horizontal, and height if vertical). - * The block size is usually the containing block inline-size, per - * CSS21 sec 8.3 (read in conjunction with CSS Writing Modes sec - * 7.2), but may be the containing block block-size, e.g. in CSS3 - * Flexbox and Grid. + * Inline size of the containing block (in its own writing mode), to use + * for resolving percentage padding values in the inline and block axes. * @return true if the padding is dependent on the containing block size. */ bool ComputePadding(mozilla::WritingMode aWM, - const mozilla::LogicalSize& aPercentBasis, + nscoord aPercentBasis, nsIAtom* aFrameType); protected: void InitOffsets(mozilla::WritingMode aWM, - const mozilla::LogicalSize& aPercentBasis, + nscoord aPercentBasis, nsIAtom* aFrameType, ReflowInputFlags aFlags, const nsMargin* aBorder = nullptr, -- cgit v1.2.3