Make BR-related parts of the quirky inline box model also quirky in almost-standards mode, to match the rest of the inline box model quirks. b=161691 sr=bzbarsky r=caillon

This commit is contained in:
dbaron%fas.harvard.edu 2002-08-11 18:00:07 +00:00
Родитель 839c83ca5d
Коммит 6a85bf516a
6 изменённых файлов: 26 добавлений и 6 удалений

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

@ -141,7 +141,10 @@ BRFrame::Reflow(nsIPresContext* aPresContext,
// behave like a BR.
nsLineLayout* ll = aReflowState.mLineLayout;
if (ll) {
if ( ll->CanPlaceFloaterNow() || ll->InStrictMode() ) {
// Note that the compatibility mode check excludes AlmostStandards
// mode, since this is the inline box model. See bug 161691.
if ( ll->CanPlaceFloaterNow() ||
ll->GetCompatMode() == eCompatibility_FullStandards ) {
// If we can place a floater on the line now it means that the
// line is effectively empty (there may be zero sized compressed
// white-space frames on the line, but they are to be ignored).

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

@ -2461,7 +2461,9 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
yTop = pfd->mBounds.y - pfd->mMargin.top;
yBottom = yTop + logicalHeight;
}
if (!preMode && !InStrictMode() && !logicalHeight ) {
if (!preMode &&
GetCompatMode() != eCompatibility_FullStandards &&
!logicalHeight) {
// Check if it's a BR frame that is not alone on its line (it
// is given a height of zero to indicate this), and if so reset
// yTop and yBottom so that BR frames don't influence the line.

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

@ -215,11 +215,16 @@ public:
SetFlag(LL_LINEENDSINBR, aOn);
}
PRBool InStrictMode()
PRBool InStrictMode() const
{
return mCompatMode != eCompatibility_NavQuirks;
}
nsCompatibility GetCompatMode() const
{
return mCompatMode;
}
//----------------------------------------
// Inform the line-layout about the presence of a floating frame
// XXX get rid of this: use get-frame-type?

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

@ -141,7 +141,10 @@ BRFrame::Reflow(nsIPresContext* aPresContext,
// behave like a BR.
nsLineLayout* ll = aReflowState.mLineLayout;
if (ll) {
if ( ll->CanPlaceFloaterNow() || ll->InStrictMode() ) {
// Note that the compatibility mode check excludes AlmostStandards
// mode, since this is the inline box model. See bug 161691.
if ( ll->CanPlaceFloaterNow() ||
ll->GetCompatMode() == eCompatibility_FullStandards ) {
// If we can place a floater on the line now it means that the
// line is effectively empty (there may be zero sized compressed
// white-space frames on the line, but they are to be ignored).

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

@ -2461,7 +2461,9 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
yTop = pfd->mBounds.y - pfd->mMargin.top;
yBottom = yTop + logicalHeight;
}
if (!preMode && !InStrictMode() && !logicalHeight ) {
if (!preMode &&
GetCompatMode() != eCompatibility_FullStandards &&
!logicalHeight) {
// Check if it's a BR frame that is not alone on its line (it
// is given a height of zero to indicate this), and if so reset
// yTop and yBottom so that BR frames don't influence the line.

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

@ -215,11 +215,16 @@ public:
SetFlag(LL_LINEENDSINBR, aOn);
}
PRBool InStrictMode()
PRBool InStrictMode() const
{
return mCompatMode != eCompatibility_NavQuirks;
}
nsCompatibility GetCompatMode() const
{
return mCompatMode;
}
//----------------------------------------
// Inform the line-layout about the presence of a floating frame
// XXX get rid of this: use get-frame-type?