mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
import template parsing test from 'legacy'
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user