summaryrefslogtreecommitdiff
path: root/Base/res
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@gmail.com>2021-07-12 17:58:47 +0100
committerAndreas Kling <kling@serenityos.org>2021-07-14 13:31:00 +0200
commitffc81cbfad8af71674b8d63706b7166fa71509d5 (patch)
treeec83a4990ba11a2036bb7319486502414e1440e8 /Base/res
parent776b1f45487eb5f541f079239c209d1aa3c9e5cf (diff)
downloadserenity-ffc81cbfad8af71674b8d63706b7166fa71509d5.zip
LibWeb: Use Selectors instead of a String for :not() selectors
Rather than parsing the selector every time we want to check it, we now parse it once at the beginning. A bonus effect of this is that we now support a selector list in :not(), instead of just a single selector, though only when using the new parser.
Diffstat (limited to 'Base/res')
-rw-r--r--Base/res/html/misc/not-selector.html20
-rw-r--r--Base/res/html/misc/welcome.html1
2 files changed, 21 insertions, 0 deletions
diff --git a/Base/res/html/misc/not-selector.html b/Base/res/html/misc/not-selector.html
new file mode 100644
index 0000000000..21200ccf48
--- /dev/null
+++ b/Base/res/html/misc/not-selector.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<title>:only-child test</title>
+<style>
+div {
+ background: yellow;
+}
+
+div:not(div div) {
+ background: lime;
+}
+</style>
+</head>
+<body>
+ <div>I am not a descendant and should be green.</div>
+ <div>
+ <div>I am a descendant and should be yellow.</div>
+ </div>
+</body>
+</html>
diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html
index 494b64cdbd..785b097625 100644
--- a/Base/res/html/misc/welcome.html
+++ b/Base/res/html/misc/welcome.html
@@ -109,6 +109,7 @@
<li><a href="nth-last-child.html">:nth-last-child</a></li>
<li><a href="empty.html">:empty</a></li>
<li><a href="root.html">:root</a></li>
+ <li><a href="not-selector.html">:not</a></li>
<li><a href="form.html">form</a></li>
<li><a href="borders.html">borders</a></li>
<li><a href="css.html">css</a></li>