Upstream version 6.35.121.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / compositing / gestures / gesture-tapHighlight-simple-navigate.html
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; -webkit-transform: translateZ(0);">
11 This test is not successful if this message appears.
12 </div>
13 <script src="../../resources/run-after-display.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();
21
22     if (window.eventSender) {
23         eventSender.gestureShowPress(x, y);
24         // Force display of highlight before navigating to second page.
25         runAfterDisplay(function() {
26             window.location = 'resources/gesture-tapHighlight-simple-navigate-destination.html';
27             runAfterDisplay(function() {
28                 testRunner.notifyDone();
29             });
30         });
31     } else {
32         debug("This test requires DumpRenderTree.");
33     }
34 }
35 </script>
36 </body>
37 </html>