Bug 1067268: don't mix physical and logical coordinates when calculating width to clear past floats, r=jfkthame
--- 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) {