Base: Add a test page for the CSS :is() selector
This commit is contained in:
parent
5319e2ba8e
commit
0d01097a54
Notes:
sideshowbarker
2024-07-17 17:12:30 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/0d01097a54 Pull-request: https://github.com/SerenityOS/serenity/pull/13098
2 changed files with 39 additions and 0 deletions
38
Base/res/html/misc/is-selector.html
Normal file
38
Base/res/html/misc/is-selector.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>:is() test</title>
|
||||
<style>
|
||||
div {
|
||||
border: 1px solid black;
|
||||
margin-bottom: 1em;
|
||||
padding: 0 0.5em;
|
||||
}
|
||||
.special :is(h2, p) {
|
||||
background-color: lime;
|
||||
}
|
||||
.forgiving :is(&&&fakhsdaskjhd, h2, p) {
|
||||
background-color: lime;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>:is() test</h1>
|
||||
<div>
|
||||
<h2>Nothing</h2>
|
||||
<p>These should have no background.</p>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="special">
|
||||
<h2>.special :is(h2, p)</h2>
|
||||
<p>These should have a green background.</p>
|
||||
</div>
|
||||
<br/>
|
||||
<div class="forgiving">
|
||||
<h2>.forgiving :is(&&&fakhsdaskjhd, h2, p)</h2>
|
||||
<p>These should have a green background. :is() 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>
|
|
@ -96,6 +96,7 @@
|
|||
<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="hover.html">:hover</a></li>
|
||||
<li><h3>Properties</h3></li>
|
||||
|
|
Loading…
Add table
Reference in a new issue