tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

stream-append-with-template-contentmethod.html (807B)


      1 <!DOCTYPE HTML>
      2 <meta charset="utf-8" />
      3 <title>streamHTML methods can apply template with contentmethod</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 <body>
      8 <div contentname=p id="placeholder">Old content</div>
      9 <script>
     10 promise_test(async t => {
     11    const writable = document.body.streamAppendHTMLUnsafe();
     12    const writer = writable.getWriter();
     13    await writer.write('<template contentmethod="replace-children">');
     14    await writer.write("<div contentname=p>");
     15    await writer.write("New content");
     16    await writer.write("</div>");
     17    await writer.close();
     18    assert_equals(document.querySelector("#placeholder").textContent, "New content")
     19 });
     20 </script>