Bug 1083104 - Fix misuse of physical instead of logical dimension for line breaking. r=smontagu
authorJonathan Kew <jkew@mozilla.com>
Thu, 16 Oct 2014 09:40:20 +0100
changeset 210693 0a7825c642ffb0c799a6ceb9d11fcbb7e5c74f8d
parent 210692 57ba7ce96c4a340a5a5598a0ce3bc332f0176b5a
child 210694 391d8113994a7ce395d815e286665e5d16d2016e
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerssmontagu
bugs1083104
milestone36.0a1
Bug 1083104 - Fix misuse of physical instead of logical dimension for line breaking. r=smontagu
layout/generic/nsLineLayout.cpp
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -308,18 +308,18 @@ nsLineLayout::UpdateBand(const nsRect& a
   nscoord deltaICoord = availSpace.IStart(lineWM) - mRootSpan->mIStart;
   // The width of all spans changes by this much (the root span's
   // mIEnd moves to aICoord + aISize, its new width is aISize)
   nscoord deltaISize = availSpace.ISize(lineWM) -
                        (mRootSpan->mIEnd - mRootSpan->mIStart);
 #ifdef NOISY_REFLOW
   nsFrame::ListTag(stdout, mBlockReflowState->frame);
   printf(": UpdateBand: %d,%d,%d,%d deltaISize=%d deltaICoord=%d\n",
-         aNewAvailSpace.x, aNewAvailSpace.y,
-         aNewAvailSpace.width, aNewAvailSpace.height, deltaISize, deltaICoord);
+         aNewAvailSpace.IStart(lineWM), aNewAvailSpace.BStart(lineWM),
+         aNewAvailSpace.ISize(lineWM), aNewAvailSpace.BSize(lineWM), deltaISize, deltaICoord);
 #endif
 
   // Update the root span position
   mRootSpan->mIStart += deltaICoord;
   mRootSpan->mIEnd += deltaICoord;
   mRootSpan->mICoord += deltaICoord;
 
   // Now update the right edges of the open spans to account for any
@@ -790,18 +790,19 @@ nsLineLayout::ReflowFrame(nsIFrame* aFra
     // For now, set the available block-size to unconstrained always.
     LogicalSize availSize = mBlockReflowState->ComputedSize(frameWM);
     availSize.BSize(frameWM) = NS_UNCONSTRAINEDSIZE;
     reflowStateHolder.emplace(mPresContext, *psd->mReflowState,
                               aFrame, availSize);
     nsHTMLReflowState& reflowState = *reflowStateHolder;
     reflowState.mLineLayout = this;
     reflowState.mFlags.mIsTopOfPage = mIsTopOfPage;
-    if (reflowState.ComputedWidth() == NS_UNCONSTRAINEDSIZE)
-      reflowState.AvailableWidth() = availableSpaceOnLine;
+    if (reflowState.ComputedISize() == NS_UNCONSTRAINEDSIZE) {
+      reflowState.AvailableISize() = availableSpaceOnLine;
+    }
     WritingMode stateWM = reflowState.GetWritingMode();
     pfd->mMargin =
       reflowState.ComputedLogicalMargin().ConvertTo(frameWM, stateWM);
     pfd->mBorderPadding =
       reflowState.ComputedLogicalBorderPadding().ConvertTo(frameWM, stateWM);
     pfd->SetFlag(PFD_RELATIVEPOS,
                  reflowState.mStyleDisplay->IsRelativelyPositionedStyle());
     if (pfd->GetFlag(PFD_RELATIVEPOS)) {