haikuwebkit/LayoutTests/fast/parser/foster-parent-adopted2.html

26 lines
782 B
HTML

<!DOCTYPE html>
<html>
<body>
<p>This tests that when nodes are foster-parented after being adopted into another document,
they are adopted back into the ownerDocument of their foster parent. </p>
<table>
<tr>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var doc = document.implementation.createHTMLDocument();
var div = document.createElement('div');
doc.adoptNode(div);
div.appendChild(document.querySelector('table'))
</script>
<div id=fosterChild></div>
</tr>
</table>
<script>
var fosterChild = div.querySelector('#fosterChild');
if (fosterChild.ownerDocument === fosterChild.parentNode.ownerDocument)
document.body.appendChild(document.createTextNode('PASS.'));
</script>
</body>
</html>