Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / scrolling / scrollbar-prevent-default.html
blob847e77224b25b27981983666113759af21e138c4
1 <head>
2 <script src="../../resources/js-test.js"></script>
3 <style>
4 body {
5 height: 200vh;
6 width: 200vw;
7 margin: 0;
9 #subframe {
10 width: 100px;
11 height: 100px;
12 background-color: black;
13 overflow: scroll;
15 #subframe-content {
16 width: 200px;
17 height: 200px;
18 background-color: black;
20 </style>
21 </head>
22 <body>
23 <div id="subframe">
24 <div id="subframe-content"></div>
25 </div>
26 <pre id="console"></pre>
27 </body>
28 <script>
29 description('This tests that 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 this may also happen with elements underneath of overlay scrollbars.');
30 if (window.testRunner)
31 testRunner.dumpAsText();
32 if (window.internals)
33 internals.settings.setMockScrollbarsEnabled(true)
35 var receivedMousedownEvent = false;
37 document.addEventListener('mousedown', function(e) {
38 e.preventDefault();
39 receivedMousedownEvent = true;
40 });
42 // Test the frame scrollbar.
43 window.scrollTo(0, 10);
44 if (window.eventSender) {
45 eventSender.mouseMoveTo(window.innerWidth - 5, 1);
46 eventSender.mouseDown();
47 eventSender.mouseUp();
50 shouldBe('window.scrollY', '0');
51 shouldBe('receivedMousedownEvent', 'true');
53 // Test a div scrollbar.
54 receivedMousedownEvent = false;
55 var subframe = document.getElementById('subframe');
56 subframe.scrollTop = 10;
57 if (window.eventSender) {
58 eventSender.mouseMoveTo(100 - 5, 1);
59 eventSender.mouseDown();
60 eventSender.mouseUp();
63 shouldBe('subframe.scrollTop', '0');
64 shouldBe('receivedMousedownEvent', 'true');
65 </script>