Index: LayoutTests/fast/spatial-navigation/snav-css-nav-direction.html |
diff --git a/LayoutTests/fast/spatial-navigation/snav-css-nav-direction.html b/LayoutTests/fast/spatial-navigation/snav-css-nav-direction.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ec020b6b1af0975048d2087d230bb6f41a953b9f |
--- /dev/null |
+++ b/LayoutTests/fast/spatial-navigation/snav-css-nav-direction.html |
@@ -0,0 +1,96 @@ |
+<!DOCTYPE html> |
+ <head> |
+ <script src="../js/resources/js-test-pre.js"></script> |
+ <script src="resources/spatial-navigation-utils.js"></script> |
+ <script src="js/resources/js-test-post.js"></script> |
+ </head> |
+ <style> |
+ #e2 { |
+ nav-left: #e4; |
+ } |
+ #e4 { |
+ nav-left: #e6; |
+ } |
+ #e5 { |
+ nav-right: #e9; |
+ nav-up: #e2; |
+ } |
+ #e6 { |
+ nav-down: #e8; |
+ } |
+ #e8 { |
+ nav-down: #e5; |
+ } |
+ #e9 { |
+ nav-up: #e9; |
+ nav-right: #e5; |
+ } |
+ </style> |
+ <body id="some-content" xmlns="http://www.w3.org/1999/xhtml"> |
+ <p id="description"></p> |
+ <table style="text-align: left; width: 100%; margin-left: auto; margin-right: auto;" border="1" cellpadding="2" cellspacing="1"> |
+ <tbody> |
+ <tr> |
+ <td style="vertical-align: top; text-align: center;"><a id="e1" href="a">1</a></td> |
+ <td style="vertical-align: top; text-align: center;"><a id="e2" href="a">2</a></td> |
+ <td style="vertical-align: top; text-align: center;"><a id="e3" href="a">3</a></td> |
+ </tr> |
+ <tr> |
+ <td style="vertical-align: top; text-align: center;"><a id="e4" href="a">4</a></td> |
+ <td style="vertical-align: top; text-align: center;"><a id="e5" href="5">5</td> |
+ <td style="vertical-align: top; text-align: center;"><a id="e6" href="a">6</a></td> |
+ </tr> |
+ <tr> |
+ <td style="vertical-align: top; text-align: center;"><a id="e7" href="a">7</a></td> |
+ <td style="vertical-align: top; text-align: center;"><a id="e8" href="a">8</a></td> |
+ <td style="vertical-align: top; text-align: center;"><a id="e9" href="a">9</a></td> |
+ </tr> |
+ </tbody> |
+ </table> |
+ <div id="console"></div> |
+ <script type="application/javascript"> |
+ description('This test ensures the correctness of Spatial Navigation (SNav) when CSS3 nav-up/down/left/right properties are set.<br>\ |
+ * Pre-conditions:<br>\ |
+ 1) DRT support for SNav enable/disable.<br>\ |
+ * Navigation steps:<br>\ |
+ 1) Loads this page, focus goes to start position (element #e5) automatically.<br>\ |
+ 2) Focus moves away from start postion in various direction, CSS nav-* attributes are expected to be respected.<br>'); |
+ |
+ var resultMap = [ |
+ ["Right", "e9"], |
+ ["Up", "e9"], |
+ ["Right", "e5"], |
+ ["Up", "e2"], |
+ ["Left", "e4"], |
+ ["Left", "e6"], |
+ ["Down", "e8"], |
+ ["Down", "e5"], |
+ ["DONE", "DONE"] |
+ ]; |
+ |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.overridePreference("WebKitTabToLinksPreferenceKey", 1); |
+ window.internals.settings.setSpatialNavigationEnabled(true); |
+ testRunner.waitUntilDone(); |
+ } |
+ |
+ function runTest() |
+ { |
+ // starting the test itself: get to a known place. |
+ document.getElementById("e5").focus(); |
+ |
+ initTest(resultMap, testCompleted); |
+ } |
+ |
+ function testCompleted() |
+ { |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ |
+ window.onload = runTest; |
+ |
+ </script> |
+ </body> |
+</html> |