tor-browser

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

svg-template-querySelector.html (1078B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>querySelector on template fragments with SVG elements</title>
      4 
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 
      8 <template id="template1"><div></div></template>
      9 <template id="template2"><svg></svg></template>
     10 <template id="template3"><div><svg></svg></div></template>
     11 
     12 <script>
     13 "use strict";
     14 
     15 test(() => {
     16  const fragment = document.querySelector("#template1").content;
     17  assert_not_equals(fragment.querySelector("div"), null);
     18 }, "querySelector works on template contents fragments with HTML elements (sanity check)");
     19 
     20 test(() => {
     21  const fragment = document.querySelector("#template2").content;
     22  assert_not_equals(fragment.querySelector("svg"), null);
     23 }, "querySelector works on template contents fragments with SVG elements");
     24 
     25 test(() => {
     26  const fragment = document.querySelector("#template3").content;
     27  assert_not_equals(fragment.firstChild.querySelector("svg"), null);
     28 }, "querySelector works on template contents fragments with nested SVG elements");
     29 </script>