blob: 9919a004e2490a8e8be4e3eba99ce0277e535869 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body>
<p>This test checks that appending shadow root as a child does not crash.</p>
<pre id="console"></pre>
<div id="container"></div>
<script>
function doTest() {
if (!window.internals) {
debug('This test runs on DRT only');
return;
}
var div = document.createElement('div');
root = div.webkitCreateShadowRoot();
root.appendChild(document.createTextNode('SS'));
container = document.getElementById('container');
container.appendChild(root);
shouldBeNull('root.firstChild');
shouldBe('container.firstChild.textContent', '"SS"');
var div = document.createElement('div');
root = div.webkitCreateShadowRoot();
root.appendChild(document.createTextNode('PA'));
container.insertBefore(root, container.firstChild);
shouldBeNull('root.firstChild');
shouldBe('container.firstChild.textContent', '"PA"');
shouldNotBe('container.firstChild', 'container.lastChild');
}
doTest();
var successfullyParsed = true;
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>