LibWeb: Tests for rendering lists and their ordinals

The following tests also expose bugs before this PR:
- Layout/input/ol-render-item-values.html: negative ordinal values
- Layout/input/ol-render-deep-hybrid-list-item-list.html: ordinals
  deep into the list owner subtree
This commit is contained in:
Manuel Zahariev 2025-05-10 11:55:42 -07:00 committed by Sam Atkins
commit 20546725be
Notes: github-actions[bot] 2025-06-16 11:46:20 +00:00
18 changed files with 761 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<body>
<ol id="ol-without-box" style="display:contents">
<!--
The list item owner will be the document; not "ol-without-box".
As a result, the list will be displayed as an ul.
FIXME: Ladybird paints MarkerPaintable... but without an actual marker. Firefox and Chrome show a minuscule bullet.
-->
<li>One</li>
<li>Two</li>
</ol>
</body>

View file

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<div id="list-item-owner">
<ol id="ol-without-box" style="display:contents">
<!--
The list item owner will be "list-item-owner"; not "ol-without-box".
As a result, the list will be displayed as an ul.
FIXME: Ladybird paints MarkerPaintable... but without an actual marker. Firefox and Chrome show a minuscule bullet.
-->
<li>One</li>
<li>Two</li>
</ol>
</div>
</html>

View file

@ -0,0 +1,5 @@
<!DOCTYPE html>
<body>
<li>One
<li>Two
</body>

View file

@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<ol>
<li>One</li>
<li value=22>Twenty-two</li>
<div>Ignore these</div>
<div>+A<div>+B<div>+C
<div style="display:list-item">Twenty-three</div>
</div></div></div>
<p>Ignore this paragraph</p>
<p><span>X<span>Y<span>Z
<li>Twenty-four</li>
</span></span></span>
<div>List item paragraph inside nested divs<div>2025
<p style="display:list-item">Twenty-five</p>
</div></div>
<li>Twenty-six</li>
<span style="display:list-item">Twenty-seven</span>
<li>Twenty-eight</li>
</ol>
</html>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<!--
Confirms MarkerPaintable sizes for reference list.
FIXME: Left alignment cuts into border.
-->
<body>
<ol start=7>
<li>Seven</li>
<li value="-112">Minus one hundred and twelve</li> <!-- Confirms negative ordinal -->
<li value="1024">Two to the power of ten</li>
<li value="11">Eleven</li>
</ol>
</body>

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<ol>
<li>One</li>
<li value=22>Twenty-two</li>
<div style="display:list-item">Twenty-three</div>
<li>Twenty-four</li>
<p style="display:list-item">Twenty-five</p>
<li>Twenty-six</li>
<span style="display:list-item">Twenty-seven</span>
<li>Twenty-eight</li>
</ol>
</html>

View file

@ -0,0 +1,20 @@
<!DOCTYPE html>
<head>
<!--
Confirms drawing a ul. Font size can be controlled so MarkerPaintable sizes should match reference.
FIXME: At some point, `::marker` should support `content`. https://drafts.csswg.org/css-content-3/#propdef-content
-->
<style>
.B li::marker { font-size: .5em; }
</style>
</head>
<body>
<ul class="A">
<li>Three</li>
<li>Four</li>
</ul>
<ul class="B">
<li>One</li>
<li>Two</li>
</ul>
</body>