OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../js/resources/js-test-pre.js"></script> |
| 4 <script> |
| 5 function log(msg) |
| 6 { |
| 7 document.getElementById('console').appendChild(document.createTextNo
de(msg + '\n')); |
| 8 } |
| 9 |
| 10 var iframe; |
| 11 var iframeDocument; |
| 12 var iframeScrollTopAfterAnchor = 0; |
| 13 |
| 14 function test() |
| 15 { |
| 16 if (window.testRunner) { |
| 17 testRunner.waitUntilDone(); |
| 18 testRunner.dumpAsText(); |
| 19 } |
| 20 |
| 21 iframe = document.getElementById('NoScrolliFrame'); |
| 22 iframeDocument = iframe.contentDocument; |
| 23 iframeScrollTopAfterAnchor = 0; |
| 24 |
| 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(); |
| 33 } |
| 34 setTimeout(autoscrollTestPart1, 0); |
| 35 } |
| 36 |
| 37 function autoscrollTestPart1() |
| 38 { |
| 39 iframeScrollTopAfterAnchor = iframeDocument.body.scrollTop; |
| 40 if (iframeDocument.body.scrollTop == 0) |
| 41 log("FAILED: anchor clicking within non-scrollable inner frame f
ailed."); |
| 42 |
| 43 if (window.eventSender) { |
| 44 var textInIframe = iframeDocument.getElementById('textInFrame'); |
| 45 var x = iframe.offsetLeft + textInIframe.offsetLeft - iframeDocu
ment.body.scrollLeft + 7; |
| 46 var y = iframe.offsetTop + textInIframe.offsetTop - iframeDocume
nt.body.scrollTop + 7; |
| 47 eventSender.dragMode = false; |
| 48 eventSender.mouseMoveTo(x, y); |
| 49 eventSender.mouseDown(); |
| 50 eventSender.mouseMoveTo(x, y - 10); |
| 51 y = iframe.offsetTop; |
| 52 eventSender.mouseMoveTo(x, y - 5); |
| 53 } |
| 54 setTimeout(autoscrollTestPart2, 100); |
| 55 } |
| 56 |
| 57 function autoscrollTestPart2() |
| 58 { |
| 59 if (window.eventSender) |
| 60 eventSender.mouseUp(); |
| 61 |
| 62 log("Document whose HTML or BODY tags have overflow:hidden should no
t autoscroll."); |
| 63 if (iframeScrollTopAfterAnchor == iframeDocument.body.scrollTop) |
| 64 log("PASSED: the autoscroll has not happened."); |
| 65 else |
| 66 log("FAILED: the autoscroll has happened."); |
| 67 |
| 68 if (window.testRunner) |
| 69 testRunner.notifyDone(); |
| 70 } |
| 71 </script> |
| 72 </head> |
| 73 <body onload="test()"> |
| 74 <iframe id="NoScrolliFrame" style="height: 150px; width: 150px" src="resourc
es/big-page-with-overflow-hidden-and-anchor-scroll.html" ></iframe> |
| 75 <div id="console"></div> |
| 76 </body> |
| 77 </html> |
OLD | NEW |