blob: bd291e662b41113328785ab855f64de25bae63e2 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<script src="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'},
createShadowRoot(
{'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'},
createShadowRoot(
{'mode': 'closed'},
createDOM('content', {'id': 'content-3'})),
createDOM('div', {'id': 'child-3'}))));
shouldBe('document.getElementById("child-3").getDestinationInsertionPoints().length', '0');
</script>