Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / spatial-navigation / snav-z-index.html
blobb04e72b92f9a7462dc50e5d7a9c6f9a1536f6637
1 <html>
2 <head>
3 <script src="../../resources/js-test.js"></script>
4 <script src="resources/spatial-navigation-utils.js"></script>
5 <script type="application/javascript">
7 var resultMap = [
8 ["Down", "s22"],
9 ["Down", "p11"],
10 ["Down", "s23"],
11 ["Down", "p12"],
12 ["Down", "s24"],
13 ["Down", "s25"],
14 ["Up", "s24"],
15 ["Up", "p12"],
16 ["Right", "p22"],
17 ["Left", "p12"],
18 ["Left", "s24"],
19 ["Left", "s14"],
20 ["Up", "s13"],
21 ["Up", "s12"],
22 ["Right", "s22"],
23 ["Right", "p11"],
24 ["Right", "p21"],
25 ["Up", "start"],
26 ["DONE", "DONE"]
29 if (window.testRunner) {
30 testRunner.dumpAsText();
31 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
32 window.internals.settings.setSpatialNavigationEnabled(true);
33 testRunner.waitUntilDone();
36 function runTest()
38 // starting the test itself: get to a known place.
39 document.getElementById("start").focus();
41 initTest(resultMap, testCompleted);
44 function testCompleted()
46 if (window.testRunner)
47 testRunner.notifyDone();
50 window.onload = runTest;
51 </script>
52 <style>
53 div.simple { border: 3px solid red;}
54 div.simple:focus { border: 3px solid gray;}
55 div.positioned { border: 3px solid blue;}
56 div.positioned:focus{ border: 3px solid gray;}
57 #popup {position: absolute; top:120; left:240; border: 8px solid black; z-index:1000}
58 </style>
59 </head>
60 <body id="some-content" xmlns="http://www.w3.org/1999/xhtml" style="padding:20px">
61 <div id="popup">
62 <table><tr><td>
63 <div tabindex="1" id="p11" class="positioned"><img src="resources/green.png" width=160px height=60px></div>
64 <div tabindex="2" id="p12" class="positioned"><img src="resources/green.png" width=160px height=60px></div>
65 </td><td>
66 <div tabindex="1" id="p21" class="positioned"><img src="resources/green.png" width=160px height=60px></div>
67 <div tabindex="2" id="p22" class="positioned"><img src="resources/green.png" width=160px height=60px></div>
68 </td></tr></table>
69 </div>
71 <table>
72 <tr><td>
73 <div tabindex="1" id="s11" class="simple"><img src="resources/green.png" width=160px height=60px></div>
74 <div tabindex="2" id="s12" class="simple"><img src="resources/green.png" width=160px height=60px></div>
75 <div tabindex="3" id="s13" class="simple"><img src="resources/green.png" width=160px height=60px></div>
76 <div tabindex="4" id="s14" class="simple"><img src="resources/green.png" width=160px height=60px></div>
77 <div tabindex="5" id="s15" class="simple"><img src="resources/green.png" width=160px height=60px></div>
78 </td><td>
79 <div tabindex="1" id="start" class="simple"><img src="resources/green.png" width=160px height=60px></div>
80 <div tabindex="2" id="s22" class="simple"><img src="resources/green.png" width=160px height=60px></div>
81 <div tabindex="3" id="s23" class="simple"><img src="resources/green.png" width=160px height=60px></div>
82 <div tabindex="4" id="s24" class="simple"><img src="resources/green.png" width=160px height=60px></div>
83 <div tabindex="5" id="s25" class="simple"><img src="resources/green.png" width=160px height=60px></div>
84 </td></tr></table>
85 <div id="console"></div>
86 This test is testing that we can prefer the elements with higher Z indexes.
87 </body>
88 </html>