blob: 2f5af9eb81182bcda8e2b644e3afc39ba7d61c5d [file] [log] [blame]
<!DOCTYPE html>
<body>
<template><div></div></template>
<script src="../../../resources/js-test-pre.js"></script>
<script>
description('Adopting a template from another document should also switch the template content document');
jsTestIsAsync = true;
var template;
var frameTemplate;
function test() {
template = document.querySelector('template');
frameTemplate = frames[0].document.querySelector('template');
debug('Before adoption:');
shouldNotBe('template.ownerDocument', 'frameTemplate.ownerDocument');
shouldNotBe('template.content.ownerDocument', 'frameTemplate.content.ownerDocument');
frameTemplate = document.adoptNode(frameTemplate);
debug('\nAfter adoption:');
shouldBe('template.ownerDocument', 'frameTemplate.ownerDocument');
shouldBe('template.content.ownerDocument', 'frameTemplate.content.ownerDocument');
debug('');
finishJSTest();
}
</script>
<script src="../../../resources/js-test-post.js"></script>
<iframe srcdoc="<template><div></div></template>" onload="test()" style="display:none"></iframe>
</body>