24 lines
729 B
HTML
24 lines
729 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<script src="../../resources/js-test.js"></script>
|
|
<script>
|
|
|
|
description(`This tests re-parenting a child of the document fragment during an insertion so as to create a circular node tree.<br>
|
|
WebKit should detect this case and throw HierarchyRequestError.`);
|
|
|
|
fragment = document.createDocumentFragment();
|
|
container = document.createElement('div');
|
|
child = fragment.appendChild(document.createElement('div'));
|
|
fragment.addEventListener('DOMSubtreeModified', function() {
|
|
child.appendChild(container);
|
|
});
|
|
|
|
shouldThrowErrorName(`container.appendChild(fragment)`, 'HierarchyRequestError');
|
|
shouldBe('container.parentNode', 'child');
|
|
shouldBe('child.parentNode', 'null');
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|