chromium/third_party/blink/web_tests/compositing/gestures/gesture-tapHighlight-1-overflow-div-scrolled-late-noncomposite.html

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script src="resources/link-highlight-helper.js"></script>
<link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
</head>
<body onload="runTest();">
<div style="will-change: transform; position: relative; left: 10px; top: 10px"></div>
<div id="targetDiv" style="position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;">
<div id="divToControlCompositedLayer" style="will-change: transform;">
<a href="">AAAAAA</a><br>
<a href="">AAAAAA</a><br>
<a href="">AAAAAA</a><br>
<a class="opaqueHighlight needsFix" href="" id="targetLink">Target Link.</a><br>
<a href="">AAAAAA</a><br>
<a href="">AAAAAA</a><br>
</div></div>
<div style="position: relative; left: 10px; top: 80px">
This test is successful if "Target Link" above is covered in a green rectangle with square corners.
</div>
<script>
function runTest() {
    useMockHighlight();
    var targetDiv = document.getElementById('targetDiv');
    var clientRect = document.getElementById('targetLink').getBoundingClientRect();
    x = (clientRect.left + clientRect.right) / 2;
    y = (clientRect.top + clientRect.bottom) / 2;
    if (window.testRunner)
        testRunner.waitUntilDone();

    // This test highlights a link in a composited overflow-div, then forces that div to become non-composited,
    // then scrolls that div, then exits. If everything is working correctly, the link highlight will still
    // be displayed correctly after all these operations.
    if (window.eventSender && window.testRunner) {
        eventSender.gestureShowPress(x, y);
        runAfterLayoutAndPaint(function() {
            document.getElementById('divToControlCompositedLayer').style.webkitTransform = "";
            runAfterLayoutAndPaint(function() {
                targetDiv.scrollTop += 20;
                testRunner.notifyDone();
            });
        });
    } else {
        debug("This test requires DumpRenderTree.");
    }
}
</script>
</script>
</body>
</html>