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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/scrolling/scrollbar-prevent-default.html
diff --git a/LayoutTests/fast/scrolling/scrollbar-prevent-default.html b/LayoutTests/fast/scrolling/scrollbar-prevent-default.html
new file mode 100644
index 0000000000000000000000000000000000000000..a2cb58f73156727e984661af7ac3f2cfbbb8f78c
--- /dev/null
+++ b/LayoutTests/fast/scrolling/scrollbar-prevent-default.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../../resources/js-test.js"></script>
+ <script>
+ 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 this may also happen with elements underneath of overlay scrollbars.');
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ 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.
+ }
+
+ function finish() {
+ shouldBe('window.scrollY', '0');
+ shouldBe('window.receivedClickEvent', 'true');
+ window.testRunner.notifyDone();
+ }
+
+ window.onload = function () {
+ window.receivedClickEvent = false;
+
+ document.addEventListener('mousedown', function(e) {
+ e.preventDefault();
+ 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.
+ });
+
+ window.scrollTo(0, 10);
+ if (window.eventSender) {
+ 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
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ finish();
+ }
+ };
+ </script>
+ <style>
+ #container {
+ height: 200vh;
+ 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
+ background: black;
+ }
+ /* 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
+ <!--
+ ::-webkit-scrollbar {
+ width: 20px;
+ height: 20px;
+ }
+ ::-webkit-scrollbar-button {
+ height: 20px;
+ width: 20px;
+ background-color: blue;
+ }
+
+ ::-webkit-scrollbar-track-piece {
+ background-color: gray;
+ }
+
+ ::-webkit-scrollbar-thumb {
+ height: 20px;
+ width: 20px;
+ background-color: red;
+ }
+ -->
+ </style>
+</head>
+<body>
+ <div id="container">This is a div.</div>
+ <pre id="console"></pre>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698