Don't push floats past break due to total lack of available height when we're required to place something. (Bug 586973) r=roc a2.0=blocking

This commit is contained in:
L. David Baron 2010-08-19 09:38:00 -04:00
Родитель 750b5eeb63
Коммит 57f05d17a4
3 изменённых файлов: 21 добавлений и 3 удалений

Просмотреть файл

@ -0,0 +1,9 @@
<html>
<head>
<style>
hr::before { content:"b"; float:right;}
</style>
</head>
<body>
<hr style="-moz-column-count: 1;">
</html>

Просмотреть файл

@ -332,3 +332,4 @@ load 585598-1.xhtml
load 586806-1.html
load 586806-2.html
load 586806-3.html
load 586973-1.html

Просмотреть файл

@ -690,9 +690,16 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
// Can the float fit here?
PRBool keepFloatOnSameLine = PR_FALSE;
// Are we required to place at least part of the float because we're
// at the top of the page (to avoid an infinite loop of pushing and
// breaking).
PRBool mustPlaceFloat =
mReflowState.mFlags.mIsTopOfPage && IsAdjacentWithTop();
for (;;) {
if (mReflowState.availableHeight != NS_UNCONSTRAINEDSIZE &&
floatAvailableSpace.mRect.height <= 0) {
floatAvailableSpace.mRect.height <= 0 &&
!mustPlaceFloat) {
// No space, nowhere to put anything.
PushFloatPastBreak(aFloat);
return PR_FALSE;
@ -759,6 +766,8 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
adjustedAvailableSpace.width,
aFloat, offsets);
}
mustPlaceFloat = PR_FALSE;
}
// If the float is continued, it will get the same absolute x value as its prev-in-flow
@ -810,8 +819,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
// do the same.
if ((mContentArea.height != NS_UNCONSTRAINEDSIZE &&
adjustedAvailableSpace.height == NS_UNCONSTRAINEDSIZE &&
(!mReflowState.mFlags.mIsTopOfPage || !IsAdjacentWithTop() ||
pushedDown) &&
!mustPlaceFloat &&
aFloat->GetSize().height + floatMargin.TopBottom() >
mContentArea.YMost() - floatY) ||
NS_FRAME_IS_TRUNCATED(reflowStatus)) {