content-visibility-002.html (1040B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>CSS Content Visibility: hidden starts painting when removed</title> 5 <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> 7 <link rel="match" href="container-with-child-ref.html"> 8 <meta name="assert" content="content-visibility hidden subtrees start painting when hidden is removed"> 9 10 <script src="/common/reftest-wait.js"></script> 11 12 <style> 13 #container { 14 width: 150px; 15 height: 150px; 16 background: lightblue; 17 } 18 .hidden { 19 content-visibility: hidden; 20 } 21 #child { 22 width: 50px; 23 height: 50px; 24 background: green; 25 } 26 </style> 27 28 <div id=container class=hidden> 29 Test passes if you can see this text and a green box. 30 <div id=child></div> 31 </div> 32 33 <script> 34 function runTest() { 35 const container = document.getElementById("container"); 36 container.classList.remove("hidden"); 37 requestAnimationFrame(takeScreenshot); 38 } 39 40 window.onload = runTest; 41 </script> 42 </html>