chromium/third_party/blink/web_tests/external/wpt/css/css-contain/content-visibility/content-visibility-vs-scrollIntoView-001-ref.html

<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>Nested CSS Content Visibility: auto + scrollIntoView</title>
<link rel="author" title="Cathie Chen" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
<meta name="assert" content="Test if target scrollIntoView is visible when it is inside a nested content-visibility: auto">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<script src="/common/reftest-wait.js"></script>

<style>

    .child {
        height: 40000px;
        position: relative;
    }

    #target {
        position: absolute;
        bottom: 0;
        font: 25px/1 Ahem;
    }

    .before_target {
        height: 40000px;
    }
</style>

<div id=e1 class="before_target"></div>
<div id=e2 class="before_target"></div>
<div id=e3 class="before_target"></div>
<div id=e4 class="before_target"></div>
<div id=e5 class=child>
    <div id=target>PASS</div>
</div>

<script>
    window.onload = () => {
        target.scrollIntoView();
        requestAnimationFrame(takeScreenshot);
    }
</script>