content-visibility-088.html (1112B)
1 <!doctype HTML> 2 <html> 3 <meta charset="utf8"> 4 <title>Content Visibility: getClientRects measures correctly</title> 5 <link rel="author" title="Rob Buis" href="mailto:rbuis@igalia.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 7 <meta name="assert" content="getClientRects measures correctly in content-visibility hidden subtree"> 8 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 12 <style> 13 body { 14 margin: 0; 15 padding: 0; 16 } 17 #outer { 18 width: 100px; 19 background: lightblue; 20 21 content-visibility: hidden; 22 } 23 #inner { 24 margin: 25px; 25 width: 50px; 26 height: 50px; 27 background: lightgreen; 28 } 29 </style> 30 31 <body> 32 <div id="outer"><div id="inner"></div></div> 33 </body> 34 35 <script> 36 test(() => { 37 const outer = document.getElementById("outer"); 38 assert_equals(outer.getClientRects()[0].height, 0, "outer height"); 39 40 const inner = document.getElementById("inner"); 41 assert_equals(inner.getClientRects()[0].width, 50, "inner width"); 42 assert_equals(inner.getClientRects()[0].height, 50, "inner height"); 43 }); 44 45 </script> 46 </html>