diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 765330553698..779e9187246d 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -273,14 +273,6 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, aStatus = NS_FRAME_COMPLETE; WritingMode lineWM = aReflowState.mLineLayout->GetWritingMode(); - WritingMode frameWM = aReflowState.GetWritingMode(); - LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding(); - nscoord startEdge = borderPadding.IStart(frameWM); - nscoord endEdge = aReflowState.AvailableISize() - borderPadding.IEnd(frameWM); - - aReflowState.mLineLayout->BeginSpan(this, &aReflowState, - startEdge, endEdge, &mBaseline); - LogicalSize availSize(lineWM, aReflowState.AvailableWidth(), aReflowState.AvailableHeight()); @@ -339,6 +331,13 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, false, false, lineWM, containerWidth); } + WritingMode frameWM = aReflowState.GetWritingMode(); + LogicalMargin borderPadding = aReflowState.ComputedLogicalBorderPadding(); + nscoord startEdge = borderPadding.IStart(frameWM); + nscoord endEdge = aReflowState.AvailableISize() - borderPadding.IEnd(frameWM); + aReflowState.mLineLayout->BeginSpan(this, &aReflowState, + startEdge, endEdge, &mBaseline); + // Reflow pairs excluding any span nscoord pairsISize = ReflowPairs(aPresContext, aReflowState, rtcReflowStates, aStatus);