Skip to content

Commit

Permalink
Add a couple of reftests for the :open pseudo-class.
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D234331

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1936113
gecko-commit: 6d39e75391fa69f3acc997d45dbf5c56bfe4df77
gecko-reviewers: dshin
  • Loading branch information
jfkthame authored and moz-wptsync-bot committed Jan 18, 2025
1 parent 85b330f commit 8f3f629
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 0 deletions.
17 changes: 17 additions & 0 deletions css/selectors/selectors-4/details-open-pseudo-001-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>reference for details:open pseudoclass</title>

<style>
details {
color: green;
margin-left: 5em;
}
</style>

<p>The details element should be open, green, and indented:</p>

<details open=true>
<summary>Summary</summary>
<p>Detailed content</p>
</details>
22 changes: 22 additions & 0 deletions css/selectors/selectors-4/details-open-pseudo-001.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>test for details:open pseudoclass</title>
<link rel="match" href="details-open-pseudo-001-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#open-state">

<style>
details {
color: red;
}
:open {
color: green;
margin-left: 5em;
}
</style>

<p>The details element should be open, green, and indented:</p>

<details open=true>
<summary>Summary</summary>
<p>Detailed content</p>
</details>
32 changes: 32 additions & 0 deletions css/selectors/selectors-4/details-open-pseudo-002.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>test for details:open pseudoclass</title>
<link rel="match" href="details-open-pseudo-001-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#open-state">

<style>
details {
color: blue;
}
:open {
color: green;
margin-left: 5em;
}
</style>

<script>
function run() {
document.querySelector("details").open = true;
document.documentElement.classList.remove("reftest-wait");
}
</script>

<body onload="run()">

<p>The details element should be open, green, and indented:</p>

<details>
<summary>Summary</summary>
<p>Detailed content</p>
</details>
15 changes: 15 additions & 0 deletions css/selectors/selectors-4/details-open-pseudo-003-ref.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>reference for details:open pseudoclass</title>

<style>
details {
color: blue;
}
</style>

<p>The details element should be closed and blue:</p>

<details>
<summary>Summary</summary>
</details>
32 changes: 32 additions & 0 deletions css/selectors/selectors-4/details-open-pseudo-003.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>test for details:open pseudoclass</title>
<link rel="match" href="details-open-pseudo-003-ref.html">
<link rel="help" href="https://drafts.csswg.org/selectors-4/#open-state">

<style>
details {
color: blue;
}
:open {
color: green;
margin-left: 5em;
}
</style>

<script>
function run() {
document.querySelector("details").open = false;
document.documentElement.classList.remove("reftest-wait");
}
</script>

<body onload="run()">

<p>The details element should be closed and blue:</p>

<details open=true>
<summary>Summary</summary>
<p>Detailed content</p>
</details>

0 comments on commit 8f3f629

Please sign in to comment.