tor-browser

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

popover-removal-2.html (1200B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8" />
      3 <title>Popover document removal behavior</title>
      4 <link rel="author" href="mailto:masonf@chromium.org">
      5 <link rel=help href="https://open-ui.org/components/popover.research.explainer">
      6 <link rel=help href="https://html.spec.whatwg.org/multipage/popover.html">
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 
     10 <iframe id=frame1 srcdoc="<div popover id=popover>Popover</div>"></iframe>
     11 <iframe id=frame2></iframe>
     12 
     13 <script>
     14  window.onload = () => {
     15    test(t => {
     16      const frame1Doc = document.getElementById('frame1').contentDocument;
     17      const frame2Doc = document.getElementById('frame2').contentDocument;
     18      const popover = frame1Doc.querySelector('[popover]');
     19      assert_true(!!popover);
     20      assert_false(popover.matches(':popover-open'));
     21      popover.showPopover();
     22      assert_true(popover.matches(':popover-open'));
     23      frame2Doc.body.appendChild(popover);
     24      assert_false(popover.matches(':popover-open'));
     25      popover.showPopover();
     26      assert_true(popover.matches(':popover-open'));
     27    }, 'Moving popover between documents shouldn\'t cause issues');
     28  };
     29 </script>