OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/js-test.js"></script> | |
5 <script> | |
6 description('This tests that frame scrollbars always receive events even when there is an element underneath the scrollbar which swallows the event. In this case an event handler is added to the window which swallows the event but t his may also happen with elements underneath of overlay scrollbars.'); | |
7 if (window.testRunner) { | |
8 testRunner.dumpAsText(); | |
9 testRunner.waitUntilDone(); | |
Rick Byers
2014/05/31 04:32:33
I don't think this test needs to be async (eventSe
raymes
2014/06/03 00:09:36
Done.
| |
10 } | |
11 | |
12 function finish() { | |
13 shouldBe('window.scrollY', '0'); | |
14 shouldBe('window.receivedClickEvent', 'true'); | |
15 window.testRunner.notifyDone(); | |
16 } | |
17 | |
18 window.onload = function () { | |
19 window.receivedClickEvent = false; | |
20 | |
21 document.addEventListener('mousedown', function(e) { | |
22 e.preventDefault(); | |
23 window.receivedClickEvent = true; | |
Rick Byers
2014/05/31 04:32:33
nit: this name is misleading, how about receivedMo
raymes
2014/06/03 00:09:36
Done.
| |
24 }); | |
25 | |
26 window.scrollTo(0, 10); | |
27 if (window.eventSender) { | |
28 eventSender.mouseMoveTo(window.innerWidth - 10, 1); | |
Rick Byers
2014/05/31 04:32:33
Can you add a second case (or second file) for a d
raymes
2014/06/03 00:09:36
Done. Right, the codepath for layout and non-overl
| |
29 eventSender.mouseDown(); | |
30 eventSender.mouseUp(); | |
31 finish(); | |
32 } | |
33 }; | |
34 </script> | |
35 <style> | |
36 #container { | |
37 height: 200vh; | |
38 width: 200vw; | |
Rick Byers
2014/05/31 04:32:33
is this div actually necessary for the test? In t
raymes
2014/06/03 00:09:36
This is only here in order to force there to be sc
| |
39 background: black; | |
40 } | |
41 /* Use customized scrollbar to avoid platform differences. */ | |
Rick Byers
2014/05/31 04:32:33
Can't you use internals.settings.setMockScrollbars
raymes
2014/06/03 00:09:36
I'm not sure exactly what setMockScrollbarsEnabled
| |
42 <!-- | |
43 ::-webkit-scrollbar { | |
44 width: 20px; | |
45 height: 20px; | |
46 } | |
47 ::-webkit-scrollbar-button { | |
48 height: 20px; | |
49 width: 20px; | |
50 background-color: blue; | |
51 } | |
52 | |
53 ::-webkit-scrollbar-track-piece { | |
54 background-color: gray; | |
55 } | |
56 | |
57 ::-webkit-scrollbar-thumb { | |
58 height: 20px; | |
59 width: 20px; | |
60 background-color: red; | |
61 } | |
62 --> | |
63 </style> | |
64 </head> | |
65 <body> | |
66 <div id="container">This is a div.</div> | |
67 <pre id="console"></pre> | |
68 </body> | |
69 </html> | |
OLD | NEW |