summaryrefslogtreecommitdiff
path: root/Base/res/html
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-03-24 16:38:34 +0000
committerAndreas Kling <kling@serenityos.org>2022-03-24 18:08:45 +0100
commitc914e732d2e3b701ebb60c0bf5309656c4820e60 (patch)
tree249b33fb8b1b94713cd7353c5a8b5e252d4b03b8 /Base/res/html
parent5aad32b5042ebd3fedc8f0d0dc5871d78a7ac6c5 (diff)
downloadserenity-c914e732d2e3b701ebb60c0bf5309656c4820e60.zip
LibWeb+Base: Fix `An+B of foo` parsing
When I wrote the An+B parser, it was guaranteed to have no non-whitespace tokens after it. This is no longer true with the `of foo` syntax, so this patch corrects the logic when there is no `+B` segment. This makes this case shown on Twitter work correctly. :^) https://twitter.com/simevidas/status/1506657566012678151
Diffstat (limited to 'Base/res/html')
-rw-r--r--Base/res/html/misc/nth-child.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/Base/res/html/misc/nth-child.html b/Base/res/html/misc/nth-child.html
index 5413202a09..11865fde4b 100644
--- a/Base/res/html/misc/nth-child.html
+++ b/Base/res/html/misc/nth-child.html
@@ -52,6 +52,9 @@
.acid3 > div:nth-child(-5n+3) {
background-color: lightblue;
}
+ .test-of-type > div:nth-child(2n of div) {
+ background-color: lightblue;
+ }
.test-of > div:nth-child(3n+1 of .special) {
background-color: lightblue;
}
@@ -191,6 +194,22 @@
<div>15</div>
</div>
+<h4>:nth-child(2n of div)</h4>
+<div class="test-of-type">
+ <div>1</div>
+ <p>Paragraph</p>
+ <div>2 +</div>
+ <p>Paragraph</p>
+ <div>3</div>
+ <p>Paragraph</p>
+ <div>4 +</div>
+ <p>Paragraph</p>
+ <div>5</div>
+ <p>Paragraph</p>
+ <div>6 +</div>
+ <p>Paragraph</p>
+</div>
+
<h4>:nth-child(3n+1 of .special)</h4>
<div class="test-of">
<div class="special">1 +</div>