[Release] Webkit-EFL Ver. 2.0_beta_118996_0.6.22
[framework/web/webkit-efl.git] / LayoutTests / fast / events / scroll-to-anchor-in-overflow-hidden.html
1 <html>
2     <head>
3        <style type="text/css">   
4           html { overflow: hidden; }
5           #top { margin: 100em 3em 0; padding: 2em 0 0 .5em; }
6        </style>
7         <script>
8        function log(msg)
9        {
10            document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
11        }
12
13
14       function logMousePosition(event) {
15    log ("Mouse:x = " + event.x + " , y = " + event.y);
16 }
17
18        function test()
19        {
20            if (window.layoutTestController) {
21                layoutTestController.waitUntilDone();
22                layoutTestController.dumpAsText();
23                setTimeout(scrollToAnchor, 0);
24            }
25        }
26
27        function scrollToAnchor()
28        {
29            if (window.eventSender) {
30                var input = document.getElementById('ANCHORLINK');
31                var x = input.offsetLeft;
32                var y = input.offsetTop;
33                eventSender.mouseMoveTo(x, y);
34                eventSender.mouseDown();
35                eventSender.mouseUp();
36            }
37
38            if (document.body.scrollTop == 0)
39                log("Automated test : FAILED  : no scroll has occured ");
40            else
41                log("Automated test : PASSED");
42
43            if (window.layoutTestController)
44                layoutTestController.notifyDone();
45        }     
46         </script>
47     </head>
48 <body onload="test()">
49
50     
51     <div id="ANCHORLINK">
52         <a href="#bottom">Link to Bottom of the page</a>
53    </div>
54    
55        https://bugs.webkit.org/show_bug.cgi?id=20270 <br>
56        This test verifies that a anchor link overrides the overflow:hidden attribute by scrolling somewhere on a page.<br>
57        To do the test manually you have to click on the anchor link above. If the scroll occurs to the bottom of the page : the test has PASSED.<br>
58        If you stay here after the click, the test has failed. <br><br><br><br>
59 <div id="console" style="height: 1000px;"></div>
60 <a name="bottom">Bottom of the page</a>
61 Manual Test : PASSED
62    
63     
64 </body>
65 </html>