Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!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>