tor-browser

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

scoped-custom-element-registry-customelementregistry-attribute-in-xhtml.xhtml (1841B)


      1 <?xml version="1.0" encoding="utf-8"?>
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <head>
      4 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org"/>
      5 <link rel="help" href="https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-initialize"/>
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 </head>
      9 <body>
     10 <script>
     11 <![CDATA[
     12 
     13 customElements.define('c-d', class ABElement extends HTMLElement { });
     14 
     15 ]]>
     16 </script>
     17 <div id="container"><a-b customelementregistry=""></a-b><c-d customelementregistry=""></c-d></div>
     18 <script>
     19 <![CDATA[
     20 
     21 const container = document.getElementById('container');
     22 test((test) => {
     23    assert_equals(container.querySelector('a-b').customElementRegistry, null);
     24 }, `XHTML parser should create a custom element candidate with null registry if customelementregistry is set`);
     25 
     26 test((test) => {
     27    assert_equals(container.querySelector('c-d').customElementRegistry, null);
     28 }, `XHTML parser should create a defined custom element with null registry if customelementregistry is set`);
     29 
     30 test((test) => {
     31    container.setHTMLUnsafe(`<a-b customelementregistry></a-b>`);
     32    assert_equals(container.querySelector('a-b').customElementRegistry, null);
     33 }, `XHTML fragment parser should create a custom element candidate with null registry if customelementregistry is set`);
     34 
     35 test((test) => {
     36    container.setHTMLUnsafe(`<c-d></c-d>`);
     37    assert_equals(container.querySelector('c-d').customElementRegistry, window.customElements);
     38    container.setHTMLUnsafe(`<c-d customelementregistry></c-d>`);
     39    assert_equals(container.querySelector('c-d').customElementRegistry, null);
     40 }, `XHTML fragment parser should create a defined custom element with null registry if customelementregistry is set`);
     41 
     42 ]]>
     43 </script>
     44 </body>
     45 </html>