blob: 2f1e274cc55756a625f20529ffabbf13703f3368 [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<div id="templateParent"><template id="template"><span></span></template></div>
<script src="../../resources/js-test.js"></script>
<script>
description('This tests inserting the parent of a template element into its content document fragment<br>'
+ 'after adopting the document fragment to another document. WebKit should throw HierarchyRequestError');
const newDocument = document.implementation.createHTMLDocument();
newDocument.adoptNode(template.content);
shouldThrowErrorName('template.content.appendChild(templateParent)', 'HierarchyRequestError');
shouldThrowErrorName('template.content.insertBefore(templateParent, template.content.firstChild)', 'HierarchyRequestError');
shouldThrowErrorName('template.content.replaceChild(templateParent, template.content.firstChild)', 'HierarchyRequestError');
</script>
</body>
</html>