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

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: add test Created 6 years, 4 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
OLDNEW
1 <script> 1 <script>
2 if (window.testRunner) 2 if (window.testRunner)
3 testRunner.dumpAsText(); 3 testRunner.dumpAsText();
4 4
5 var key = 0; 5 var key = 0;
6 function test() 6 function test()
7 { 7 {
8 if (!window.testRunner) 8 if (!window.testRunner)
9 return; 9 return;
10 10
11 var elem = document.getElementById('focusMe') 11 var elem = document.getElementById('focusMe')
12 key = -1;
13 elem.focus(); 12 elem.focus();
14 eventSender.keyDown("\t"); 13 eventSender.keyDown("\t");
15 14
16 if (!key) { // first test passed, continue with second test 15 if (!key) { // first test passed, continue with second test
17 key = 1;
18 elem.focus(); 16 elem.focus();
19 eventSender.keyDown("\t",["shiftKey"]); 17 eventSender.keyDown("\t",["shiftKey"]);
20 18
21 if (!key) { // second test passed 19 if (!key) { // second test passed
22 document.write("PASSED"); 20 document.write("PASSED");
23 document.close(); 21 document.close();
24 return; 22 return;
25 } 23 }
26 } 24 }
27 document.write("FAILED"); 25 document.write("FAILED");
28 document.close(); 26 document.close();
29 } 27 }
30 </script> 28 </script>
31 <body onload="test()"> 29 <body onload="test()">
32 <input onfocus="key-=1"> 30 <input onfocus="key-=1" tabindex="-1">
33 <input id="focusMe" tabindex="-1"> 31 <input id="focusMe" tabindex="-1">
34 <input onfocus="key+=1"> 32 <input onfocus="key+=1" tabindex="-1">
35 <div id="results"></div> 33 <div id="results"></div>
36 </body> 34 </body>
35
36
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698