content-visibility-051.html (1084B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>CSS Content Visibility: switching to block stop painting</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 has no effect on non-atomic inlines, but switching to block stop painting"> 9 10 <script src="/common/reftest-wait.js"></script> 11 12 <style> 13 #container { 14 content-visibility: hidden; 15 width: 150px; 16 height: 150px; 17 background: lightblue; 18 } 19 .inline { 20 display: inline; 21 } 22 #child { 23 width: 50px; 24 height: 50px; 25 background: red; 26 } 27 </style> 28 29 <div id=container class=inline> 30 Test fails if you see this text or a red box. 31 <div id=child></div> 32 <span>Fail.</span> 33 </div> 34 35 <script> 36 function runTest() { 37 const container = document.getElementById("container"); 38 container.classList.remove("inline"); 39 takeScreenshot(); 40 } 41 42 window.onload = () => requestAnimationFrame(runTest); 43 </script> 44 </html>