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