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

Unified Diff: LayoutTests/fast/events/tabindex-no-focusable-all-negative.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: Fix Test 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
Index: LayoutTests/fast/events/tabindex-no-focusable-all-negative.html
diff --git a/LayoutTests/fast/events/tabindex-focus-chain.html b/LayoutTests/fast/events/tabindex-no-focusable-all-negative.html
similarity index 53%
copy from LayoutTests/fast/events/tabindex-focus-chain.html
copy to LayoutTests/fast/events/tabindex-no-focusable-all-negative.html
index 0432e8099244277f311ee2dca28d8bcb2f2d44ac..323dd4327d8e5bb956dbbc72e5ebabf92a50722d 100644
--- a/LayoutTests/fast/events/tabindex-focus-chain.html
+++ b/LayoutTests/fast/events/tabindex-no-focusable-all-negative.html
@@ -2,23 +2,22 @@
if (window.testRunner)
testRunner.dumpAsText();
-var key = 0;
function test()
{
if (!window.testRunner)
return;
-
- var elem = document.getElementById('focusMe')
- key = -1;
- elem.focus();
+ var elem_focusme = document.getElementById('focusMe');
+ elem_focusme.focus();
+
eventSender.keyDown("\t");
-
- if (!key) { // first test passed, continue with second test
- key = 1;
- elem.focus();
+ var current_focus = document.activeElement;
hayato 2014/09/12 04:37:12 You might want to get rid of current_focus variabl
yanagawa 2014/09/12 06:04:48 Done.
+
+ if (current_focus == elem_focusme) { // first test passed, continue with second test
hayato 2014/09/12 04:37:12 This comment doesn't give us much value. You can r
yanagawa 2014/09/12 06:04:48 Done.
+ elem_focusme.focus();
eventSender.keyDown("\t",["shiftKey"]);
+ current_focus = document.activeElement;
- if (!key) { // second test passed
+ if (current_focus == elem_focusme) { // second test passed
hayato 2014/09/12 04:37:12 Ditto.
yanagawa 2014/09/12 06:04:48 Done.
document.write("PASSED");
hayato 2014/09/12 04:37:12 I am not fan of using document,write() in testing.
yanagawa 2014/09/12 06:04:48 Done.
document.close();
return;
@@ -29,8 +28,8 @@ function test()
}
</script>
<body onload="test()">
-<input onfocus="key-=1">
+<input tabindex="-1">
<input id="focusMe" tabindex="-1">
-<input onfocus="key+=1">
+<input tabindex="-1">
<div id="results"></div>
hayato 2014/09/12 04:37:12 It seems this #result div is not used.
yanagawa 2014/09/12 06:04:48 Done.
</body>

Powered by Google App Engine
This is Rietveld 408576698