Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / scrollbars / scrollbar-iframe-click-does-not-blur-content.html
blob7d9a9a22bcd4a470d7bf27b6f5aa4a290de01ef1
1 <html>
2 <head>
3 <script>
4 if (window.testRunner) {
5 testRunner.dumpAsText();
6 testRunner.waitUntilDone();
9 function runTest()
11 window.frames[0].document.getElementById("textField").focus();
13 if (window.eventSender) {
14 var frame = document.getElementById("anIFrame");
16 // center the mouse cursor (NOTE: 2px inset for scrollbars).
17 var x = frame.offsetParent.offsetLeft + frame.contentDocument.body.clientWidth + 8;
18 var y = frame.offsetParent.offsetTop + frame.offsetHeight / 2;
20 // send mouse event to click iframe's scrollbar.
21 eventSender.mouseMoveTo(x, y);
22 eventSender.mouseDown();
23 eventSender.mouseUp();
24 finished();
28 function finished()
30 var doc = window.frames[0].document;
32 if (doc.hasFocus() && doc.activeElement.getAttribute("id") == "textField")
33 document.getElementById('console').innerHTML = "PASS";
34 else
35 document.getElementById('console').innerHTML = "FAIL";
37 if (window.testRunner)
38 window.testRunner.notifyDone();
41 </script>
42 </head>
44 <body>
45 <div id="console" style="left:50px;top:50px;width:200px;height:200px;position:absolute;">
46 <iframe onload="runTest();" id="anIFrame" style="width:200px;height:200px;position:absolute;" src="resources/scrollable-iframe-with-input-field.html">
47 </div>
48 </body>
49 </html>