tor-browser

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

content-visibility-with-popover-top-layer-006.html (1360B)


      1 <!doctype html>
      2 <meta charset="utf8">
      3 <title>CSS Content Visibility: offscreen c-v auto content is relevant when in top layer</title>
      4 <link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com">
      5 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
      6 <meta name="assert" content="offscreen c-v auto content is relevant when in top layer">
      7 
      8 <script src="/resources/testharness.js"></script>
      9 <script src="/resources/testharnessreport.js"></script>
     10 <script src="/common/rendering-utils.js"></script>
     11 
     12 <style>
     13 #inner {
     14    content-visibility: auto;
     15    contain-intrinsic-size: 100px 100px;
     16 }
     17 </style>
     18 
     19 <div popover id="popover">
     20    <div id="spacer" style="height: 100000px;"></div>
     21    <div id="inner">
     22        <div style="height: 200px; width: 200px;">content</div>
     23    </div>
     24 </div>
     25 
     26 <script>
     27 promise_test(async () => {
     28    popover.showPopover();
     29    // It takes at least one frame to determine the proximity to the viewport.
     30    await waitForAtLeastOneFrame();
     31 
     32    // Even though the element with `content-visibility: auto` has an ancestor
     33    // in the top layer, this element is not in the top layer list (although
     34    // it's in the top layer stacking context). This means it should not be
     35    // relevant to the user, because it is not onscreen.
     36    assert_equals(inner.getBoundingClientRect().height, 100);
     37 });
     38 </script>