tor-browser

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

template-contentmethod-script-replace.html (814B)


      1 <!DOCTYPE HTML>
      2 <meta charset="utf-8" />
      3 <title>HTML partial updates - a script replaced with a patch should execute</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 <section id="placeholder">
      9    <script contentname="s">
     10    window.state = "init";
     11    </script>
     12 </section>
     13 <template contentmethod="replace"><script contentname="s">window.state = 'patched';</script></section></template>
     14 <script>
     15 test(() => {
     16    assert_not_equals(document.querySelector("#placeholder").firstElementChild, null);
     17    assert_equals(document.querySelector("#placeholder").firstElementChild.textContent, "window.state = 'patched';");
     18    assert_equals(window.state, "patched");
     19 });
     20 
     21 </script>