Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/interactive-elements/the-dialog-element/backdrop-dynamic-display-none.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<title>Test that adding display: none; dynamically on ::backdrop makes it disappear</title>
<meta charset="utf-8">
<link rel="match" href="backdrop-dynamic-display-none-ref.html">
<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>