Empty inline element at the beginning of a list item adds a line box of nonzero height

UNCONFIRMED
Unassigned

Status

()

Core
Layout: Block and Inline
UNCONFIRMED
7 years ago
7 years ago

People

(Reporter: Bobby Jack, Unassigned)

Tracking

({testcase})

1.9.2 Branch
x86
Windows XP
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11

An extra line box is added above an element if that element has block display, inside an inline element, and that inline element is inside a list item.

Reproducible: Always

Actual Results:  
Such a list item has one extra leading line

Expected Results:  
Leading blank line should not be displayed

According to others (I have only tested on Gecko 1.9.2), this bug was present for Gecko 1.9.0, fixed for 1.9.1, and has regressed in both 1.9.2 and 2.0b.

Most other browsers do not exhibit this behaviour; Opera renders the bullet point in the wrong location, but does not add an extra line box.

This bug has been discussed in more detail on the css-discuss mailing list (http://archivist.incutio.com/viewlist/css-discuss/113864).
(Reporter)

Comment 1

7 years ago
Created attachment 497248 [details]
Simple test-case that exhibits the problem
(Reporter)

Updated

7 years ago
Version: unspecified → 1.9.2 Branch

Comment 2

7 years ago
A very rough regression range: 20090801-20090901.
This includes the patches for bug 179596.
Keywords: testcase
Opera has the same behavior.  And I believe this is the behavior called for by the CSS spec, but ccing dbaron to confirm.
In particular, the CSS spec requires that there be an inline line, followed by a block line, followed by an inline line.

And the spec 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.

which is what I think happens here: the marker's ascent affects the vertical alignment of the inline box and hence the height of the block's first line, making it nonzero.

Comment 5

7 years ago
Created attachment 497336 [details]
test case 2

(In reply to comment #3)
> Opera has the same behavior.  And I believe this is the behavior called for by
> the CSS spec, but ccing dbaron to confirm.

I don't think Opera has the same behaviour - rather the listmarker is misaligned.

Here is the OP's test case with added background colors - neither Opera nor WebKit show any red.
Resummarizing the bug to make it clear what this is really about.  The block being inside an inline is a detail; the same behavior differences are there if it just comes after the inline, as expected.  "test case 2" behaving identically to the testcase I'm about to attach is _definitely_ required by the CSS spec.
Summary: Block element within an inline element inside a list item adds an extraneous line box → Empty inline element at the beginning of a list item adds a line box of nonzero height
Created attachment 497349 [details]
test case 3; inline followed by block
You need to log in before you can comment on or make changes to this bug.