Don't position bullets on empty list items too high. Bug 403657, r+sr=dbaron

This commit is contained in:
bzbarsky@mit.edu 2007-12-02 21:33:22 -08:00
parent 9a66c4091f
commit ee48eb1bf9
4 changed files with 32 additions and 10 deletions

View File

@ -1081,9 +1081,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
ReflowBullet(state, metrics);
nscoord baseline;
if (!nsLayoutUtils::GetFirstLineBaseline(this, &baseline)) {
baseline = 0;
}
if (nsLayoutUtils::GetFirstLineBaseline(this, &baseline)) {
// We have some lines to align the bullet with.
// Doing the alignment using the baseline will also cater for
// bullets that are placed next to a child block (bug 92896)
@ -1093,6 +1092,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
bbox.y = baseline - metrics.ascent;
mBullet->SetRect(bbox);
}
// Otherwise just leave the bullet where it is, up against our top padding.
}
// Compute our final size
ComputeFinalSize(aReflowState, state, aMetrics);

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<body
<ol>
<li>Some text</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
</ol>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<body
<ol>
<li>Some text</li>
<li></li>
<li></li>
</ol>
</body>
</html>

View File

@ -471,6 +471,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
== 403656-3.html 403656-3-ref.html
== 403656-4.html 403656-4-ref.html
== 403656-5.html 403656-5-ref.html
== 403657-1.html 403657-1-ref.html
== 403733-1.html 403733-1-ref.html
== 403962-1.xhtml 403962-1-ref.xhtml
== 404030-1.html 404030-1-ref.html