OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <template><div></div></template> | 3 <template><div></div></template> |
4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
5 <script> | 5 <script> |
6 description('Adopting a template from another document should also switch the te
mplate content document'); | 6 description('Adopting a template from another document should also switch the te
mplate content document'); |
7 jsTestIsAsync = true; | 7 jsTestIsAsync = true; |
8 | 8 |
9 var template; | 9 var template; |
10 var frameTemplate; | 10 var frameTemplate; |
11 function test() { | 11 function test() { |
12 template = document.querySelector('template'); | 12 template = document.querySelector('template'); |
13 frameTemplate = frames[0].document.querySelector('template'); | 13 frameTemplate = frames[0].document.querySelector('template'); |
14 | 14 |
15 debug('Before adoption:'); | 15 debug('Before adoption:'); |
16 shouldNotBe('template.ownerDocument', 'frameTemplate.ownerDocument'); | 16 shouldNotBe('template.ownerDocument', 'frameTemplate.ownerDocument'); |
17 shouldNotBe('template.content.ownerDocument', 'frameTemplate.content.ownerDo
cument'); | 17 shouldNotBe('template.content.ownerDocument', 'frameTemplate.content.ownerDo
cument'); |
18 frameTemplate = document.adoptNode(frameTemplate); | 18 frameTemplate = document.adoptNode(frameTemplate); |
19 debug('\nAfter adoption:'); | 19 debug('\nAfter adoption:'); |
20 shouldBe('template.ownerDocument', 'frameTemplate.ownerDocument'); | 20 shouldBe('template.ownerDocument', 'frameTemplate.ownerDocument'); |
21 shouldBe('template.content.ownerDocument', 'frameTemplate.content.ownerDocum
ent'); | 21 shouldBe('template.content.ownerDocument', 'frameTemplate.content.ownerDocum
ent'); |
22 debug(''); | 22 debug(''); |
23 finishJSTest(); | 23 finishJSTest(); |
24 } | 24 } |
25 </script> | 25 </script> |
26 <iframe srcdoc="<template><div></div></template>" onload="test()" style="display
:none"></iframe> | 26 <iframe srcdoc="<template><div></div></template>" onload="test()" style="display
:none"></iframe> |
27 </body> | 27 </body> |
OLD | NEW |