diff --git a/layout/forms/nsDateTimeControlFrame.cpp b/layout/forms/nsDateTimeControlFrame.cpp index c33ea94649b3..786899aa8ce5 100644 --- a/layout/forms/nsDateTimeControlFrame.cpp +++ b/layout/forms/nsDateTimeControlFrame.cpp @@ -128,8 +128,7 @@ void nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext, availSize); // Convert input area margin into my own writing-mode (in case it differs): - LogicalMargin childMargin = - childReflowOuput.ComputedLogicalMargin().ConvertTo(myWM, wm); + LogicalMargin childMargin = childReflowOuput.ComputedLogicalMargin(myWM); // offsets of input area frame within this frame: LogicalPoint childOffset( diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index 63c42b23c534..f4a81a47b290 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -155,8 +155,7 @@ void BlockReflowInput::ComputeReplacedBlockOffsetsForFloats( LogicalMargin frameMargin(wm); SizeComputationInput os(aFrame, mReflowInput.mRenderingContext, wm, mContentArea.ISize(wm)); - frameMargin = - os.ComputedLogicalMargin().ConvertTo(wm, aFrame->GetWritingMode()); + frameMargin = os.ComputedLogicalMargin(wm); nscoord iStartFloatIOffset = aFloatAvailableSpace.IStart(wm) - mContentArea.IStart(wm); @@ -615,7 +614,8 @@ static nscoord FloatMarginISize(const ReflowInput& aCBReflowInput, auto floatSize = aFloat->ComputeSize( aCBReflowInput.mRenderingContext, wm, aCBReflowInput.ComputedSize(wm), - aFloatAvailableISize, aFloatOffsetState.ComputedLogicalMargin().Size(wm), + aFloatAvailableISize, + aFloatOffsetState.ComputedLogicalMargin(wm).Size(wm), aFloatOffsetState.ComputedLogicalBorderPadding().Size(wm), ComputeSizeFlag::ShrinkWrap); @@ -626,10 +626,7 @@ static nscoord FloatMarginISize(const ReflowInput& aCBReflowInput, } return floatISize + - aFloatOffsetState.ComputedLogicalMargin() - .Size(wm) - .ConvertTo(cbwm, wm) - .ISize(cbwm) + + aFloatOffsetState.ComputedLogicalMargin(cbwm).IStartEnd(cbwm) + aFloatOffsetState.ComputedLogicalBorderPadding() .Size(wm) .ConvertTo(cbwm, wm) @@ -718,8 +715,8 @@ bool BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat) { // Get the band of available space with respect to margin box. nsFlowAreaRect floatAvailableSpace = GetFloatAvailableSpaceForPlacingFloat(mBCoord); - LogicalRect adjustedAvailableSpace = mBlock->AdjustFloatAvailableSpace( - *this, floatAvailableSpace.mRect); + LogicalRect adjustedAvailableSpace = + mBlock->AdjustFloatAvailableSpace(*this, floatAvailableSpace.mRect); NS_ASSERTION(aFloat->GetParent() == mBlock, "Float frame has wrong parent"); diff --git a/layout/generic/CSSAlignUtils.cpp b/layout/generic/CSSAlignUtils.cpp index 3f397455b5fc..f84e89c51d0e 100644 --- a/layout/generic/CSSAlignUtils.cpp +++ b/layout/generic/CSSAlignUtils.cpp @@ -56,8 +56,8 @@ nscoord CSSAlignUtils::AlignJustifySelf(const StyleAlignFlags& aAlignment, // methods? (bug 1209710) // Get the item's margin corresponding to the container's start/end side. - const LogicalMargin margin = aRI.ComputedLogicalMargin(); WritingMode wm = aRI.GetWritingMode(); + const LogicalMargin margin = aRI.ComputedLogicalMargin(wm); nscoord marginStart, marginEnd; if (aAxis == eLogicalAxisBlock) { if (MOZ_LIKELY(isSameSide)) { diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 6f00359e0e77..ee4541cb7081 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -231,8 +231,9 @@ nscoord SizeComputationInput::ComputeISizeValue( nscoord aContainingBlockISize, StyleBoxSizing aBoxSizing, const SizeOrMaxSize& aSize) const { WritingMode wm = GetWritingMode(); - nscoord inside = 0, outside = ComputedLogicalBorderPadding().IStartEnd(wm) + - ComputedLogicalMargin().IStartEnd(wm); + nscoord inside = 0; + nscoord outside = ComputedLogicalBorderPadding().IStartEnd(wm) + + ComputedLogicalMargin(wm).IStartEnd(wm); if (aBoxSizing == StyleBoxSizing::Border) { inside = ComputedLogicalBorderPadding().IStartEnd(wm); } @@ -1618,7 +1619,7 @@ void ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext, sizeResult = mFrame->ComputeSize( mRenderingContext, wm, cbSize.ConvertTo(wm, cbwm), cbSize.ConvertTo(wm, cbwm).ISize(wm), // XXX or AvailableISize()? - ComputedLogicalMargin().Size(wm) + ComputedLogicalOffsets().Size(wm), + ComputedLogicalMargin(wm).Size(wm) + ComputedLogicalOffsets().Size(wm), ComputedLogicalBorderPadding().Size(wm), mComputeSizeFlags); ComputedISize() = sizeResult.mLogicalSize.ISize(wm); ComputedBSize() = sizeResult.mLogicalSize.BSize(wm); @@ -1637,7 +1638,7 @@ void ReflowInput::InitAbsoluteConstraints(nsPresContext* aPresContext, // XXX Now that we have ComputeSize, can we condense many of the // branches off of widthIsAuto? - LogicalMargin margin = ComputedLogicalMargin().ConvertTo(cbwm, wm); + LogicalMargin margin = ComputedLogicalMargin(cbwm); const LogicalMargin borderPadding = ComputedLogicalBorderPadding().ConvertTo(cbwm, wm); @@ -2339,7 +2340,7 @@ void ReflowInput::InitConstraints( auto size = mFrame->ComputeSize( mRenderingContext, wm, cbSize, AvailableISize(), - ComputedLogicalMargin().Size(wm), + ComputedLogicalMargin(wm).Size(wm), ComputedLogicalBorderPadding().Size(wm), mComputeSizeFlags); ComputedISize() = size.mLogicalSize.ISize(wm); @@ -2545,7 +2546,7 @@ void ReflowInput::CalculateBlockSideMargins(LayoutFrameType aFrameType) { "result from very large sizes, not attempts at " "intrinsic inline-size calculation"); - LogicalMargin margin = ComputedLogicalMargin().ConvertTo(cbWM, mWritingMode); + LogicalMargin margin = ComputedLogicalMargin(cbWM); LogicalMargin borderPadding = ComputedLogicalBorderPadding().ConvertTo(cbWM, mWritingMode); nscoord sum = margin.IStartEnd(cbWM) + borderPadding.IStartEnd(cbWM) + @@ -2784,7 +2785,7 @@ bool SizeComputationInput::ComputeMargin(WritingMode aCBWM, nscoord marginAdjustment = FontSizeInflationListMarginAdjustment(mFrame); if (marginAdjustment > 0) { - LogicalMargin m = ComputedLogicalMargin(); + LogicalMargin m = ComputedLogicalMargin(mWritingMode); m.IStart(mWritingMode) += marginAdjustment; SetComputedLogicalMargin(mWritingMode, m); } diff --git a/layout/generic/ReflowInput.h b/layout/generic/ReflowInput.h index f776c12314ae..1c0b1311a29f 100644 --- a/layout/generic/ReflowInput.h +++ b/layout/generic/ReflowInput.h @@ -127,7 +127,9 @@ struct SizeComputationInput { return mComputedPadding.GetPhysicalMargin(mWritingMode); } - LogicalMargin ComputedLogicalMargin() const { return mComputedMargin; } + LogicalMargin ComputedLogicalMargin(mozilla::WritingMode aWM) const { + return mComputedMargin.ConvertTo(aWM, mWritingMode); + } LogicalMargin ComputedLogicalBorderPadding() const { return mComputedBorderPadding; } @@ -423,9 +425,9 @@ struct ReflowInput : public SizeComputationInput { mozilla::WritingMode wm = GetWritingMode(); return mozilla::LogicalSize( wm, - ComputedISize() + ComputedLogicalMargin().IStartEnd(wm) + + ComputedISize() + ComputedLogicalMargin(wm).IStartEnd(wm) + ComputedLogicalBorderPadding().IStartEnd(wm), - ComputedBSize() + ComputedLogicalMargin().BStartEnd(wm) + + ComputedBSize() + ComputedLogicalMargin(wm).BStartEnd(wm) + ComputedLogicalBorderPadding().BStartEnd(wm)); } diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp index 2c939680fd12..6daae6af6c5a 100644 --- a/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/layout/generic/nsAbsoluteContainingBlock.cpp @@ -720,8 +720,7 @@ void nsAbsoluteContainingBlock::ReflowAbsoluteFrame( WritingMode outerWM = aReflowInput.GetWritingMode(); const LogicalMargin border(outerWM, aDelegatingFrame->GetUsedBorder()); - LogicalMargin margin = - kidReflowInput.ComputedLogicalMargin().ConvertTo(outerWM, wm); + LogicalMargin margin = kidReflowInput.ComputedLogicalMargin(outerWM); // If we're doing CSS Box Alignment in either axis, that will apply the // margin for us in that axis (since the thing that's aligned is the margin @@ -756,7 +755,7 @@ void nsAbsoluteContainingBlock::ReflowAbsoluteFrame( kidReflowInput.AvailableBSize() = aReflowInput.AvailableBSize() - border.ConvertTo(wm, outerWM).BStart(wm) - - kidReflowInput.ComputedLogicalMargin().BStart(wm); + kidReflowInput.ComputedLogicalMargin(wm).BStart(wm); if (NS_AUTOOFFSET != kidReflowInput.ComputedLogicalOffsets().BStart(wm)) { kidReflowInput.AvailableBSize() -= kidReflowInput.ComputedLogicalOffsets().BStart(wm); diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 136f9826a3e1..27239b08a127 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -1271,7 +1271,7 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics, // Block-end margin never causes us to create continuations, so we // don't need to worry about whether it fits in its entirety. blockDirExtras.BStart(wm) += - aReflowInput.ComputedLogicalMargin().BStart(wm); + aReflowInput.ComputedLogicalMargin(wm).BStart(wm); } if (effectiveComputedBSize + blockDirExtras.BStartEnd(wm) <= @@ -2000,8 +2000,9 @@ void nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput, bool found; nscoord cbSize = GetProperty(BClampMarginBoxMinSizeProperty(), &found); if (found) { - auto marginBoxBSize = finalSize.BSize(wm) + - aReflowInput.ComputedLogicalMargin().BStartEnd(wm); + auto marginBoxBSize = + finalSize.BSize(wm) + + aReflowInput.ComputedLogicalMargin(wm).BStartEnd(wm); auto overflow = marginBoxBSize - cbSize; if (overflow > 0) { auto contentBSize = finalSize.BSize(wm) - borderPadding.BStartEnd(wm); @@ -6648,7 +6649,7 @@ void nsBlockFrame::ReflowFloat(BlockReflowInput& aState, // Capture the margin and offsets information for the caller aFloatMargin = // float margins don't collapse - floatRS.ComputedLogicalMargin().ConvertTo(wm, floatRS.GetWritingMode()); + floatRS.ComputedLogicalMargin(wm); aFloatOffsets = floatRS.ComputedLogicalOffsets().ConvertTo(wm, floatRS.GetWritingMode()); @@ -7443,8 +7444,7 @@ void nsBlockFrame::ReflowOutsideMarker(nsIFrame* aMarkerFrame, WritingMode wm = ri.GetWritingMode(); // Get the ::marker's margin, converted to our writing mode so that we can // combine it with other logical values here. - LogicalMargin markerMargin = - reflowInput.ComputedLogicalMargin().ConvertTo(wm, markerWM); + LogicalMargin markerMargin = reflowInput.ComputedLogicalMargin(wm); nscoord iStart = floatAvailSpace.IStart(wm) - ri.ComputedLogicalBorderPadding().IStart(wm) - markerMargin.IEnd(wm) - aMetrics.ISize(wm); @@ -7641,8 +7641,7 @@ nsBlockFrame::ReplacedElementISizeToClear nsBlockFrame::ISizeToClearPastFloats( reflowInput.ComputedSizeWithBorderPadding().ConvertTo(wm, frWM).ISize(wm); // Use the margins from offsetState rather than reflowInput so that // they aren't reduced by ignoring margins in overconstrained cases. - LogicalMargin computedMargin = - offsetState.ComputedLogicalMargin().ConvertTo(wm, frWM); + LogicalMargin computedMargin = offsetState.ComputedLogicalMargin(wm); result.marginIStart = computedMargin.IStart(wm); return result; } diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 95ea3a25f7a2..19bf463a4d95 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -50,8 +50,7 @@ bool nsBlockReflowContext::ComputeCollapsedBStartMargin( WritingMode parentWM = mMetrics.GetWritingMode(); // Include block-start element of frame's margin - aMargin->Include( - aRI.ComputedLogicalMargin().ConvertTo(parentWM, wm).BStart(parentWM)); + aMargin->Include(aRI.ComputedLogicalMargin(parentWM).BStart(parentWM)); // The inclusion of the block-end margin when empty is done by the caller // since it doesn't need to be done by the top-level (non-recursive) @@ -59,7 +58,7 @@ bool nsBlockReflowContext::ComputeCollapsedBStartMargin( #ifdef NOISY_BLOCK_DIR_MARGINS aRI.mFrame->ListTag(stdout); - printf(": %d => %d\n", aRI.ComputedLogicalMargin().BStart(wm), + printf(": %d => %d\n", aRI.ComputedLogicalMargin(wm).BStart(wm), aMargin->get()); #endif @@ -170,10 +169,8 @@ bool nsBlockReflowContext::ComputeCollapsedBStartMargin( dirtiedLine = true; } if (isEmpty) { - WritingMode innerWM = innerReflowInput.GetWritingMode(); LogicalMargin innerMargin = - innerReflowInput.ComputedLogicalMargin().ConvertTo(parentWM, - innerWM); + innerReflowInput.ComputedLogicalMargin(parentWM); aMargin->Include(innerMargin.BEnd(parentWM)); } } @@ -265,10 +262,7 @@ void nsBlockReflowContext::ReflowBlock( // Compute inline/block coordinate where reflow will begin. Use the // rules from 10.3.3 to determine what to apply. At this point in the // reflow auto inline-start/end margins will have a zero value. - - WritingMode frameWM = aFrameRI.GetWritingMode(); - LogicalMargin usedMargin = - aFrameRI.ComputedLogicalMargin().ConvertTo(mWritingMode, frameWM); + LogicalMargin usedMargin = aFrameRI.ComputedLogicalMargin(mWritingMode); mICoord = mSpace.IStart(mWritingMode) + usedMargin.IStart(mWritingMode); mBCoord = mSpace.BStart(mWritingMode) + mBStartMargin.get() + aClearance; @@ -348,16 +342,14 @@ bool nsBlockReflowContext::PlaceBlock(const ReflowInput& aReflowInput, nsOverflowAreas& aOverflowAreas, const nsReflowStatus& aReflowStatus) { // Compute collapsed block-end margin value. - WritingMode wm = aReflowInput.GetWritingMode(); WritingMode parentWM = mMetrics.GetWritingMode(); // Don't apply the block-end margin if the block has a *later* sibling across // column-span split. if (aReflowStatus.IsComplete() && !mFrame->HasColumnSpanSiblings()) { aBEndMarginResult = mMetrics.mCarriedOutBEndMargin; - aBEndMarginResult.Include(aReflowInput.ComputedLogicalMargin() - .ConvertTo(parentWM, wm) - .BEnd(parentWM)); + aBEndMarginResult.Include( + aReflowInput.ComputedLogicalMargin(parentWM).BEnd(parentWM)); } else { // The used block-end-margin is set to zero before a break. aBEndMarginResult.Zero(); diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index 8702a4eb8b29..473408031246 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -750,7 +750,7 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, WritingMode kidWM = kidReflowInput.GetWritingMode(); nsSize containerSize = aReflowInput.ComputedPhysicalSize(); - LogicalMargin margin = kidReflowInput.ComputedLogicalMargin(); + LogicalMargin margin = kidReflowInput.ComputedLogicalMargin(kidWM); LogicalPoint kidPt(kidWM, margin.IStart(kidWM), margin.BStart(kidWM)); // Reflow the frame @@ -805,7 +805,7 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) { finalSize.BSize(wm) = kidFrame->GetLogicalSize(wm).BSize(wm) + - kidReflowInput.ComputedLogicalMargin().BStartEnd(wm); + kidReflowInput.ComputedLogicalMargin(wm).BStartEnd(wm); } else { finalSize.BSize(wm) = aReflowInput.ComputedBSize(); } diff --git a/layout/generic/nsColumnSetFrame.cpp b/layout/generic/nsColumnSetFrame.cpp index e7cd8511fe58..cbae879342fb 100644 --- a/layout/generic/nsColumnSetFrame.cpp +++ b/layout/generic/nsColumnSetFrame.cpp @@ -685,11 +685,9 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowChildren( // columns would flow around it. // Reflow the frame - LogicalPoint origin( - wm, - childOrigin.I(wm) + kidReflowInput.ComputedLogicalMargin().IStart(wm), - childOrigin.B(wm) + - kidReflowInput.ComputedLogicalMargin().BStart(wm)); + const auto childMargin = kidReflowInput.ComputedLogicalMargin(wm); + const LogicalPoint origin(wm, childOrigin.I(wm) + childMargin.IStart(wm), + childOrigin.B(wm) + childMargin.BStart(wm)); aStatus.Reset(); ReflowChild(child, PresContext(), kidDesiredSize, kidReflowInput, wm, origin, containerSize, ReflowChildFlags::Default, aStatus); diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 27e1cb3d2485..b14f450fa5f7 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1625,7 +1625,7 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize( const auto sizeInItemWM = aFlexItem.Frame()->ComputeSize( aItemReflowInput.mRenderingContext, itemWM, aItemReflowInput.mContainingBlockSize, availISize, - aItemReflowInput.ComputedLogicalMargin().Size(itemWM), + aItemReflowInput.ComputedLogicalMargin(itemWM).Size(itemWM), aItemReflowInput.ComputedLogicalBorderPadding().Size(itemWM), {ComputeSizeFlag::UseAutoISize, ComputeSizeFlag::ShrinkWrap}); @@ -2008,8 +2008,7 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput, float aFlexGrow, mBorderPadding( aFlexItemReflowInput.ComputedLogicalBorderPadding().ConvertTo(mCBWM, mWM)), - mMargin( - aFlexItemReflowInput.ComputedLogicalMargin().ConvertTo(mCBWM, mWM)), + mMargin(aFlexItemReflowInput.ComputedLogicalMargin(mCBWM)), mMainMinSize(aMainMinSize), mMainMaxSize(aMainMaxSize), mCrossMinSize(aCrossMinSize), diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index fe81b562cc5e..85fde361ea4b 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -5244,7 +5244,7 @@ static nscoord ContentContribution( // XXXdholbert This won't have percentage margins resolved. // Hopefully we can just avoid those for XUL-content-in-css-grid? - size += childRI.ComputedLogicalMargin().BStartEnd(childWM); + size += childRI.ComputedLogicalMargin(childWM).BStartEnd(childWM); } else { size = ::MeasuringReflow(child, aState.mReflowInput, aRC, availableSize, cbSize, iMinSizeClamp, bMinSizeClamp); diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index 505df7b3d82e..59fea8b5435e 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -10489,7 +10489,7 @@ void nsIFrame::BoxReflow(nsBoxLayoutState& aState, nsPresContext* aPresContext, reflowInput.SetComputedHeight( ComputeSize(aRenderingContext, wm, logicalSize, logicalSize.ISize(wm), - reflowInput.ComputedLogicalMargin().Size(wm), + reflowInput.ComputedLogicalMargin(wm).Size(wm), reflowInput.ComputedLogicalBorderPadding().Size(wm), {}) .mLogicalSize.Height(wm)); } diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 58018ac01482..20c681c2f81f 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -825,8 +825,7 @@ void nsLineLayout::ReflowFrame(nsIFrame* aFrame, nsReflowStatus& aReflowStatus, reflowInput.AvailableISize() = availableSpaceOnLine; } WritingMode stateWM = reflowInput.GetWritingMode(); - pfd->mMargin = - reflowInput.ComputedLogicalMargin().ConvertTo(lineWM, stateWM); + pfd->mMargin = reflowInput.ComputedLogicalMargin(lineWM); pfd->mBorderPadding = reflowInput.ComputedLogicalBorderPadding().ConvertTo(lineWM, stateWM); pfd->mRelativePos = diff --git a/layout/mathml/nsMathMLSelectedFrame.cpp b/layout/mathml/nsMathMLSelectedFrame.cpp index 9cae4db225e5..48cd8b7ca985 100644 --- a/layout/mathml/nsMathMLSelectedFrame.cpp +++ b/layout/mathml/nsMathMLSelectedFrame.cpp @@ -93,7 +93,7 @@ nsIFrame::SizeComputationResult nsMathMLSelectedFrame::ComputeSize( availableISize); auto size = childFrame->ComputeSize( aRenderingContext, aWM, cbSize, availableISize, - offsetState.ComputedLogicalMargin().Size(aWM), + offsetState.ComputedLogicalMargin(aWM).Size(aWM), offsetState.ComputedLogicalBorderPadding().Size(aWM), aFlags); return {size.mLogicalSize + offsetState.ComputedLogicalBorderPadding().Size(aWM), diff --git a/layout/tables/nsTableWrapperFrame.cpp b/layout/tables/nsTableWrapperFrame.cpp index 53f1fd0a51db..a959fe06fdee 100644 --- a/layout/tables/nsTableWrapperFrame.cpp +++ b/layout/tables/nsTableWrapperFrame.cpp @@ -245,7 +245,7 @@ void nsTableWrapperFrame::InitChildReflowInput(nsPresContext& aPresContext, if (!HasAnyStateBits(NS_FRAME_OUT_OF_FLOW)) { if (LogicalSize* cb = GetProperty(GridItemCBSizeProperty())) { cbSize.emplace(*cb); - *cbSize -= aOuterRI.ComputedLogicalMargin().Size(wm); + *cbSize -= aOuterRI.ComputedLogicalMargin(wm).Size(wm); } } if (!cbSize) { @@ -278,7 +278,7 @@ void nsTableWrapperFrame::GetChildMargin(nsPresContext* aPresContext, ReflowInput::InitFlag::CallerWillInit); InitChildReflowInput(*aPresContext, aOuterRI, childRI); - aMargin = childRI.ComputedLogicalMargin(); + aMargin = childRI.ComputedLogicalMargin(childRI.GetWritingMode()); } static nsSize GetContainingBlockSize(const ReflowInput& aOuterRI) { @@ -368,8 +368,7 @@ nscoord nsTableWrapperFrame::ChildShrinkWrapISize( SizeComputationInput offsets(aChildFrame, aRenderingContext, aWM, aCBSize.ISize(aWM)); - LogicalSize marginSize = - offsets.ComputedLogicalMargin().Size(childWM).ConvertTo(aWM, childWM); + LogicalSize marginSize = offsets.ComputedLogicalMargin(aWM).Size(aWM); LogicalSize bpSize = offsets.ComputedLogicalBorderPadding().Size(childWM).ConvertTo(aWM, childWM); @@ -392,7 +391,7 @@ nscoord nsTableWrapperFrame::ChildShrinkWrapISize( aChildFrame->ComputeSize(aRenderingContext, aWM, aCBSize, aAvailableISize, marginSize, bpSize, flags); if (aMarginResult) { - *aMarginResult = offsets.ComputedLogicalMargin().IStartEnd(aWM); + *aMarginResult = offsets.ComputedLogicalMargin(aWM).IStartEnd(aWM); } return size.mLogicalSize.ISize(aWM) + marginSize.ISize(aWM) + bpSize.ISize(aWM); @@ -883,7 +882,7 @@ void nsTableWrapperFrame::Reflow(nsPresContext* aPresContext, *captionMet, capStatus); captionSize.ISize(wm) = captionMet->ISize(wm); captionSize.BSize(wm) = captionMet->BSize(wm); - captionMargin = captionRI->ComputedLogicalMargin().ConvertTo(wm, captionWM); + captionMargin = captionRI->ComputedLogicalMargin(wm); // Now that we know the bsize of the caption, reduce the available bsize // for the table frame if we are bsize constrained and the caption is above // or below the inner table. Also reduce the CB size that we store for @@ -929,7 +928,7 @@ void nsTableWrapperFrame::Reflow(nsPresContext* aPresContext, OuterDoReflowChild(aPresContext, InnerTableFrame(), *innerRI, innerMet, aStatus); LogicalSize innerSize(wm, innerMet.ISize(wm), innerMet.BSize(wm)); - LogicalMargin innerMargin = innerRI->ComputedLogicalMargin(); + LogicalMargin innerMargin = innerRI->ComputedLogicalMargin(wm); LogicalSize containSize(wm, GetContainingBlockSize(aOuterRI));