Bug 1067268: don't mix physical and logical coordinates when calculating width to clear past floats, r=jfkthame
authorSimon Montagu <smontagu@smontagu.org>
Sat, 04 Oct 2014 23:03:00 -0700
changeset 208837 9cafd64208c31616df1df0f135d780edec36d77e
parent 208836 69910e2c2a5dd7389e8d4c14e49c0ceae2a30da2
child 208838 0ed32d9a42d67a72a18bfa13a95dd2123490c8bf
child 208893 1724a6c073166de899ba7ce6cf97fa3c93fa8af0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjfkthame
bugs1067268
milestone35.0a1
Bug 1067268: don't mix physical and logical coordinates when calculating width to clear past floats, r=jfkthame
layout/generic/nsBlockReflowState.cpp
--- a/layout/generic/nsBlockReflowState.cpp
+++ b/layout/generic/nsBlockReflowState.cpp
@@ -987,16 +987,17 @@ nsBlockReflowState::ClearFloats(nscoord 
   mFloatManager->List(stdout);
 #endif
 
   if (!mFloatManager->HasAnyFloats()) {
     return aBCoord;
   }
 
   nscoord newBCoord = aBCoord;
+  WritingMode wm = mReflowState.GetWritingMode();
 
   if (aBreakType != NS_STYLE_CLEAR_NONE) {
     newBCoord = mFloatManager->ClearFloats(newBCoord, aBreakType, aFlags);
   }
 
   if (aReplacedBlock) {
     for (;;) {
       nsFlowAreaRect floatAvailableSpace = GetFloatAvailableSpace(newBCoord);
@@ -1004,22 +1005,24 @@ nsBlockReflowState::ClearFloats(nscoord 
         // If there aren't any floats here, then we always fit.
         // We check this before calling WidthToClearPastFloats, which is
         // somewhat expensive.
         break;
       }
       nsBlockFrame::ReplacedElementWidthToClear replacedWidth =
         nsBlockFrame::WidthToClearPastFloats(*this, floatAvailableSpace.mRect,
                                              aReplacedBlock);
-      if (std::max(floatAvailableSpace.mRect.x - ContentIStart(),
+      if (std::max(floatAvailableSpace.mRect.x -
+                    mContentArea.X(wm, mContainerWidth),
                    replacedWidth.marginLeft) +
             replacedWidth.borderBoxWidth +
-            std::max(ContentIEnd() - floatAvailableSpace.mRect.XMost(),
+            std::max(mContentArea.XMost(wm, mContainerWidth) -
+                      floatAvailableSpace.mRect.XMost(),
                      replacedWidth.marginRight) <=
-          ContentISize()) {
+          mContentArea.Width(wm)) {
         break;
       }
       // See the analogous code for inlines in nsBlockFrame::DoReflowInlineFrames
       if (floatAvailableSpace.mRect.height > 0) {
         // See if there's room in the next band.
         newBCoord += floatAvailableSpace.mRect.height;
       } else {
         if (mReflowState.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {