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 208811 9cafd64208c31616df1df0f135d780edec36d77e
parent 208810 69910e2c2a5dd7389e8d4c14e49c0ceae2a30da2
child 208812 1724a6c073166de899ba7ce6cf97fa3c93fa8af0
child 208841 0ed32d9a42d67a72a18bfa13a95dd2123490c8bf
push id50021
push usersmontagu@mozilla.com
push dateSun, 05 Oct 2014 06:03:10 +0000
treeherdermozilla-inbound@9cafd64208c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjfkthame
bugs1067268
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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) {