import template parsing test from 'legacy'

This commit is contained in:
Karl Seguin
2025-12-18 21:14:41 +08:00
parent 3e03f7559f
commit ba4900b61f

View File

@@ -212,4 +212,19 @@
// NOT the DocumentFragment, so it should be empty
testing.expectEqual('', template.textContent);
}
</script> -->
</script>
<template id="hello"><p>hello, world</p></template>
<script id=template_parsing>
const tt = document.getElementById('hello');
testing.expectEqual('<p>hello, world</p>', tt.innerHTML);
// > The Node.childNodes property of the <template> element is always empty
// https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/template#usage_notes
testing.expectEqual(0, tt.childNodes.length);
let out = document.createElement('div');
out.appendChild(tt.content.cloneNode(true));
testing.expectEqual('<p>hello, world</p>', out.innerHTML);
</script>