Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLAnchorElement / resources / iframe-with-anchor.html
blob4e68fb057f304d829698ab7a7421c04b3372f6a0
1 <html>
2 <head>
3 <script>
5 if (window.testRunner) {
6 testRunner.waitUntilDone();
7 testRunner.dumpAsText();
10 function run() {
11 if (window.eventSender) {
12 var anchor = document.getElementById("start");
13 var x = window.frameElement.offsetLeft + anchor.offsetLeft + 2;
14 var y = window.frameElement.offsetTop + anchor.offsetTop + 2;
15 eventSender.mouseMoveTo(x, y);
16 eventSender.mouseDown();
17 eventSender.mouseUp();
18 setTimeout(finish, 1000);
21 function finish() {
22 var result;
23 if (window.top.scrollY == 0)
24 result = "FAIL: navigating to the anchor should trigger a scroll";
25 else
26 result = "PASS";
28 window.top.document.body.appendChild(document.createTextNode(result));
29 if (window.testRunner)
30 testRunner.notifyDone();
34 </script>
35 </head>
36 <body onload="run();">
38 <a id="start" href="#anchor">Go to anchor</a>
39 <div style="height: 1000px"></div>
40 <a name="anchor">Anchor</a>
41 </body>
42 </html>