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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/tabindex-no-focusable-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <script>
2 if (window.testRunner)
3 testRunner.dumpAsText();
4
5 var key = 0;
6 function test()
7 {
8 if (!window.testRunner)
9 return;
10
11 var elem_movetome = document.getElementById('MoveToMe')
12 var elem_focusme = document.getElementById('focusMe')
13 elem_focusme.focus();
14 eventSender.keyDown("\t");
15
16 var current_focus=(document.activeElement || window.getSelection().focusNode );
hayato 2014/09/03 05:25:26 document.activeElement isn't enough? Is there a st
17
18 if (!key && elem_movetome==current_focus) { // first test passed, continue w ith 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
19 elem_focusme.focus();
20 eventSender.keyDown("\t",["shiftKey"]);
21
22 current_focus=(document.activeElement || window.getSelection().focusNode );
23
24 if (!key && elem_movetome==current_focus) { // second test passed
hayato 2014/09/03 05:25:26 Ditto.
25 document.write("PASSED");
26 document.close();
27 return;
28 }
29 }
30 document.write("FAILED");
31 document.close();
32 }
33 </script>
34 <body onload="test()">
35 <input id="MoveToMe" tabindex="1">
36 <input onfocus="key-=1" tabindex="-1">
37 <input id="focusMe" tabindex="-1">
38 <input onfocus="key+=1" tabindex="-1">
39 <div id="results"></div>
40 </body>
41
42
OLDNEW
« 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