tor-browser

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

CustomElementRegistry-define.html (1113B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
      5 <link rel="help" href="https://github.com/whatwg/html/issues/10854">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 </head>
      9 <body>
     10 <script>
     11 test(() => {
     12    let registry = new CustomElementRegistry();
     13    assert_not_equals(registry, window.customElements);
     14 }, 'Create a CustomElementRegistry not identically equal to window.customElements');
     15 
     16 test(() => {
     17    let registry = new CustomElementRegistry();
     18    window.customElements.define('a-b', class extends HTMLElement {});
     19    assert_equals(registry.get('a-b'), undefined);
     20 }, 'Defining an element in the global registry does not add a definition to a scoped CustomElementRegistry');
     21 
     22 test(() => {
     23    let registry = new CustomElementRegistry();
     24    registry.define('b-c', class extends HTMLElement {});
     25    assert_equals(window.customElements.get('b-c'), undefined);
     26 }, 'Defining an element in a scoped global registry does not add a definition to the global registry');
     27 
     28 </script>
     29 </body>
     30 </html>