diff options
author | bptato <nincsnevem662@gmail.com> | 2024-12-17 18:41:49 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-12-17 18:41:49 +0100 |
commit | 340042ea464c7b9e0eec6ff7ffb7839eb927ad62 (patch) | |
tree | f30bf68edc9492e52a605b6bdf8fb2b63cad5828 /test/layout | |
parent | 60d22e5c6106ef36202bdfa236a6461a2561dacd (diff) | |
download | chawan-340042ea464c7b9e0eec6ff7ffb7839eb927ad62.tar.gz |
dom, match: optimize :nth-child, :nth-last-child
I want to use it in the UA sheet, so the loop won't cut it. (Also fix a parsing bug that prevented "of" from working.)
Diffstat (limited to 'test/layout')
-rw-r--r-- | test/layout/nth-child.color.expected | 31 | ||||
-rw-r--r-- | test/layout/nth-child.html | 60 |
2 files changed, 91 insertions, 0 deletions
diff --git a/test/layout/nth-child.color.expected b/test/layout/nth-child.color.expected new file mode 100644 index 00000000..de99ff28 --- /dev/null +++ b/test/layout/nth-child.color.expected @@ -0,0 +1,31 @@ + +[48;2;0;0;0m [38;2;255;40;40m• test[39m [49m +[48;2;0;0;0m [38;2;88;87;255m• test[39m [49m +[48;2;0;0;0m [38;2;41;169;42m• test[39m [49m +[48;2;0;0;0m [38;2;88;87;255m• test[39m [49m +[48;2;0;0;0m [38;2;41;169;42m• test[39m [49m +[48;2;0;0;0m [49m +[48;2;0;0;0m [38;2;255;192;203m• test[39m [49m +[48;2;0;0;0m [38;2;240;248;255m• test[39m [49m +[48;2;0;0;0m [38;2;0;255;0m• test[39m [49m +[48;2;0;0;0m [38;2;240;248;255m• test[39m [49m +[48;2;0;0;0m [38;2;0;255;0m• test[39m [49m +[48;2;0;0;0m [49m +[48;2;0;0;0m [38;2;41;169;42m1. test[39m [49m +[48;2;0;0;0m [38;2;88;87;255m2. test[39m [49m +[48;2;0;0;0m [38;2;41;169;42m3. test[39m [49m +[48;2;0;0;0m [38;2;88;87;255m4. test[39m [49m +[48;2;0;0;0m [38;2;255;40;40m5. test[39m [49m +[48;2;0;0;0m [49m +[48;2;0;0;0m [38;2;0;255;0m1. test[39m [49m +[48;2;0;0;0m [38;2;240;248;255m2. test[39m [49m +[48;2;0;0;0m [38;2;0;255;0m3. test[39m [49m +[48;2;0;0;0m [38;2;240;248;255m4. test[39m [49m +[48;2;0;0;0m [38;2;255;192;203m5. test[39m [49m +[48;2;0;0;0m [49m +[48;2;0;0;0m [38;2;255;255;255m1. test[39m [49m +[48;2;0;0;0m [38;2;255;40;40m2. test[39m [49m +[48;2;0;0;0m [38;2;255;40;40m3. test[39m [49m +[48;2;0;0;0m [38;2;255;40;40m4. test[39m [49m +[48;2;0;0;0m [38;2;255;40;40m5. test[39m [49m + diff --git a/test/layout/nth-child.html b/test/layout/nth-child.html new file mode 100644 index 00000000..0e648954 --- /dev/null +++ b/test/layout/nth-child.html @@ -0,0 +1,60 @@ +<style> +ul[first] :nth-child(1n+0) { color: green } +ul[first] :nth-child(2n+0) { color: blue } +ul[first] :nth-child(0n+1) { color: red } + +ul[second] :nth-child(1n+0 of li) { color: lime } +ul[second] :nth-child(2n+0 of li) { color: aliceblue } +ul[second] :nth-child(0n+1 of li) { color: pink } + +ol[first] :nth-last-child(1n+0) { color: green } +ol[first] :nth-last-child(2n+0) { color: blue } +ol[first] :nth-last-child(0n+1) { color: red } + +ol[second] :nth-last-child(1n+0 of li) { color: lime } +ol[second] :nth-last-child(2n+0 of li) { color: aliceblue } +ol[second] :nth-last-child(0n+1 of li) { color: pink } + +ol[third] :nth-child(n+2) { color: red } +</style> + +<body bgcolor=black text=white> +<ul first> +<li>test +<li>test +<li>test +<li>test +<li>test +</ul> + +<ul second> +<li>test +<li>test +<li>test +<li>test +<li>test +</ul> + +<ol first> +<li>test +<li>test +<li>test +<li>test +<li>test +</ol> + +<ol second> +<li>test +<li>test +<li>test +<li>test +<li>test +</ol> + +<ol third> +<li>test +<li>test +<li>test +<li>test +<li>test +</ol> |