mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-27 11:19:36 +00:00
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.
29 lines
1.7 KiB
Text
29 lines
1.7 KiB
Text
Viewport <#document> at (0,0) content-size 800x600 children: not-inline
|
|
BlockContainer <html> at (0,0) content-size 800x52 [BFC] children: not-inline
|
|
BlockContainer <body> at (8,8) content-size 784x36 children: not-inline
|
|
BlockContainer <div> at (8,8) content-size 784x36 children: not-inline
|
|
BlockContainer <(anonymous)> at (8,8) content-size 784x18 children: inline
|
|
frag 0 from TextNode start: 0, length: 11, rect: [8,8 83.265625x18] baseline: 13.796875
|
|
"Filler text"
|
|
TextNode <#text>
|
|
ListItemBox <(anonymous)> at (24,26) content-size 768x18 children: inline
|
|
frag 0 from TextNode start: 0, length: 11, rect: [24,26 88.703125x18] baseline: 13.796875
|
|
"Filler Text"
|
|
ListItemMarkerBox <(anonymous)> at (10,32) content-size 6x6 children: not-inline
|
|
TextNode <#text>
|
|
BlockContainer <(anonymous)> at (8,44) content-size 784x0 children: inline
|
|
TextNode <#text>
|
|
|
|
ViewportPaintable (Viewport<#document>) [0,0 800x600]
|
|
PaintableWithLines (BlockContainer<HTML>) [0,0 800x52]
|
|
PaintableWithLines (BlockContainer<BODY>) [8,8 784x36]
|
|
PaintableWithLines (BlockContainer<DIV>) [8,8 784x36]
|
|
PaintableWithLines (BlockContainer(anonymous)) [8,8 784x18]
|
|
TextPaintable (TextNode<#text>)
|
|
PaintableWithLines (ListItemBox(anonymous)) [24,26 768x18]
|
|
MarkerPaintable (ListItemMarkerBox(anonymous)) [10,32 6x6]
|
|
TextPaintable (TextNode<#text>)
|
|
PaintableWithLines (BlockContainer(anonymous)) [8,44 784x0]
|
|
|
|
SC for Viewport<#document> [0,0 800x600] [children: 1] (z-index: auto)
|
|
SC for BlockContainer<HTML> [0,0 800x52] [children: 0] (z-index: auto)
|