Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: LayoutTests/fast/spatial-navigation/snav-symmetrically-positioned.html

Issue 797463003: spatnav: Allow focus move to a close-by not-fully-aligned node over a distant but fully-aligned nod… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <head> 2 <head>
3 <script src="../../resources/js-test.js"></script> 3 <script src="../../resources/js-test.js"></script>
4 <script src="resources/spatial-navigation-utils.js"></script> 4 <script src="resources/spatial-navigation-utils.js"></script>
5 </head> 5 </head>
6 <style> 6 <style>
7 body a { 7 body a {
8 position: absolute; 8 position: absolute;
9 height: 100px; 9 height: 100px;
10 width: 100px; 10 width: 100px;
11 border: 1px solid black; 11 border: 1px solid black;
12 } 12 }
13 #e1 { 13 #e1 {
14 left: 10px; 14 left: 100px;
15 top: 210px; 15 top: 150px;
16 } 16 }
17 #e2 { 17 #e2 {
18 left: 60px; 18 left: 400px;
19 top: 330px; 19 top: 150px;
20 } 20 }
21 #e3 { 21 #e3 {
22 left: 60px; 22 left: 250px;
23 top: 300px;
24 }
25 #e4 {
26 left: 100px;
23 top: 450px; 27 top: 450px;
24 width: 150px; 28 }
29 #e5 {
30 left: 400px;
31 top: 450px;
25 } 32 }
26 </style> 33 </style>
27 <body id="some-content" onload="runTest()"> 34 <body id="some-content" onload="runTest()">
28 <p id="description"></p> 35 <p id="description"></p>
29 <div id="elements"> 36 <div id="elements">
30 <a id="e1" href="#e1">Element 1</a> 37 <a id="e1" href="#e1">Element 1</a>
31 <a id="e2" href="#e2">Element 2</a> 38 <a id="e2" href="#e2">Element 2</a>
32 <a id="e3" href="#e3">Element 3</a> 39 <a id="e3" href="#e3">Element 3</a>
40 <a id="e4" href="#e4">Element 4</a>
41 <a id="e5" href="#e5">Element 5</a>
33 </div> 42 </div>
34 <div id="console"></div> 43 <div id="console"></div>
35 <script type="application/javascript"> 44 <script type="application/javascript">
36 description('This test ensures that e2 is NOT right of e1 and e3 is NOT right of e2.'); 45 description('This test ensures that Spatial Navigation works with symmetrically positoned rects');
37 46
38 jsTestIsAsync = true; 47 jsTestIsAsync = true;
39 48
40 var resultMap = [ 49 var resultMap = [
41 ["Right", "e1"], 50 ["Down", "e3"],
42 ["Down", "e2"], 51 ["Down", "e4"],
52 ["Up", "e3"],
53 ["Up", "e1"],
43 ["Right", "e2"], 54 ["Right", "e2"],
44 ["Down", "e3"], 55 ["Down", "e3"],
45 ["Left", "e3"], 56 ["Down", "e4"],
46 ["Up", "e2"], 57 ["Right", "e5"],
47 ["Left", "e2"],
48 ["Up", "e1"],
49 ["DONE", "DONE"] 58 ["DONE", "DONE"]
50 ]; 59 ];
51 60
52 if (window.testRunner) { 61 if (window.testRunner) {
53 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1); 62 testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1);
54 window.internals.settings.setSpatialNavigationEnabled(true); 63 window.internals.settings.setSpatialNavigationEnabled(true);
55 } 64 }
56 65
57 function runTest() 66 function runTest()
58 { 67 {
59 // starting the test itself: get to a known place. 68 // starting the test itself: get to a known place.
60 document.getElementById("e1").focus(); 69 document.getElementById("e1").focus();
61 70
62 initTest(resultMap, finishJSTest); 71 initTest(resultMap, finishJSTest);
63 } 72 }
64 </script> 73 </script>
65 </body> 74 </body>
66 </html> 75 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698