summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-display-contents.html
blob: 032033de011b9f27a1cf504521d9687115d506ae (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
<!DOCTYPE html>
<html>
<title>Test that display: contents; on modal dialog & ::backdrop acts like display: block</title>
<meta charset="utf-8">
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m">
<link rel="help" href="https://fullscreen.spec.whatwg.org/#new-stacking-layer">
<link rel="help" href="https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element">
<link rel="match" href="modal-dialog-display-contents-ref.html">
<p>Test passes if there is a green dialog</p>
<p>Dialog is display:<span id="computed-value"></span></p>
<p>Dialog::backdrop is display:<span id="computed-value-backdrop"></span></p>
<dialog>Dialog Contents</dialog>
<style>
dialog {
    display: contents;
    background-color: green;
}
dialog::backdrop {
    display: contents;
}
</style>
<script>
dialog = document.querySelector("dialog");
dialog.showModal();
document.getElementById("computed-value").textContent = getComputedStyle(dialog).display;
document.getElementById("computed-value-backdrop").textContent = getComputedStyle(dialog, "::backdrop").display;
</script>
</html>