Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / click-anchor-refocus-window.html
blobd83259f85af7dec29a526932fa6229695ee1c555
1 <!DOCTYPE html>
2 <html>
3 <head>
4 </head>
5 <body>
6 <p>This test ensures that the focus ring is not shown on the anchor after blurring and focusing the window.</p>
7 <a id="anchor" href="javascript:log('anchor was clicked')">Anchor</a>
8 <pre id="console">
9 </pre>
11 <script>
12 var anchor = document.getElementById('anchor');
13 window.onfocus = function() {
14 log('window was focused');
16 window.onblur = function() {
17 log('window was blurred');
19 anchor.onfocus = function() {
20 log('anchor was focused');
22 anchor.onblur = function() {
23 log('anchor was blurred');
25 window.onload = function() {
26 if (window.eventSender) {
27 // Click the link.
28 eventSender.mouseMoveTo(anchor.offsetLeft + 2, anchor.offsetTop + 2);
29 eventSender.mouseDown();
30 eventSender.mouseUp();
31 internals.setFocused(false);
32 internals.setFocused(true);
36 function log(message) {
37 var console = document.getElementById("console");
38 console.textContent += message + '\n';
40 </script>
41 </body>
42 </html>