Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / search-click-in-placeholder.html
blob17b18c37be75f03627511af7e212dffd7ddb16e5
1 <body onload="test()">
2 <input type="search" id="target" placeholder="Placeholder text" onfocus="window.hasFocus=1">
3 <pre id="console"></pre>
4 <script>
5 var hasFocus = 0;
7 function log(message) {
8 document.getElementById("console").appendChild(document.createTextNode(message + "\n"));
11 function test() {
12 if (!window.eventSender)
13 return;
15 testRunner.dumpAsText();
17 var target = document.getElementById("target");
18 var x = target.offsetParent.offsetLeft + target.offsetLeft + target.offsetWidth / 2;
19 var y = target.offsetParent.offsetTop + target.offsetTop + target.offsetHeight / 2;
21 eventSender.mouseMoveTo(x, y);
22 eventSender.mouseDown();
23 eventSender.mouseUp();
25 log(hasFocus ? "PASS" : "FAIL");
27 </script>
28 </body>