nsBlockFrame::ReflowFloatContinuations doesn't need anything in AddFloat other than FlowAndPlaceFloat. (Bug 563584, patch 14) r=roc

This commit is contained in:
L. David Baron 2010-08-05 21:59:19 -07:00
Родитель 511bf3905d
Коммит d4ad679a10
2 изменённых файлов: 10 добавлений и 12 удалений

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

@ -5750,7 +5750,7 @@ nsBlockFrame::ReflowFloatContinuations(nsBlockReflowState& aState,
// Reflow // Reflow
nsReflowStatus fStatus = NS_FRAME_COMPLETE; nsReflowStatus fStatus = NS_FRAME_COMPLETE;
aState.AddFloat(nsnull, f, aState.mContentArea.width, fStatus); aState.FlowAndPlaceFloat(f, fStatus);
if (!NS_FRAME_IS_FULLY_COMPLETE(fStatus)) { if (!NS_FRAME_IS_FULLY_COMPLETE(fStatus)) {
rv = SplitFloat(aState, f, fStatus); rv = SplitFloat(aState, f, fStatus);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);

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

@ -542,7 +542,8 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
nscoord aAvailableWidth, nscoord aAvailableWidth,
nsReflowStatus& aReflowStatus) nsReflowStatus& aReflowStatus)
{ {
NS_PRECONDITION(!aLineLayout || mBlock->end_lines() != mCurrentLine, "null ptr"); NS_PRECONDITION(aLineLayout, "must have line layout");
NS_PRECONDITION(mBlock->end_lines() != mCurrentLine, "null ptr");
NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW, NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW,
"aFloat must be an out-of-flow frame"); "aFloat must be an out-of-flow frame");
@ -570,11 +571,10 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
// don't let this one go on the current line, since that would violate // don't let this one go on the current line, since that would violate
// float ordering. // float ordering.
nsRect floatAvailableSpace = GetFloatAvailableSpace().mRect; nsRect floatAvailableSpace = GetFloatAvailableSpace().mRect;
if (!aLineLayout || if (mBelowCurrentLineFloats.IsEmpty() &&
(mBelowCurrentLineFloats.IsEmpty() && (aLineLayout->LineIsEmpty() ||
(aLineLayout->LineIsEmpty() || mBlock->ComputeFloatWidth(*this, floatAvailableSpace, aFloat)
mBlock->ComputeFloatWidth(*this, floatAvailableSpace, aFloat) <= aAvailableWidth)) {
<= aAvailableWidth))) {
nsFloatManager::SavedState floatManagerState; nsFloatManager::SavedState floatManagerState;
mFloatManager->PushState(&floatManagerState); mFloatManager->PushState(&floatManagerState);
@ -586,11 +586,9 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout,
nsRect availSpace(nsPoint(floatAvailSpace.mRect.x + BorderPadding().left, nsRect availSpace(nsPoint(floatAvailSpace.mRect.x + BorderPadding().left,
mY), mY),
floatAvailSpace.mRect.Size()); floatAvailSpace.mRect.Size());
if (aLineLayout) { aLineLayout->UpdateBand(availSpace, aFloat);
aLineLayout->UpdateBand(availSpace, aFloat); // Record this float in the current-line list
// Record this float in the current-line list mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat));
mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat));
}
} }
else { else {
if (placed) { if (placed) {