Skip to content

An <li>'s number is drawn at the bottom of a leading <graph>, <image>, <video> or <figure> #1673

Description

@dqnykamp

Summary

When an <ol>/<ul> list item's first child is a block whose baseline is its bottom edge rather than its first line, the browser paints the item's native ::marker at the bottom of that box instead of beside its top. For a <graph> or an <image> that puts the number hundreds of pixels below where a reader expects it.

Measured in Chrome 150 by scanning the list gutter for the native marker (the technique in packages/test-cypress/cypress/e2e/tagSpecific/utils/listItemNumberAlignment.js), rows relative to the top of the <li>:

Leading child marker rows item height
<graph size="small"> 253–275 px 271 px
<image width="200px"> 237–259 px 255 px
<video width="320px"> 130–152 px 147 px
<figure> (holding a graph) 265–287 px 305 px
<matrixInput/> 20–42 px 46 px
<tabular> with a <p> in the first cell 39–61 px (content 19–41) 60 px
<p> (control) 0–21 px 22 px

Minimal repro — the number lands at the bottom of the graph:

<ol>
  <li><graph size="small"><point>(1,2)</point></graph></li>
</ol>

and the same with <image source="..." width="200px" />, <video youtube="..." width="320px" />, or a <figure>.

Notes

Split out of the review of #1671 rather than fixed there, since it touches unrelated renderers.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions