| <!doctype HTML> |
| |
| <html class="reftest-wait"> |
| <meta charset="utf8"> |
| <title>CSS Content Visibility: hidden + scrollIntoView</title> |
| <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> |
| <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility"> |
| <link rel="match" href="content-visibility-059-ref.html"> |
| <meta name="assert" content="scrollIntoView scrolls to element under hidden, not just container"> |
| <meta name="assert" content="scrollIntoView does not start painting hidden content"> |
| <script src="/common/reftest-wait.js"></script> |
| |
| <style> |
| .spacer { |
| height: 1000px; |
| background: lightgreen; |
| } |
| #container { |
| width: 150px; |
| height: 150px; |
| background: lightblue; |
| } |
| #target { |
| position: relative; |
| top: 75px; |
| |
| width: 50px; |
| height: 50px; |
| background: red; |
| } |
| .hidden { |
| content-visibility: hidden; |
| } |
| </style> |
| |
| <div>top of the page</div> |
| <div class=spacer></div> |
| <div id=container class=hidden> |
| <div id=target></div> |
| </div> |
| <div class=spacer></div> |
| <div>bottom of the page</div> |
| |
| <script> |
| function runTest() { |
| document.getElementById("target").scrollIntoView(); |
| requestAnimationFrame(takeScreenshot); |
| } |
| |
| window.onload = requestAnimationFrame(() => { |
| requestAnimationFrame(() => { |
| requestAnimationFrame(() => { |
| runTest(); |
| }); |
| }); |
| }); |
| </script> |
| </html> |