Do the same for PlaceBelowCurrentLineFloats: don't propagate the truncation of a float into the line's reflow status. (Bug 563584, patch 18) r=roc

This commit is contained in:
L. David Baron 2010-08-05 21:59:20 -07:00
Родитель 6d6cfe0a6c
Коммит 24f20193c5
3 изменённых файлов: 21 добавлений и 32 удалений

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

@ -4215,17 +4215,10 @@ nsBlockFrame::PlaceLine(nsBlockReflowState& aState,
// Any below current line floats to place?
if (aState.mBelowCurrentLineFloats.NotEmpty()) {
// Reflow the below-current-line floats, then add them to the
// lines float list if there aren't any truncated floats.
if (aState.PlaceBelowCurrentLineFloats(aState.mBelowCurrentLineFloats)) {
aLine->AppendFloats(aState.mBelowCurrentLineFloats);
}
else {
// At least one float is truncated, so fix up any placeholders that got split and
// push the line. XXX It may be better to put the float on the next line, but this
// is not common enough to justify the complexity. Or maybe it is now...
PushTruncatedPlaceholderLine(aState, aLine, *aKeepReflowGoing);
}
// Reflow the below-current-line floats, which places on the line's
// float list.
aState.PlaceBelowCurrentLineFloats(aState.mBelowCurrentLineFloats);
aLine->AppendFloats(aState.mBelowCurrentLineFloats);
}
// When a line has floats, factor them into the combined-area

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

@ -961,33 +961,29 @@ nsBlockReflowState::PushFloatPastBreak(nsIFrame *aFloat)
/**
* Place below-current-line floats.
*/
PRBool
void
nsBlockReflowState::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList)
{
nsFloatCache* fc = aList.Head();
while (fc) {
{
#ifdef DEBUG
if (nsBlockFrame::gNoisyReflow) {
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
printf("placing bcl float: ");
nsFrame::ListTag(stdout, fc->mFloat);
printf("\n");
}
#endif
// Place the float
nsReflowStatus reflowStatus;
PRBool placed = FlowAndPlaceFloat(fc->mFloat, reflowStatus);
if (!placed) {
// return before processing all of the floats, since the line will be pushed.
// FIXME: This seems like it should be handled elsewhere...
return PR_FALSE;
}
if (nsBlockFrame::gNoisyReflow) {
nsFrame::IndentBy(stdout, nsBlockFrame::gNoiseIndent);
printf("placing bcl float: ");
nsFrame::ListTag(stdout, fc->mFloat);
printf("\n");
}
fc = fc->Next();
#endif
// Place the float
nsReflowStatus reflowStatus;
PRBool placed = FlowAndPlaceFloat(fc->mFloat, reflowStatus);
nsFloatCache *next = fc->Next();
if (!placed) {
aList.Remove(fc);
delete fc;
}
fc = next;
}
return PR_TRUE;
}
nscoord

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

@ -117,7 +117,7 @@ public:
private:
void PushFloatPastBreak(nsIFrame* aFloat);
public:
PRBool PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aFloats);
void PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aFloats);
// Returns the first coordinate >= aY that clears the
// floats indicated by aBreakType and has enough width between floats