content-visibility-043.html (1093B)
1 <!doctype HTML> 2 <html class="reftest-wait"> 3 <meta charset="utf8"> 4 <title>Content Visibility: scroll child into view, and adopt to a document</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="scrollIntoView on a hidden subtree is a no-op"> 9 <meta name="assert" content="adopting an element in a hidden subtree works (no asserts / crashes)"> 10 11 <script src="/common/reftest-wait.js"></script> 12 13 <style> 14 #container { 15 width: 150px; 16 height: 150px; 17 background: lightblue; 18 color: red; 19 } 20 .hidden { 21 content-visibility: hidden; 22 } 23 </style> 24 <div id=container class=hidden> 25 FAIL. 26 <div id=child></div> 27 </div> 28 29 <script> 30 function moveChild() { 31 child.scrollIntoView(); 32 document.implementation.createDocument( "", null).adoptNode(child); 33 requestAnimationFrame(takeScreenshot); 34 } 35 36 async function runTest() { 37 requestAnimationFrame(moveChild); 38 } 39 40 window.onload = requestAnimationFrame(runTest); 41 </script>