OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <template id="template"><span>Contents</span></template> |
| 3 <script src="../../../resources/js-test.js"></script> |
| 4 <script> |
| 5 |
| 6 description('Test that template contents are correctly cloned when the template
element is imported.'); |
| 7 |
| 8 var template = document.getElementById('template'); |
| 9 var div = template.appendChild(document.createElement('div')); |
| 10 |
| 11 shouldBe('template.content.childNodes.length', '1'); |
| 12 var imported = document.importNode(template, true); |
| 13 shouldBe('imported.content.childNodes.length', '1'); |
| 14 shouldBe('imported.outerHTML', 'template.outerHTML'); |
| 15 shouldNotBe('imported.content.firstChild', 'template.content.firstChild'); |
| 16 shouldNotBe('imported.content', 'template.content'); |
| 17 shouldBe('imported.firstChild.tagName', '"DIV"'); |
| 18 shouldNotBe('imported.firstChild', 'div'); |
| 19 |
| 20 </script> |
OLD | NEW |