content-visibility-006.html (1033B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>CSS Content Visibility: hidden stops painting when added (composited)</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-ref.html"> 8 <meta name="assert" content="content-visibility subtrees stop painting when hidden is added"> 9 10 <script src="/common/reftest-wait.js"></script> 11 12 <style> 13 #container { 14 width: 150px; 15 height: 150px; 16 background: lightblue; 17 will-change: transform; 18 } 19 .hidden { 20 content-visibility: hidden; 21 } 22 #child { 23 width: 50px; 24 height: 50px; 25 background: red; 26 } 27 </style> 28 29 <div id=container> 30 Test fails if you can see this text or a red box. 31 <div id=child></div> 32 </div> 33 34 <script> 35 function runTest() { 36 const container = document.getElementById("container"); 37 container.classList.add("hidden"); 38 requestAnimationFrame(takeScreenshot); 39 } 40 41 window.onload = runTest; 42 </script> 43 </html>