template-contentmethod-append-text-and-element.html (781B)
1 <!DOCTYPE HTML> 2 <meta charset="utf-8" /> 3 <title>HTML partial updates - declarative append</title> 4 <link rel=help href="https://github.com/WICG/declarative-partial-updates"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <div id="placeholder" contentname="placeholder">Some</div> 9 <template contentmethod="append"><div contentname="placeholder"> <span>content</span></div></template> 10 <script> 11 test(() => { 12 const placeholder = document.getElementById("placeholder"); 13 assert_equals(placeholder.textContent, "Some content"); 14 assert_equals(placeholder.firstChild.textContent, "Some "); 15 assert_equals(placeholder.firstChild.nextSibling.tagName, "SPAN"); 16 }, "<template contentmethod=append> with text"); 17 </script>