blob: 6578c7c3a0b9b10aeef7e4db5ddf2ac87047177b [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script src="../../fast/dom/shadow/resources/shadow-dom.js"></script>
<body></body>
<script>
description("Tests for getDestinationInsertionPoints().");
document.body.appendChild(
createDOM('div', {},
createDOM('div', {'id': 'host-1'},
createShadowRoot(
createDOM('content', {'id': 'content-1'})),
createDOM('div', {'id': 'child-1'}))));
shouldBeEqualAsArray(document.getElementById('child-1').getDestinationInsertionPoints(),
[getNodeInComposedTree('host-1/content-1')]);
debug('Insertion points should be inactive in v1 shadow trees.');
document.body.appendChild(
createDOM('div', {},
createDOM('div', {'id': 'host-2'},
attachShadow(
{'mode': 'open'},
createDOM('content', {'id': 'content-2'})),
createDOM('div', {'id': 'child-2'}))));
shouldBe('document.getElementById("child-2").getDestinationInsertionPoints().length', '0');
document.body.appendChild(
createDOM('div', {},
createDOM('div', {'id': 'host-3'},
attachShadow(
{'mode': 'closed'},
createDOM('content', {'id': 'content-3'})),
createDOM('div', {'id': 'child-3'}))));
shouldBe('document.getElementById("child-3").getDestinationInsertionPoints().length', '0');
</script>