Bug 1067268 - Don't mix physical and logical coordinates when calculating width to clear past floats. r=jfkthame, a=lmandel
authorSimon Montagu <smontagu@smontagu.org>
Sat, 04 Oct 2014 23:03:00 -0700
changeset 225710 29dd7b8ee41f
parent 225709 4f904d9bcff2
child 225711 31fc68be9136
push id3988
push userryanvm@gmail.com
push date2014-10-17 01:37 +0000
treeherdermozilla-beta@c3fa7201e034 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame, lmandel
bugs1067268
milestone34.0
Bug 1067268 - Don't mix physical and logical coordinates when calculating width to clear past floats. r=jfkthame, a=lmandel
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) {