blob: 87f4454689e7f8a50f209a78aafb4558ec778fec [file] [log] [blame]
<!DOCTYPE html>
<body>
<template><div></div></template>
<script src="../../../resources/js-test.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>
<iframe srcdoc="<template><div></div></template>" onload="test()" style="display:none"></iframe>
</body>