summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/backdrop-dynamic-display-none.html
blob: bcf100b36898f0d1bb57822e8a7ac1699f4bcc4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<title>Test that adding display: none; dynamically on ::backdrop makes it disappear</title>
<meta charset="utf-8">
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="match" href="backdrop-dynamic-display-none-ref.html">
<link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer">
<p>Test passes if there is no red.</p>
<dialog></dialog>
<style>
dialog { visibility: hidden; }
::backdrop { background-color: red; }
.hidden-backdrop::backdrop {
    display: none;
}
</style>
<script>
dialog = document.querySelector("dialog");
dialog.showModal();
requestAnimationFrame(() => {
    dialog.classList.add("hidden-backdrop");
});
</script>
</html>