summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/backdrop-dynamic-style-change.html
blob: 6c609a769cc257ffda7513856f04de30b579d099 (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
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html>
<head>
<link rel="match" href="backdrop-dynamic-style-change-ref.html">
<link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer">
<style>
dialog {
    visibility: hidden;
}

::backdrop {
    visibility: visible;
    position: absolute;
    top: 100px;
    left: 100px;
    height: 100px;
    width: 100px;
    background-color: red;
}

.green::backdrop {
    background-color: green;
}
</style>
</head>
<body>
Test dynamic changes to ::backdrop style. The test passes if there is a green box below.
<dialog></dialog>
<script>
dialog = document.querySelector('dialog');
dialog.showModal();
dialog.classList.add('green');
</script>
</body>
</html>