Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/moveBefore/tentative/modal-dialog.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>moveBefore should not close a modal dialog</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<section id="old_parent">
<dialog id="dialog">
</dialog>
</section>
<section id="new_parent">
</section>
<script>
promise_test(async t => {
const dialog = document.querySelector("#dialog");
dialog.showModal();
document.querySelector("#new_parent").moveBefore(dialog, null);
assert_equals(document.elementFromPoint(0, 0), dialog);
}, "when reparenting a modal dialog, the dialog should stay modal");
</script>