OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <title>Pan Scrolling Test</title> | 3 <style type="text/css"> |
4 </head> | 4 #scrollable { |
5 <body> | 5 height: 200px; |
6 <script> | 6 overflow: auto; |
7 if (window.testRunner) { | 7 border: solid 3px #cc0000; |
8 testRunner.dumpAsText(); | 8 font-size: 80px; |
9 testRunner.waitUntilDone(); | 9 } |
10 } | 10 </style> |
11 | 11 <script src="../js/resources/js-test-pre.js"></script> |
12 addEventListener('mousedown', | 12 <script src="./resources/panScroll.js"></script> |
13 function(event) { | 13 <script> |
14 console.log("Mousedown with " + event.button); | 14 window.addEventListener('mousedown', function(event) { |
15 } | 15 }); |
16 , false); | 16 |
17 </script> | 17 function start() |
18 <div id="overflow" style="width:500px; height:150px; overflow:auto; bord
er:2px solid red; padding:10px"> | 18 { |
19 <h1>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32303"
>bug 32303</a> This tests that pan | 19 description('Check pan scroll with mousedown event handler'); |
20 scrolling works without event.preventDefault and the middle button m
ousedown event is fired. | 20 testPanScroll({ |
21 To test manually, try to pan scroll inside this div.</h1> | 21 'clickOrDrag': 'drag', |
22 </div> | 22 'scrollable': $('scrollable'), |
23 <p> | 23 }); |
24 <div id="console"></div> | 24 } |
25 <script> | 25 </script> |
26 if (window.eventSender) | 26 </head> |
27 { | 27 <body onload="start()"> |
28 eventSender.mouseMoveTo(50, 50); | 28 <div id="container"> |
29 eventSender.mouseDown(1); | 29 <p id="description"></p> |
30 eventSender.mouseUp(1); | 30 Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=32303">bug 32303</a> T
his tests that pan |
31 eventSender.mouseMoveTo(50, 200); | 31 scrolling works without event.preventDefault and the middle button mousedown eve
nt is fired. |
32 setTimeout(finished, 500); | 32 To test manually, try to pan scroll inside this div. |
33 } | 33 <div id="scrollable"></div> |
34 | 34 </div> |
35 function finished() | 35 <div id="console"></div> |
36 { | 36 <script src="../js/resources/js-test-post.js"></script> |
37 if (document.getElementById('overflow').scrollTop) | 37 </body> |
38 document.getElementById('console').innerHTML = "Success! Div
with overflow was scrolled"; | |
39 else | |
40 document.getElementById('console').innerHTML = "Fail! Div wi
th overflow was not scrolled"; | |
41 | |
42 window.testRunner.notifyDone(); | |
43 } | |
44 </script> | |
45 </body> | |
46 </html> | 38 </html> |
OLD | NEW |