tor-browser

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

HTMLAnchorElement.html (1318B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 <title>Custom Elements: CEReactions on HTMLAnchorElement interface</title>
      5 <meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
      6 <meta name="assert" content="text of HTMLAnchorElement interface must have CEReactions">
      7 <meta name="help" content="https://dom.spec.whatwg.org/#node">
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="../resources/custom-elements-helpers.js"></script>
     11 <script src="./resources/reactions.js"></script>
     12 </head>
     13 <body>
     14 <div id="log"></div>
     15 <script>
     16 
     17 test_with_window(function (contentWindow, contentDocument) {
     18    const element = define_custom_element_in_window(contentWindow, 'custom-element', []);
     19    contentDocument.body.innerHTML = `<a><custom-element>hello</custom-element></a>`;
     20    const anchor = contentDocument.querySelector('a');
     21 
     22    assert_array_equals(element.takeLog().types(), ['constructed', 'connected']);
     23    assert_equals(anchor.innerHTML, '<custom-element>hello</custom-element>');
     24 
     25    anchor.text = 'world';
     26    assert_equals(anchor.innerHTML, 'world');
     27    assert_array_equals(element.takeLog().types(), ['disconnected']);
     28 }, 'text on HTMLAnchorElement must enqueue disconnectedCallback when removing a custom element');
     29 
     30 </script>
     31 </body>
     32 </html>