blob: 3bc92e52951d69a0a0221650f79b704f771a509e [file] [log] [blame]
<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>content-visibility hidden-matchable + scrollIntoView</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://github.com/WICG/display-locking">
<link rel="match" href="content-visibility-matchable-006-ref.html">
<meta name="assert" content="scrollIntoView scrolls to element under hidden-matchable">
<meta name="assert" content="scrollIntoView does not start painting hidden-matchable 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-matchable;
}
</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>