Shadow_SC_DOM/Shadow_SC_DOM/tests/my_get_owner_document.html

29 lines
610 B
HTML

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="test">
<div id="host">
<template data-mode="open">
<slot id="s1" name="slot1"></slot>
</template>
<div id="c1" slot="slot1"></div>
</div>
</div>
</body>
<script>
test(() => {
let n = createTestTree(test);
assert_equals(n.s1.ownerDocument, document);
}, 'ownerDocument inside shadow tree returns the outer document.');
test(() => {
let n = createTestTree(test);
assert_equals(n.c1.ownerDocument, document);
}, 'ownerDocument outside shadow tree returns the outer document.');
</script>
</html>