Open Bug 629352 Opened 13 years ago Updated 2 years ago

OL lists apply line-height inconsistently

Categories

(Core :: Layout: Block and Inline, defect)

x86
All
defect

Tracking

()

People

(Reporter: zinckiwi, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b10) Gecko/20100101 Firefox/4.0b10
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b10) Gecko/20100101 Firefox/4.0b10

For OL lists, line-heights below the default are not applied.

Reproducible: Always

Steps to Reproduce:
1. Set a line-height on an OL list at a value below 'normal'.

Actual Results:  
The line-height of the list does not drop below the value of 'normal'.

Expected Results:  
The line-height should be honored, even if below 'normal'.

Tried explicitly setting the line-height on 'li' as well as using '!important' on line-height directives for both 'ol' and 'li'; neither had any effect. No apparent workaround that I could find.
Attached file Test case HTML file.
Seeing this with Mozilla/5.0 (Windows NT 5.1; rv:2.0b11pre) Gecko/20110127 Firefox/4.0b11pre ID:20110127030333
Component: General → Layout: Block and Inline
Keywords: testcase
OS: Mac OS X → All
Product: Firefox → Core
QA Contact: general → layout.block-and-inline
Whiteboard: dupeme
Version: unspecified → Trunk
Per CSS2.1, this is invalid, as far as I can tell.  If you make your window narrow enough, you will see that the small line-height setting is affecting all the lines of the list item except the first line.  And the reason it doesn't affect the first line is because these are outside list markers, and the spec at http://www.w3.org/TR/CSS21/generate.html#propdef-list-style-position says:

  The size or contents of the marker box may affect the height of the principal
  block box and/or the height of its first line box

In particular, we make the first line's box tall enough for the marker.  This happens to be taller than the strut that line-height inserts, so the line ends up taller than the specified line-height.

Per the CSS3 Lists draft, I'm not sure.  That specifies that the marker box is an inline-block.  Presumably it would inherit line-height from the block, right?  In that case its height for vertical-alignment purposes should be equal to the line height, I'd think.
This bug, as accurately reported by Scott Gould, 2011.01.27, is still alive in Firefox major version 8.0.  It seems to be a carryover from the incorrectly written standard in CSS2.1.
Seems like what css3-lists suggests is the right thing here.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: dupeme
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: