3 <script src=
"../../resources/js-test.js"></script>
7 document
.getElementById('console').appendChild(document
.createTextNode(msg
+ '\n'));
12 var iframeScrollTopAfterAnchor
= 0;
16 if (window
.testRunner
) {
17 testRunner
.waitUntilDone();
18 testRunner
.dumpAsText();
21 iframe
= document
.getElementById('NoScrolliFrame');
22 iframeDocument
= iframe
.contentDocument
;
23 iframeScrollTopAfterAnchor
= 0;
25 var clickme
= iframeDocument
.getElementById('clickme');
26 var x
= iframe
.offsetLeft
+ clickme
.offsetLeft
+ 7;
27 var y
= iframe
.offsetTop
+ clickme
.offsetTop
+ 7;
28 if (window
.eventSender
) {
29 eventSender
.dragMode
= false;
30 eventSender
.mouseMoveTo(x
, y
);
31 eventSender
.mouseDown();
32 eventSender
.mouseUp();
34 setTimeout(autoscrollTestPart1
, 0);
37 function autoscrollTestPart1()
39 iframeScrollTopAfterAnchor
= iframeDocument
.scrollingElement
.scrollTop
;
40 if (iframeDocument
.scrollingElement
.scrollTop
== 0)
41 log("FAILED: anchor clicking within non-scrollable inner frame failed.");
43 if (window
.eventSender
) {
44 var textInIframe
= iframeDocument
.getElementById('textInFrame');
45 var x
= iframe
.offsetLeft
+ textInIframe
.offsetLeft
- iframeDocument
.scrollingElement
.scrollLeft
+ 7;
46 var y
= iframe
.offsetTop
+ textInIframe
.offsetTop
- iframeDocument
.scrollingElement
.scrollTop
+ 7;
47 eventSender
.dragMode
= false;
48 eventSender
.mouseMoveTo(x
, y
);
49 eventSender
.mouseDown();
50 eventSender
.mouseMoveTo(x
, y
- 10);
52 eventSender
.mouseMoveTo(x
, y
- 5);
54 setTimeout(autoscrollTestPart2
, 100);
57 function autoscrollTestPart2()
59 if (window
.eventSender
)
60 eventSender
.mouseUp();
62 log("Document whose HTML or BODY tags have overflow:hidden should not autoscroll.");
63 if (iframeScrollTopAfterAnchor
== iframeDocument
.scrollingElement
.scrollTop
)
64 log("PASSED: the autoscroll has not happened.");
66 log("FAILED: the autoscroll has happened.");
68 if (window
.testRunner
)
69 testRunner
.notifyDone();
73 <body onload=
"test()">
74 <iframe id=
"NoScrolliFrame" style=
"height: 150px; width: 150px" src=
"resources/big-page-with-overflow-hidden-and-anchor-scroll.html" ></iframe>
75 <div id=
"console"></div>