Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / gestures / gesture-tapHighlight-1-overflow-div-scrolled-late-composite.html
bloba2cc27546cd0238227ff13d46ec02d7d4a712ce0
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <link rel="stylesheet" type="text/css" href="resources/link-highlight-style.css">
5 <script src="resources/link-highlight-helper.js"></script>
6 </head>
7 <body onload="runTest();">
8 <div style="transform: translateZ(0); position: relative; left: 10px; top: 10px"></div>
9 <div id="targetDiv" style="position: relative; left: 10px; top: 40px; width: 200px; height: 100px; overflow-y: scroll; overflow-x: scroll;">
10 <div id="divToForceCompositedLayer">
11 <a href="">Link 1</a><br>
12 <a href="">Link 2</a><br>
13 <a href="">Link 3</a><br>
14 <a class="opaqueHighlight" href="" id="targetLink">Target Link.</a><br>
15 <a href="">Link 4</a><br>
16 <a href="">Link 5</a><br>
17 </div></div>
18 <div style="position: relative; left: 10px; top: 80px">
19 This test is successful if "Target Link" above is covered in a green rectangle with square corners.
20 </div>
21 <script src="../../resources/run-after-layout-and-paint.js"></script>
22 <script>
23 function runTest() {
24 useMockHighlight();
25 var targetDiv = document.getElementById('targetDiv');
26 var clientRect = document.getElementById('targetLink').getBoundingClientRect();
27 x = (clientRect.left + clientRect.right) / 2;
28 y = (clientRect.top + clientRect.bottom) / 2;
29 if (window.testRunner) {
30 testRunner.dumpAsTextWithPixelResults();
31 testRunner.waitUntilDone();
34 // This test highlights a link in a non-composited overflow-div, then forces that div to become composited,
35 // then scrolls that div, then exits. If everything is working correctly, the link highlight will still
36 // be displayed correctly after all these operations.
37 if (window.eventSender && window.testRunner) {
38 eventSender.gestureShowPress(x, y);
39 runAfterLayoutAndPaint(function() {
40 document.getElementById('divToForceCompositedLayer').style.webkitTransform = 'translateZ(0)';
41 document.body.offsetTop;
42 runAfterLayoutAndPaint(function() {
43 targetDiv.scrollTop += 20;
44 testRunner.notifyDone();
45 });
46 });
47 } else {
48 debug("This test requires DumpRenderTree.");
51 </script>
52 </body>
53 </html>