Skip to content

Commit

Permalink
Base: Add a test page for the CSS :where() selector
Browse files Browse the repository at this point in the history
This behaves identically to :is() except for specificity, so this test
page is identical to the other one. It's not because I'm lazy. :^)
  • Loading branch information
AtkinsSJ authored and awesomekling committed Mar 18, 2022
1 parent c148ed5 commit 47eb4b2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Base/res/html/misc/welcome.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,9 @@ <h2>CSS</h2>
<li><a href="nth-last-of-type.html">:nth-last-of-type</a></li>
<li><a href="empty.html">:empty</a></li>
<li><a href="root.html">:root</a></li>
<li><a href="is-selector.html">:is</a></li>
<li><a href="not-selector.html">:not</a></li>
<li><a href="is-selector.html">:is()</a></li>
<li><a href="not-selector.html">:not()</a></li>
<li><a href="where-selector.html">:where()</a></li>
<li><a href="hover.html">:hover</a></li>
<li><h3>Properties</h3></li>
<li><a href="backgrounds.html">Backgrounds</a></li>
Expand Down
38 changes: 38 additions & 0 deletions Base/res/html/misc/where-selector.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>:where() test</title>
<style>
div {
border: 1px solid black;
margin-bottom: 1em;
padding: 0 0.5em;
}
.special :where(h2, p) {
background-color: lime;
}
.forgiving :where(&&&fakhsdaskjhd, h2, p) {
background-color: lime;
}
</style>
</head>
<body>
<h1>:where() test</h1>
<div>
<h2>Nothing</h2>
<p>These should have no background.</p>
</div>
<br/>
<div class="special">
<h2>.special :where(h2, p)</h2>
<p>These should have a green background.</p>
</div>
<br/>
<div class="forgiving">
<h2>.forgiving :where(&&&fakhsdaskjhd, h2, p)</h2>
<p>These should have a green background. :where() takes a "permissive selector list",
so even though part of it is invalid, this does not make the whole selector-list invalid.</p>
</div>
</body>
</html>

0 comments on commit 47eb4b2

Please sign in to comment.