diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 8539001f309e..87c6baaa9077 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2731,12 +2731,12 @@ nsBlockFrame::PullFrameFrom(nsLineBox* aLine, void nsBlockFrame::SlideLine(nsBlockReflowState& aState, - nsLineBox* aLine, nscoord aDY) + nsLineBox* aLine, nscoord aDeltaBCoord) { - NS_PRECONDITION(aDY != 0, "why slide a line nowhere?"); + NS_PRECONDITION(aDeltaBCoord != 0, "why slide a line nowhere?"); // Adjust line state - aLine->SlideBy(aDY, aState.mContainerWidth); + aLine->SlideBy(aDeltaBCoord, aState.mContainerWidth); // Adjust the frames in the line nsIFrame* kid = aLine->mFirstChild; @@ -2744,23 +2744,27 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState, return; } + WritingMode wm = GetWritingMode(); + nsPoint physicalDelta = + LogicalPoint(wm, 0, aDeltaBCoord).GetPhysicalPoint(wm, 0); + if (aLine->IsBlock()) { - if (aDY) { - kid->MovePositionBy(nsPoint(0, aDY)); + if (aDeltaBCoord) { + kid->MovePositionBy(physicalDelta); } // Make sure the frame's view and any child views are updated nsContainerFrame::PlaceFrameView(kid); } else { - // Adjust the Y coordinate of the frames in the line. - // Note: we need to re-position views even if aDY is 0, because + // Adjust the block-dir coordinate of the frames in the line. + // Note: we need to re-position views even if aDeltaBCoord is 0, because // one of our parent frames may have moved and so the view's position - // relative to its parent may have changed + // relative to its parent may have changed. int32_t n = aLine->GetChildCount(); while (--n >= 0) { - if (aDY) { - kid->MovePositionBy(nsPoint(0, aDY)); + if (aDeltaBCoord) { + kid->MovePositionBy(physicalDelta); } // Make sure the frame's view and any child views are updated nsContainerFrame::PlaceFrameView(kid); diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 72b13783d9f0..f3c5b2d012bb 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -408,11 +408,11 @@ protected: mState |= aFlags; } - /** move the frames contained by aLine by aDY + /** move the frames contained by aLine by aDeltaBCoord * if aLine is a block, its child floats are added to the state manager */ void SlideLine(nsBlockReflowState& aState, - nsLineBox* aLine, nscoord aDY); + nsLineBox* aLine, nscoord aDeltaBCoord); void ComputeFinalSize(const nsHTMLReflowState& aReflowState, nsBlockReflowState& aState,