blob: d7119f59e43da9b5fcf4f0ed930346d09bc0eaaf [file] [log] [blame]
<!DOCTYPE html>
<template id="template"><span>Contents</span></template>
<script src="../../../resources/js-test.js"></script>
<script>
description('Test that template contents are correctly cloned when the template element is imported.');
var template = document.getElementById('template');
var div = template.appendChild(document.createElement('div'));
shouldBe('template.content.childNodes.length', '1');
var imported = document.importNode(template, true);
shouldBe('imported.content.childNodes.length', '1');
shouldBe('imported.outerHTML', 'template.outerHTML');
shouldNotBe('imported.content.firstChild', 'template.content.firstChild');
shouldNotBe('imported.content', 'template.content');
shouldBe('imported.firstChild.tagName', '"DIV"');
shouldNotBe('imported.firstChild', 'div');
</script>