Closed Bug 403657 Opened 17 years ago Closed 17 years ago

[FIX]HTML list with empty second entry renders second line on top of first line

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: ville.pohjanheimo, Assigned: bzbarsky)

References

Details

(Keywords: regression, testcase)

Attachments

(3 files)

An un/ordered list renders incorrectly when the second entry is empty. ie. the HTML list:

1. Some text
2.
3.

renders with the first and second line partially over each other. Test case included with and ordered list. Same behaviour with an unordered list.

Tested with most recent build: Build identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b2pre) Gecko/2007111304 Minefield/3.0b2pre

2.0.0.9 doesn't have this problem.
Flags: blocking1.9?
Keywords: regression, testcase
+'ing w/ P4.  Dbaron, please adjust priority if needed.
Flags: blocking1.9? → blocking1.9+
Priority: -- → P4
Raised to P3; we had a lot of complaints when we had similar bugs in releases in the past.
Attached patch Proposed fixSplinter Review
We were actually placing the block parts of the list-items just fine.  But we were positioning the bullet with its baseline at the top of the list-item.  That doesn't really make much sense.  Either we should put the baseline at the bottom (hard, because we haven't computed final size yet) or we should just leave the bullet right below the top padding (what this patch does).

That's all in the case when the list items has no lines, of course; if it has one, we'll use its baseline.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #290848 - Flags: superreview?(dbaron)
Attachment #290848 - Flags: review?(dbaron)
Summary: HTML list with empty second entry renders second line on top of first line → [FIX]HTML list with empty second entry renders second line on top of first line
Target Milestone: --- → mozilla1.9 M10
Comment on attachment 290848 [details] [diff] [review]
Proposed fix

r+sr=dbaron.

I'm presuming the bullet influences the height of the first line if it needs to, so that this will guarantee the bullet doesn't overflow (unless, say, the bullet's text overflows its frame).

Though it almost seems like if a bullet contributes to the height of the block, it should be returned by GetFirstLineBaseline (or GetLastLineBaseline), even if the block is otherwise empty.  Maybe that deserves a followup bug?
Attachment #290848 - Flags: superreview?(dbaron)
Attachment #290848 - Flags: superreview+
Attachment #290848 - Flags: review?(dbaron)
Attachment #290848 - Flags: review+
(Or would that be an easy fix now?)
And a reftest would be good -- comparing a bullet on an empty block to a bullet next to an  , maybe?
Checked in, with reftest.

Filed bug 406512 on our IRC conversation.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
The reftest fails on Mac.  The empty <li>s are not as tall as the ones with an &nbsp; in them.  :(

I disabled it for now; not sure how to write a good reftest here...
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: