mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 21:12:26 +00:00
LibWeb: Improve list item marker positioning and alpha/roman text
This commit is a three-parter that is hard to separate without breaking marker rendering: 1. Any marker style that results in a string, except for a literal string (e.g. `list-style-type: "@"`), should get the string ". " appended. We forgot to do this for the alpha and roman types. 2. Instead of using the "pixel size rounded up" from a font and adding an arbitrary 1 to that, we now use the exact pixel size for as long as possible to improve our vertical positioning of markers. 3. Instead of always adding a "default marker width" to the marker content width, we now only do this if we did not have text metrics available (i.e. the marker style is not a text type). This greatly improves horizontal positioning of text markers.
This commit is contained in:
parent
8142c311ec
commit
788d5368a7
Notes:
github-actions[bot]
2025-07-15 18:06:51 +00:00
Author: https://github.com/gmta
Commit: 788d5368a7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5454
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/kalenikaliaksandr ✅
26 changed files with 152 additions and 129 deletions
8
Tests/LibWeb/Ref/expected/ol-items-text-ref.html
Normal file
8
Tests/LibWeb/Ref/expected/ol-items-text-ref.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="../expected/ol-items-text-ref.html">
|
||||
<ol>
|
||||
<li style="list-style-type: 'a. '">Item lower-alpha</li>
|
||||
<li style="list-style-type: 'B. '">Item upper-alpha</li>
|
||||
<li style="list-style-type: 'iii. '">Item lower-roman</li>
|
||||
<li style="list-style-type: 'IV. '">Item upper-roman</li>
|
||||
</ol>
|
Loading…
Add table
Add a link
Reference in a new issue