ladybird/Tests/LibWeb/Layout/expected/details-summary-default-ua-style.txt
Jelle Raaijmakers 115e5f42af LibWeb: Improve graphical list item marker positioning
While 788d5368a7 took care of better text
marker positioning, this improves graphical marker positioning instead.

By looking at how Firefox and Chrome render markers, it's clear that
there are three parts to positioning a graphical marker:

  * The containing space that the marker resides in;
  * The marker dimensions;
  * The distance between the marker and the start of the list item.

The space that the marker can be contained in, is the area to the left
of the list item with a height of the marker's line-height. The marker
dimensions are relative to the marker's font's pixel size: most of them
are a square at 35% of the font size, but the disclosure markers are
sized at 50% instead. Finally, the marker distance is always gauged at
50% of the font size.

So for example, a list item with `list-style-type: disc` and `font-size:
20px`, has 10px between its start and the right side of the marker, and
the marker's dimensions are 7x7.

The percentages I've chosen closely resemble how Firefox lays out its
list item markers.
2025-07-17 09:35:09 +01:00

22 lines
1.3 KiB
Text

Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <html> at (0,0) content-size 800x154 [BFC] children: not-inline
BlockContainer <body> at (8,8) content-size 784x138 children: not-inline
BlockContainer <details> at (68,68) content-size 664x18 children: not-inline
ListItemBox <summary> at (84,68) content-size 656x18 children: inline
frag 0 from TextNode start: 0, length: 5, rect: [84,68 36.84375x18] baseline: 13.796875
"hello"
ListItemMarkerBox <(anonymous)> at (68,73) content-size 8x8 children: not-inline
TextNode <#text>
BlockContainer <slot> at (68,86) content-size 664x0 children: not-inline
ViewportPaintable (Viewport<#document>) [0,0 800x600]
PaintableWithLines (BlockContainer<HTML>) [0,0 800x154]
PaintableWithLines (BlockContainer<BODY>) [8,8 784x138]
PaintableWithLines (BlockContainer<DETAILS>) [8,8 784x138]
PaintableWithLines (ListItemBox<SUMMARY>) [84,68 656x18]
MarkerPaintable (ListItemMarkerBox(anonymous)) [68,73 8x8]
TextPaintable (TextNode<#text>)
PaintableWithLines (BlockContainer<SLOT>) [68,86 664x0]
SC for Viewport<#document> [0,0 800x600] [children: 1] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x154] [children: 0] (z-index: auto)