зеркало из https://github.com/mozilla/pjs.git
Fix to fix for bug 134580: quirks mode line height must ignore all whitespace at the beginning of the line, not just what happens to be in the first text node. b=134580 sr=waterson r=attinasi
This commit is contained in:
Родитель
6697a1d49c
Коммит
1dc5cd043f
|
@ -2247,6 +2247,8 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||
// since this code sets zeroEffectiveSpanBox even when there are
|
||||
// non-empty children.
|
||||
PRBool zeroEffectiveSpanBox = PR_FALSE;
|
||||
// XXXldb If we really have empty continuations, then all these other
|
||||
// checks don't make sense for them.
|
||||
if ((emptyContinuation || !InStrictMode()) &&
|
||||
((psd == mRootSpan) ||
|
||||
((0 == spanFramePFD->mBorderPadding.top) &&
|
||||
|
@ -2267,11 +2269,8 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||
// mode) we don't want big line heights for things like
|
||||
// <p><font size="-1">Text</font></p>
|
||||
|
||||
// Don't count the first frame if it's only whitespace. (Somehow
|
||||
// the last frame, if whitespace, is already ignored. So we're not
|
||||
// quite compatible with Nav4.x, but it's probably good that we're
|
||||
// ignoring the last frame. Still, I wonder where the code is
|
||||
// that's doing it.) See bug 134580.
|
||||
// Don't include any initial whitespace, unless we're preformatted.
|
||||
// See bug 134580.
|
||||
PRUint32 flag = preMode ? PFD_ISTEXTFRAME : PFD_ISNONWHITESPACETEXTFRAME;
|
||||
zeroEffectiveSpanBox = PR_TRUE;
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
|
@ -2279,9 +2278,18 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||
zeroEffectiveSpanBox = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
// The line could begin with multiple all-whitespace text frames,
|
||||
// and we need to ignore all of them, including those contained
|
||||
// within other inline frames.
|
||||
if (flag != PFD_ISTEXTFRAME) {
|
||||
PRBool empty;
|
||||
pfd->mFrame->IsEmpty(PR_TRUE, preMode, &empty);
|
||||
if (!empty) {
|
||||
flag = PFD_ISTEXTFRAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
psd->mZeroEffectiveSpanBox = zeroEffectiveSpanBox;
|
||||
|
||||
// Setup baselineY, minY, and maxY
|
||||
|
|
|
@ -2247,6 +2247,8 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||
// since this code sets zeroEffectiveSpanBox even when there are
|
||||
// non-empty children.
|
||||
PRBool zeroEffectiveSpanBox = PR_FALSE;
|
||||
// XXXldb If we really have empty continuations, then all these other
|
||||
// checks don't make sense for them.
|
||||
if ((emptyContinuation || !InStrictMode()) &&
|
||||
((psd == mRootSpan) ||
|
||||
((0 == spanFramePFD->mBorderPadding.top) &&
|
||||
|
@ -2267,11 +2269,8 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||
// mode) we don't want big line heights for things like
|
||||
// <p><font size="-1">Text</font></p>
|
||||
|
||||
// Don't count the first frame if it's only whitespace. (Somehow
|
||||
// the last frame, if whitespace, is already ignored. So we're not
|
||||
// quite compatible with Nav4.x, but it's probably good that we're
|
||||
// ignoring the last frame. Still, I wonder where the code is
|
||||
// that's doing it.) See bug 134580.
|
||||
// Don't include any initial whitespace, unless we're preformatted.
|
||||
// See bug 134580.
|
||||
PRUint32 flag = preMode ? PFD_ISTEXTFRAME : PFD_ISNONWHITESPACETEXTFRAME;
|
||||
zeroEffectiveSpanBox = PR_TRUE;
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
|
@ -2279,9 +2278,18 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
|
|||
zeroEffectiveSpanBox = PR_FALSE;
|
||||
break;
|
||||
}
|
||||
// The line could begin with multiple all-whitespace text frames,
|
||||
// and we need to ignore all of them, including those contained
|
||||
// within other inline frames.
|
||||
if (flag != PFD_ISTEXTFRAME) {
|
||||
PRBool empty;
|
||||
pfd->mFrame->IsEmpty(PR_TRUE, preMode, &empty);
|
||||
if (!empty) {
|
||||
flag = PFD_ISTEXTFRAME;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
psd->mZeroEffectiveSpanBox = zeroEffectiveSpanBox;
|
||||
|
||||
// Setup baselineY, minY, and maxY
|
||||
|
|
Загрузка…
Ссылка в новой задаче