about summary refs log tree commit diff stats
path: root/test/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-10-26 12:11:55 +0200
committerbptato <nincsnevem662@gmail.com>2024-10-26 12:21:55 +0200
commit4aeb8699f96672103230e7826d7b4e3f0a8aae2f (patch)
tree9f791ea40e5be9b6ae962cf29fe1d91ea4e8d346 /test/layout
parent28bf2922a33dd987a0a3095bc461589ef23ad37d (diff)
downloadchawan-4aeb8699f96672103230e7826d7b4e3f0a8aae2f.tar.gz
selectorparser: fix parsing of invalid pseudo elements
Found this because the 5th largest tech company on Earth cannot bother
itself with trivial matters such as "writing valid CSS".
Diffstat (limited to 'test/layout')
-rw-r--r--test/layout/invalid-pseudo-element-selectors.color.expected2
-rw-r--r--test/layout/invalid-pseudo-element-selectors.html19
2 files changed, 21 insertions, 0 deletions
diff --git a/test/layout/invalid-pseudo-element-selectors.color.expected b/test/layout/invalid-pseudo-element-selectors.color.expected
new file mode 100644
index 00000000..21996c2c
--- /dev/null
+++ b/test/layout/invalid-pseudo-element-selectors.color.expected
@@ -0,0 +1,2 @@
+should be green 
+should be purple
diff --git a/test/layout/invalid-pseudo-element-selectors.html b/test/layout/invalid-pseudo-element-selectors.html
new file mode 100644
index 00000000..bd5fbd1f
--- /dev/null
+++ b/test/layout/invalid-pseudo-element-selectors.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+#x { color: green }
+#x::before { content: "should" }
+:is(#x::before) { color: pink }
+#x::before span { color: magenta }
+::before#x { color: blue }
+:is(#x::before, #y) { color: purple }
+:is(#x::before) span { color: red }
+</style>
+<span id=x>
+be
+<span>
+green
+</span>
+</span>
+<div id=y>
+should be purple
+</div>