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

Unified Diff: LayoutTests/fast/events/tabindex-no-focusable.html

Issue 484383002: Disable the focus moves to an element which doesn't satisfy the spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test for Ver.2 Patch Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/tabindex-no-focusable-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/events/tabindex-no-focusable.html
diff --git a/LayoutTests/fast/events/tabindex-no-focusable.html b/LayoutTests/fast/events/tabindex-no-focusable.html
new file mode 100644
index 0000000000000000000000000000000000000000..52f5f5a78a40ce520366a6b0daee017aa5bf2771
--- /dev/null
+++ b/LayoutTests/fast/events/tabindex-no-focusable.html
@@ -0,0 +1,42 @@
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+var key = 0;
+function test()
+{
+ if (!window.testRunner)
+ return;
+
+ var elem_movetome = document.getElementById('MoveToMe')
+ var elem_focusme = document.getElementById('focusMe')
+ elem_focusme.focus();
+ eventSender.keyDown("\t");
+
+ var current_focus=(document.activeElement || window.getSelection().focusNode);
hayato 2014/09/03 05:25:26 document.activeElement isn't enough? Is there a st
+
+ if (!key && elem_movetome==current_focus) { // first test passed, continue with second test
hayato 2014/09/03 05:25:26 You need spaces around oprator, such as '=='.
hayato 2014/09/03 05:25:26 You don't need `key` variable anymore because you
+ elem_focusme.focus();
+ eventSender.keyDown("\t",["shiftKey"]);
+
+ current_focus=(document.activeElement || window.getSelection().focusNode);
+
+ if (!key && elem_movetome==current_focus) { // second test passed
hayato 2014/09/03 05:25:26 Ditto.
+ document.write("PASSED");
+ document.close();
+ return;
+ }
+ }
+ document.write("FAILED");
+ document.close();
+}
+</script>
+<body onload="test()">
+<input id="MoveToMe" tabindex="1">
+<input onfocus="key-=1" tabindex="-1">
+<input id="focusMe" tabindex="-1">
+<input onfocus="key+=1" tabindex="-1">
+<div id="results"></div>
+</body>
+
+
« no previous file with comments | « no previous file | LayoutTests/fast/events/tabindex-no-focusable-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698