content-visibility-with-top-layer-007.html (1308B)
1 <!doctype html> 2 <meta charset="utf8"> 3 <title>CSS Content Visibility: onscreen c-v auto content is relevant when in top layer</title> 4 <link rel="author" title="Cathie Chen" href="mailto:cathiechen@igalia.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 6 <meta name="assert" content="onscreen 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 <dialog id="dialog"> 20 <div id="inner"> 21 <div style="height: 200px; width: 200px;">content</div> 22 </div> 23 <div id="spacer" style="height: 100000px;"></div> 24 </dialog> 25 26 <script> 27 promise_test(async () => { 28 dialog.show(); 29 // It takes at least one frame to determine the proximity to the viewport. 30 await waitForAtLeastOneFrame(); 31 assert_equals(inner.getBoundingClientRect().height, 200); 32 33 dialog.close(); 34 dialog.showModal(); 35 36 // It takes at least one frame to determine the proximity to the viewport. 37 await waitForAtLeastOneFrame(); 38 assert_equals(inner.getBoundingClientRect().height, 200); 39 dialog.close(); 40 }); 41 </script>