Changed ComputeAvailSpaceRect() to handle the 'OccupiedMultiple' case

This commit is contained in:
troy 1998-05-29 23:05:12 +00:00
Родитель f4bdb23b32
Коммит 710593c695
6 изменённых файлов: 126 добавлений и 30 удалений

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

@ -50,20 +50,36 @@ void nsBlockBandData::ComputeAvailSpaceRect()
// If there's more than one trapezoid that means there are floaters
PRInt32 i;
// Stop when we get to space occupied by a right floater
// Stop when we get to space occupied by a right floater, or when we've
// looked at every trapezoid and none are right floaters
for (i = 0; i < count; i++) {
nsBandTrapezoid* trapezoid = &data[i];
if (trapezoid->state != nsBandTrapezoid::Available) {
nsStyleDisplay* display;
// XXX Handle the case of multiple frames
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {
PRInt32 numFrames = trapezoid->frames->Count();
NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");
for (PRInt32 i = 0; i < numFrames; i++) {
nsIFrame* f = (nsIFrame*)trapezoid->frames->ElementAt(i);
f->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
goto foundRightFloater;
}
}
} else {
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
}
}
}
}
foundRightFloater:
if (i > 0) {
trapezoid = &data[i - 1];

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

@ -50,20 +50,36 @@ void nsBlockBandData::ComputeAvailSpaceRect()
// If there's more than one trapezoid that means there are floaters
PRInt32 i;
// Stop when we get to space occupied by a right floater
// Stop when we get to space occupied by a right floater, or when we've
// looked at every trapezoid and none are right floaters
for (i = 0; i < count; i++) {
nsBandTrapezoid* trapezoid = &data[i];
if (trapezoid->state != nsBandTrapezoid::Available) {
nsStyleDisplay* display;
// XXX Handle the case of multiple frames
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {
PRInt32 numFrames = trapezoid->frames->Count();
NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");
for (PRInt32 i = 0; i < numFrames; i++) {
nsIFrame* f = (nsIFrame*)trapezoid->frames->ElementAt(i);
f->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
goto foundRightFloater;
}
}
} else {
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
}
}
}
}
foundRightFloater:
if (i > 0) {
trapezoid = &data[i - 1];

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

@ -50,20 +50,36 @@ void nsBlockBandData::ComputeAvailSpaceRect()
// If there's more than one trapezoid that means there are floaters
PRInt32 i;
// Stop when we get to space occupied by a right floater
// Stop when we get to space occupied by a right floater, or when we've
// looked at every trapezoid and none are right floaters
for (i = 0; i < count; i++) {
nsBandTrapezoid* trapezoid = &data[i];
if (trapezoid->state != nsBandTrapezoid::Available) {
nsStyleDisplay* display;
// XXX Handle the case of multiple frames
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {
PRInt32 numFrames = trapezoid->frames->Count();
NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");
for (PRInt32 i = 0; i < numFrames; i++) {
nsIFrame* f = (nsIFrame*)trapezoid->frames->ElementAt(i);
f->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
goto foundRightFloater;
}
}
} else {
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
}
}
}
}
foundRightFloater:
if (i > 0) {
trapezoid = &data[i - 1];

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

@ -50,20 +50,36 @@ void nsBlockBandData::ComputeAvailSpaceRect()
// If there's more than one trapezoid that means there are floaters
PRInt32 i;
// Stop when we get to space occupied by a right floater
// Stop when we get to space occupied by a right floater, or when we've
// looked at every trapezoid and none are right floaters
for (i = 0; i < count; i++) {
nsBandTrapezoid* trapezoid = &data[i];
if (trapezoid->state != nsBandTrapezoid::Available) {
nsStyleDisplay* display;
// XXX Handle the case of multiple frames
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {
PRInt32 numFrames = trapezoid->frames->Count();
NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");
for (PRInt32 i = 0; i < numFrames; i++) {
nsIFrame* f = (nsIFrame*)trapezoid->frames->ElementAt(i);
f->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
goto foundRightFloater;
}
}
} else {
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
}
}
}
}
foundRightFloater:
if (i > 0) {
trapezoid = &data[i - 1];

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

@ -50,20 +50,36 @@ void nsBlockBandData::ComputeAvailSpaceRect()
// If there's more than one trapezoid that means there are floaters
PRInt32 i;
// Stop when we get to space occupied by a right floater
// Stop when we get to space occupied by a right floater, or when we've
// looked at every trapezoid and none are right floaters
for (i = 0; i < count; i++) {
nsBandTrapezoid* trapezoid = &data[i];
if (trapezoid->state != nsBandTrapezoid::Available) {
nsStyleDisplay* display;
// XXX Handle the case of multiple frames
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {
PRInt32 numFrames = trapezoid->frames->Count();
NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");
for (PRInt32 i = 0; i < numFrames; i++) {
nsIFrame* f = (nsIFrame*)trapezoid->frames->ElementAt(i);
f->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
goto foundRightFloater;
}
}
} else {
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
}
}
}
}
foundRightFloater:
if (i > 0) {
trapezoid = &data[i - 1];

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

@ -50,20 +50,36 @@ void nsBlockBandData::ComputeAvailSpaceRect()
// If there's more than one trapezoid that means there are floaters
PRInt32 i;
// Stop when we get to space occupied by a right floater
// Stop when we get to space occupied by a right floater, or when we've
// looked at every trapezoid and none are right floaters
for (i = 0; i < count; i++) {
nsBandTrapezoid* trapezoid = &data[i];
if (trapezoid->state != nsBandTrapezoid::Available) {
nsStyleDisplay* display;
// XXX Handle the case of multiple frames
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
if (nsBandTrapezoid::OccupiedMultiple == trapezoid->state) {
PRInt32 numFrames = trapezoid->frames->Count();
NS_ASSERTION(numFrames > 0, "bad trapezoid frame list");
for (PRInt32 i = 0; i < numFrames; i++) {
nsIFrame* f = (nsIFrame*)trapezoid->frames->ElementAt(i);
f->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
goto foundRightFloater;
}
}
} else {
trapezoid->frame->GetStyleData(eStyleStruct_Display, (nsStyleStruct*&)display);
if (NS_STYLE_FLOAT_RIGHT == display->mFloats) {
break;
}
}
}
}
foundRightFloater:
if (i > 0) {
trapezoid = &data[i - 1];