Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / compositing / gestures / gesture-tapHighlight-simple-navigate.html
blob6566eb56f767b0009fec4efd042f060c66539d92
1 <!DOCTYPE html>
2 <html>
3 <body onload="runTest();">
4 <div style="position: relative; left: 10px; top: 40px">
5 <a href="" id="targetLink" style="-webkit-tap-highlight-color: rgba(0, 255, 0, 0.5)">Target Link.</a>
6 </div>
7 <!-- For this test to work, must put the translateZ(0) on a div other than the one containing the
8 highlighted link. This will force the highlight into the non-composited content host, which
9 may survive the navigation. -->
10 <div style="position: relative; left: 10px; top: 70px; transform: translateZ(0);">
11 This test is not successful if this message appears.
12 </div>
13 <script src="../../resources/run-after-layout-and-paint.js"></script>
14 <script>
15 function runTest() {
16 var clientRect = document.getElementById('targetLink').getBoundingClientRect();
17 x = (clientRect.left + clientRect.right) / 2;
18 y = (clientRect.top + clientRect.bottom) / 2;
19 if (window.testRunner)
20 testRunner.waitUntilDone();
22 if (window.eventSender) {
23 eventSender.gestureShowPress(x, y);
24 // Force display of highlight before navigating to second page.
25 runAfterLayoutAndPaint(function() {
26 window.location = 'resources/gesture-tapHighlight-simple-navigate-destination.html';
27 runAfterLayoutAndPaint(function() {
28 testRunner.notifyDone();
29 });
30 });
31 } else {
32 debug("This test requires DumpRenderTree.");
35 </script>
36 </body>
37 </html>