Skip to content

List item forces strict line height #38

@mstensho

Description

@mstensho

It seems that all browsers agree that list items disable the line height quirk [1] on ALL lines. I'm guessing this was added to make sure that there always be room for the list item marker, although that doesn't really explain why it should be like this on every line in the list item. Doing it on the first line (where the list item marker is) would have been good enough.

One implementation difference: Gecko triggers on HTML LI elements, while the others trigger on CSS display:list-item

Example:

<!-- quirks mode -->
<p>There should be a filled green square below, and no red.</p>
<div style="width:100px; height:100px; background:red;">
  <li style="line-height:50px; color:green; background:green;">
    <br>
    <div style="display:inline-block; width:1px; height:1px;"></div>
  </li>
</div>

Try changing from LI to DIV and observe the changes.

[1] https://quirks.spec.whatwg.org/#the-line-height-calculation-quirk

Metadata

Metadata

Assignees

No one assigned

    Labels

    interopImplementations are not interoperable with each other

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions