summaryrefslogtreecommitdiff
path: root/Base
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-10-06 19:59:07 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-06 19:59:07 +0200
commitbedb00603cc91219b09c43256132261fd18a9edd (patch)
tree6f424e3c3fbf7e5fd1caf0013aaac7449206c37f /Base
parent5a6c36dc917decc58ec5fbce7d094b82a4af4fc1 (diff)
downloadserenity-bedb00603cc91219b09c43256132261fd18a9edd.zip
LibHTML: Add adjacent (+) and general (~) sibling combinators
This patch implements two more selector features: - "div + p" matches the <p> sibling immediately after a <div>. - "div ~ p" matches all <p> siblings after a <div>.
Diffstat (limited to 'Base')
-rw-r--r--Base/home/anon/www/selectors.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/Base/home/anon/www/selectors.html b/Base/home/anon/www/selectors.html
index 88c248e467..bd06355085 100644
--- a/Base/home/anon/www/selectors.html
+++ b/Base/home/anon/www/selectors.html
@@ -15,6 +15,11 @@ div > .boo > .bee {
background-color: #000000;
color: #ff00ff;
}
+#gen_sib ~ div,
+#adj_sib + div {
+ background-color: #0000ff;
+ color: #ffffff;
+}
</style>
</head>
<body>
@@ -45,5 +50,16 @@ div > .boo > .bee {
</div>
</div>
</div>
+ </div>
+ <div>
+ <div id="gen_sib">All the siblings of this &lt;div&gt; should be blue.</div>
+ <div>First sibling (should be blue)</div>
+ <div>Second sibling (should be blue)</div>
+ </div>
+ <div>
+ <div id="adj_sib">The first sibling of this &lt;div&gt; should be blue.</div>
+ <div>First sibling (should be blue)</div>
+ <div>Second sibling (should not be blue)</div>
+ </div>
</body>
</html>