| <!DOCTYPE html> |
| <template id="template"><span>Contents</span></template> |
| <script src="../../../resources/js-test-pre.js"></script> |
| <script> |
| |
| description('Test that template contents are not cloned when the template element is cloned'); |
| |
| if (!window.HTMLTemplateElement) |
| testFailed('This test requires ENABLE(TEMPLATE_ELEMENT)'); |
| |
| var template = document.getElementById('template'); |
| var div = template.appendChild(document.createElement('div')); |
| |
| shouldBe('template.content.childNodes.length', '1'); |
| var clone = template.cloneNode(true); |
| shouldBe('clone.content.childNodes.length', '1'); |
| shouldBe('clone.outerHTML', 'template.outerHTML'); |
| shouldNotBe('clone.content.firstChild', 'template.content.firstChild'); |
| shouldNotBe('clone.content', 'template.content'); |
| shouldBe('clone.firstChild.tagName', '"DIV"'); |
| shouldNotBe('clone.firstChild', 'div'); |
| |
| </script> |