Open Bug 54979 Opened 24 years ago Updated 2 years ago

marker box should be part of first line box (or should create one if block is text-less) (list-item ::marker) [LIST] [MARGIN-C] [INLINE-V]

Categories

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

defect

Tracking

()

People

(Reporter: ian, Unassigned)

References

(Blocks 2 open bugs)

Details

(4 keywords, Whiteboard: (py8ieh:need test cases))

Per CSS2, the bullet cause by a list-item should be the :before pseudo-element,
with a display value of 'marker'. This means the bullet should take part in the
inline box model, and in particular should be part of the first line box of the
associated block. If there is no such line box, it should create one.

See http://www.w3.org/TR/REC-CSS2/generate.html#q11

Here is a relevant excerpt:
#
# For the :before pseudo-element, the baseline of text in the marker box will 
# be vertically aligned with the baseline of text in the first line of content 
# in the principal box. If the principal box contains no text, the top outer 
# edge of the marker box will be aligned with the top outer edge of the 
# principal box. For the :after pseudo-element, the baseline of text in the 
# marker box will be vertically aligned with the baseline of text in the last 
# line of content in the principal box. If the principal box contains no text, 
# the bottom outer edge of the marker box will be aligned with the bottom outer 
# edge of the principal box. 
# 
# The height of a marker box is given by the 'line-height' property. 
# The :before (:after) marker box participates in the height calculation of the 
# principal box's first (last) line box. Thus, markers are aligned with the 
# first and last line of an element's content, even though the marker boxes 
# live in distinct line boxes. If no first or last line box exists in a 
# principal box, the marker box establishes its line box alone. 

We need to map list-item properties into :before as per the spec, by supporting
display:marker and making everything Just Work. This will then fix bug 50480
the Right Way.

When fixing this, the interpretation of 'marker-offset' I propose in bug 54644,
or a better interpretation chosen by the WG, should be used instead of the
specification's definition. See bug 54644 for details.

See also:
 related bug 39013: list-item marker disappears when using "position: relative;"
 invalid bug 38832: Nested List symbol renders on same line as parent symbol 
blocking bug 14983: 'display:marker' not supported
     dep bug 21562: List markers are not properly aligned
 related bug 50480: list-item marker of link list overlaps 
 related bug 54644: -moz-float-edge sucks, should be taken out and shot
Blocks: 21562, 38832, 39013
Depends on: 14983, 54644
QA Contact: petersen → py8ieh=bugzilla
Whiteboard: need test cases
Target Milestone: --- → Future
Keywords: ns601highrisk, mozilla0.9
Blocks: 63741
Keywords: qawanted
Whiteboard: need test cases → (py8ieh:need test cases)
Blocks: 98636
Build reassigning Buster's bugs to Marc.
Assignee: buster → attinasi
*** Bug 162170 has been marked as a duplicate of this bug. ***
.
Assignee: attinasi → block-and-inline
Component: Layout → Layout: Block & Inline
Priority: P3 → --
Target Milestone: Future → ---
Sorry if the following comment is irrelevant, but it looks like according to the
CSS2 spec
- http://www.w3.org/TR/REC-CSS2/generate.html#propdef-marker-offset -
vs. other elements, markers create a separate line box:

"While 'block' and 'inline' :before and :after content is part of the principal
box generated by the element, 'marker' content is formatted in an independent
marker box, outside the principal box. Marker boxes are formatted as a single
line (i.e., one line box), so they are not as flexible as floats."
Summary: marker box should be part of first line box (or should create one if block is text-less) [LIST] [MARGIN-C] [INLINE-V] (list-item marker-box) → marker box should be part of first line box (or should create one if block is text-less) (list-item ::marker)
Depends on: 205202
*** Bug 276971 has been marked as a duplicate of this bug. ***
Summary: marker box should be part of first line box (or should create one if block is text-less) (list-item ::marker) → marker box should be part of first line box (or should create one if block is text-less) (list-item ::marker) [LIST] [MARGIN-C] [INLINE-V]
Blocks: 179596
Linking to the current active bugs on this subject: display: marker won't be
implemented (https://bugzilla.mozilla.org/show_bug.cgi?id=14983) -- instead
mozilla will eventually "Support CSS3's ::marker pseudo element"
(https://bugzilla.mozilla.org/show_bug.cgi?id=205202).

When 205202 is fixed you'll have proper positioning, etc of the LI marker.
So, if there's a child block, it should really be associated with the first line of that in some cases.  I think the spec now even says which ones.

Note that this line box is needed so that functions like nsLayoutUtils::GetFirstLineBaseline and nsLayoutUtils::GetLastLineBaseline can align to the line created by the bullet (e.g., for an empty display:list-item element in a baseline-aligned table row or in an inline-block).
Blocks: 194831
Assignee: layout.block-and-inline → nobody
QA Contact: ian → layout.block-and-inline
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.