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

Side by Side Diff: LayoutTests/fast/events/click-focus-anchor.html

Issue 455223002: Make anchors mouse-focusable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase 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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 5
6 <div id=test-container> 6 <div id=test-container>
7 <p><a id=a1 tabindex=0 title="focusable">Anchor with tab index</a> 7 <p><a id=a1 tabindex=0>Anchor with tab index</a>
8 <p><a id=a2 title="not focusable">Anchor without tab index</a> 8 <p><a id=a2>Anchor without tab index</a>
9 <p><a id=a3 href="#" title="not focusable">Link without tab index</a> 9 <p><a id=a3 href="#">Link without tab index</a>
10 <p><a id=a4 href="#" tabindex=0 title="focusable">Link with tab index</a> 10 <p><a id=a4 href="#" tabindex=0>Link with tab index</a>
11 <p><a id=a5 href="#" contentEditable title="focusable">Link with contentEditable </a> 11 <p><a id=a5 href="#" contentEditable>Link with contentEditable</a>
12 <p contenteditable id="p6" title="focusable"><a id=a6 href="#" title="not focusa ble">Link inside contentEditable</a> 12 <p contenteditable id="p6"><a id=a6 href="#" title="not focusable">Link inside c ontentEditable</a>
13 <p tabindex="1" id="p7" title="focusable"><a id="a7" href="#" title="not focusab le">Link inside an elment with tabindex</a> 13 <p tabindex="1" id="p7"><a id="a7" href="#">Link inside an elment with tabindex< /a>
14 </div> 14 </div>
15 15
16 <div id="console"></div> 16 <div id="console"></div>
17 17
18 <script> 18 <script>
19 description('This test ensures that we can click to focus an a element.'); 19 description('This test ensures that we can click to focus an a element.');
20 20
21 function handleFocus(e) { 21 function handleFocus(e) {
22 var el = e.target; 22 var el = e.target;
23 debug(el.id + ' received focus (' + el.title + ')'); 23 debug(el.id + ' received focus');
24 } 24 }
25 25
26 document.addEventListener('focus', handleFocus, true); 26 document.addEventListener('focus', handleFocus, true);
27 if (window.testRunner) { 27 if (window.testRunner) {
28 for (var i = 1; i <= 7; i++) { 28 for (var i = 1; i <= 7; i++) {
29 var aElement = document.getElementById('a' + i); 29 var aElement = document.getElementById('a' + i);
30 eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2) ; 30 eventSender.mouseMoveTo(aElement.offsetLeft + 2, aElement.offsetTop + 2) ;
31 eventSender.mouseDown(); 31 eventSender.mouseDown();
32 eventSender.mouseUp(); 32 eventSender.mouseUp();
33 } 33 }
34 34
35 var tc = document.getElementById('test-container'); 35 var tc = document.getElementById('test-container');
36 tc.parentNode.removeChild(tc); 36 tc.parentNode.removeChild(tc);
37 } else { 37 } else {
38 debug('Need testRunner.'); 38 debug('Need testRunner.');
39 } 39 }
40 40
41 </script> 41 </script>
42 </body> 42 </body>
43 </html> 43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698