aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-02-13 20:40:32 +0100
committerbptato <nincsnevem662@gmail.com>2025-02-13 20:51:32 +0100
commitdd1a49d2beab7445e903ab0acc29414d690f1977 (patch)
treec6615f407f77b01ac804639b43216c072119d586 /test
parent8f43f6c70150fe0ff3fff1b152f69f13c9605800 (diff)
downloadchawan-dd1a49d2beab7445e903ab0acc29414d690f1977.tar.gz
csstree, cssvalues: implement counter()
Diffstat (limited to 'test')
-rw-r--r--test/layout/counters.expected15
-rw-r--r--test/layout/counters.html37
2 files changed, 52 insertions, 0 deletions
diff --git a/test/layout/counters.expected b/test/layout/counters.expected
new file mode 100644
index 00000000..0bab8ed4
--- /dev/null
+++ b/test/layout/counters.expected
@@ -0,0 +1,15 @@
+[1]test
+ 1. 1 1
+[2]test
+ 2. 2 2
+ 3. 3 3
+ 4. 4 4
+ 5. 5 5
+ 6. 6 6
+ 7. 7 7
+ 1. 1 1
+ 2. 2 2
+ 3. 3 3
+ 4. 4 4
+ 5. 5 5
+[3]test
diff --git a/test/layout/counters.html b/test/layout/counters.html
new file mode 100644
index 00000000..ac410e73
--- /dev/null
+++ b/test/layout/counters.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<!-- Once again, Blink disagrees with Gecko. This time though, it's
+ Blink being weird: it resets list-item counters per div level.
+ That feels wrong, so we follow Gecko. -->
+<style>
+myli { display: list-item; margin-left: 5ch; list-style-type: decimal }
+myli { counter-increment: asdf 1 }
+myli::before { content: counter(asdf) ' ' }
+:root { counter-set: my-link-counter }
+a[href]::before{
+ content: '['counter(my-link-counter)']';
+ counter-increment: my-link-counter
+}
+</style>
+<a href=https://example.org>test</a>
+<div>
+ <myli>1</myli>
+ <div>
+ <a href=https://example.org>test</a>
+ <myli>2</myli>
+ <myli>3</myli>
+ <myli>4</myli>
+ <myli>5</myli>
+ </div>
+ <myli>6</myli>
+ <myli>7</myli>
+</div>
+<div>
+ <myli>1</myli>
+ <myli>2</myli>
+ <myli>3</myli>
+ <div>
+ <myli>4</myli>
+ </div>
+ <myli>5</myli>
+</div>
+<a href=https://example.org>test</a>