tor-browser

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

test_custom_element_template.html (794B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1091425
      5 -->
      6 <head>
      7  <title>Test for custom elements in template</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     10 </head>
     11 <body>
     12 <template>
     13  <x-foo></x-foo>
     14 </template>
     15 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1091425">Bug 1091425</a>
     16 <script>
     17 
     18 class XFoo extends HTMLElement {
     19  connectedCallback() {
     20    ok(false, "Connected callback should not be called for custom elements in templates.");
     21  }
     22 };
     23 
     24 customElements.define("x-foo", XFoo);
     25 
     26 ok(true, "Connected callback should not be called for custom elements in templates.");
     27 
     28 </script>
     29 <template>
     30  <x-foo></x-foo>
     31 </template>
     32 </body>
     33 </html>