4 <script src="../../resources/js-test.js"></script>
5 <script src="../../resources/run-after-display.js"></script>
6 <script src="resources/link-highlight-helper.js"></script>
7 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
9 <body onload="runTest();">
10 <div style="transform: translateZ(0); position: relative; left: 10px; top: 10px"></div>
11 <div id="targetDiv" style="position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;">
12 <div id="divToControlCompositedLayer" style="transform: translateZ(0);">
13 <a href="">Link 1</a><br>
14 <a href="">Link 2</a><br>
15 <a href="">Link 3</a><br>
16 <a class="opaqueHighlight needsFix" href="" id="targetLink">Target Link.</a><br>
17 <a href="">Link 4</a><br>
18 <a href="">Link 5</a><br>
20 <div style="position: relative; left: 10px; top: 80px">
21 This test is successful if "Target Link" above is covered in a green rectangle with square corners.
26 var targetDiv = document.getElementById('targetDiv');
27 var clientRect = document.getElementById('targetLink').getBoundingClientRect();
28 x = (clientRect.left + clientRect.right) / 2;
29 y = (clientRect.top + clientRect.bottom) / 2;
30 if (window.testRunner) {
31 testRunner.dumpAsTextWithPixelResults();
32 testRunner.waitUntilDone();
35 // This test highlights a link in a composited overflow-div, then forces that div to become non-composited,
36 // then scrolls that div, then exits. If everything is working correctly, the link highlight will still
37 // be displayed correctly after all these operations.
38 if (window.eventSender && window.testRunner) {
39 eventSender.gestureShowPress(x, y);
40 runAfterDisplay(function() {
41 document.getElementById('divToControlCompositedLayer').style.webkitTransform = "";
42 runAfterDisplay(function() {
43 targetDiv.scrollTop += 20;
44 testRunner.notifyDone();
48 debug("This test requires DumpRenderTree.");