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/popover-preserve.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>moveBefore should not close a popover</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<section id="old_parent">
<div popover>
Popover
</div>
</section>
<section id="new_parent">
</section>
<script>
promise_test(async t => {
const popover = document.querySelector("div[popover]");
popover.showPopover();
await new Promise(resolve => requestAnimationFrame(() => resolve()));
assert_equals(document.querySelector(":popover-open"), popover);
document.querySelector("#new_parent").moveBefore(popover, null);
assert_equals(document.querySelector(":popover-open"), popover);
}, "when reparenting an open popover, it shouldn't be closed automatically");
</script>