Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/remove-next-sibling-during-replace-with.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="container"><div id="target"></div><b></b></div>
<template><span>New </span><script>document.querySelector('b').remove();</script><span>content</span></template>
<script>
test(() => {
target.replaceWith(document.querySelector('template').content.cloneNode(true));
container.querySelector('script').remove();
assert_equals(container.innerHTML, '<span>New </span><span>content</span>');
});
</script>