Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: LayoutTests/fast/scrolling/scrollbar-prevent-default.html

Issue 296003011: Fix event passing to overlay scrollbars when over a plugin (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <head>
2 <script src="../../resources/js-test.js"></script>
3 <style>
4 body {
5 height: 200vh;
6 width: 200vw;
7 margin: 0;
8 }
9 #subframe {
10 width: 100px;
11 height: 100px;
12 background-color: black;
13 overflow: scroll;
14 }
15 #subframe-content {
16 width: 200px;
17 height: 200px;
18 background-color: black;
19 }
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 ther e 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 al so happen with elements underneath of overlay scrollbars.');
30 if (window.testRunner)
31 testRunner.dumpAsText();
32 if (window.internals)
33 internals.settings.setMockScrollbarsEnabled(true)
34
35 var receivedMousedownEvent = false;
36
37 document.addEventListener('mousedown', function(e) {
38 e.preventDefault();
39 receivedMousedownEvent = true;
40 });
41
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();
48 }
49
50 shouldBe('window.scrollY', '0');
51 shouldBe('receivedMousedownEvent', 'true');
52
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();
61 }
62
63 shouldBe('subframe.scrollTop', '0');
64 shouldBe('receivedMousedownEvent', 'true');
65 </script>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/scrolling/scrollbar-prevent-default-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698