Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / events / click-svganchor-refocus-window.html
blob30a6f58a00cc7184ad8ca2fa27738763f53659c8
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 <p><svg width="500" height="30"><a id="anchor" xlink:href="javascript:log('anchor was clicked')"><text font-size="18px" y="20">Anchor</text></a></svg></p>
8 <pre id="console">
9 </pre>
11 <script>
12 // This test differs from click-anchor-refocus-window.html in two ways:
13 // 1. getBoundingClientRect().top/left is used instead of .offsetLeft/Top,
14 // because offsetLeft is relative to the <svg> element.
15 // 2. document.activeElement is checked instead of using anchor.onfocus/onblur,
16 // because the presence of focus events causes a focus ring to be shown on
17 // the SVG anchor (https://crbug.com/445798).
18 var anchor = document.getElementById('anchor');
19 window.onfocus = function() {
20 log('window was focused');
22 window.onblur = function() {
23 log('window was blurred');
25 window.onload = function() {
26 if (window.eventSender) {
27 // Click the link.
28 var anchorRect = anchor.getBoundingClientRect();
29 eventSender.mouseMoveTo(anchorRect.left + 2, anchorRect.top + 2);
30 eventSender.mouseDown();
31 eventSender.mouseUp();
32 log('activeElement is ' + (document.activeElement == anchor ? 'anchor' : document.activeElement));
33 internals.setFocused(false);
34 internals.setFocused(true);
35 log('activeElement is ' + (document.activeElement == anchor ? 'anchor' : document.activeElement));
39 function log(message) {
40 var console = document.getElementById("console");
41 console.textContent += message + '\n';
43 </script>
44 </body>
45 </html>