Skip to content

Commit

Permalink
Add tests for ::slotted(*)::details-content (#49408)
Browse files Browse the repository at this point in the history
  • Loading branch information
nt1m authored Nov 27, 2024
1 parent d8ae479 commit 4e59e41
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions css/css-scoping/slotted-details-content-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<!doctype html>

<details open><span style="color: green">This text should be green</span></details>
17 changes: 17 additions & 0 deletions css/css-scoping/slotted-details-content.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Scoping Test: ::slotted() allows ::details-content</title>
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo">
<link rel="match" href="slotted-details-content-ref.html">
<div id="host">
<details open>This text should be green</details>
</div>
<script>
host.attachShadow({ mode: "open" }).innerHTML = `
<style>
::slotted(*)::details-content { color: green }
</style>
<slot></slot>
`;
</script>
1 change: 1 addition & 0 deletions css/css-scoping/slotted-parsing.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
// Allow tree-abiding pseudo elements after ::slotted
test_valid_selector("::slotted(*)::before");
test_valid_selector("::slotted(*)::after");
test_valid_selector("::slotted(*)::details-content");
test_valid_selector("::slotted(*)::placeholder");
test_valid_selector("::slotted(*)::marker");

Expand Down

0 comments on commit 4e59e41

Please sign in to comment.