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

Unified Diff: content/renderer/webscrollbarbehavior_impl_aura.cc

Issue 2483113002: Disable scrollbar snapback on desktop Linux (Reland) (Closed)
Patch Set: Created 4 years, 1 month 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: content/renderer/webscrollbarbehavior_impl_aura.cc
diff --git a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc b/content/renderer/webscrollbarbehavior_impl_aura.cc
similarity index 82%
rename from content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
rename to content/renderer/webscrollbarbehavior_impl_aura.cc
index a07e1d47fd727d6ee9492fde8e625acd39fc1154..489684ec7e52d3b55ebb963097d915823b8bb9fe 100644
--- a/content/renderer/webscrollbarbehavior_impl_gtkoraura.cc
+++ b/content/renderer/webscrollbarbehavior_impl_aura.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/renderer/webscrollbarbehavior_impl_gtkoraura.h"
+#include "content/renderer/webscrollbarbehavior_impl_aura.h"
#include "build/build_config.h"
#include "third_party/WebKit/public/platform/WebPoint.h"
@@ -26,6 +26,11 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin(
const blink::WebPoint& eventPoint,
const blink::WebRect& scrollbarRect,
bool isHorizontal) {
+// Disable snapback on desktop Linux. See crbug.com/567968 for context.
Peter Kasting 2016/11/08 02:59:13 FWIW, I'd omit the bug link and simply summarize h
Tom (Use chromium acct) 2016/11/08 03:07:45 Done.
+#if (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ return false;
+#endif
+
// Constants used to figure the drag rect outside which we should snap the
// scrollbar thumb back to its origin. These calculations are based on
// observing the behavior of the MSVC8 main window scrollbar + some
@@ -47,16 +52,7 @@ bool WebScrollbarBehaviorImpl::shouldSnapBackToDragOrigin(
(isHorizontal ? kOffEndMultiplier : kOffSideMultiplier) * -thickness,
(isHorizontal ? kOffSideMultiplier : kOffEndMultiplier) * -thickness);
- // On most platforms, we should snap iff the event is outside our calculated
- // rect. On Linux, however, we should not snap for events off the ends, but
- // not the sides, of the rect.
-#if (defined(OS_LINUX) && !defined(OS_CHROMEOS))
- return isHorizontal ?
- (eventPoint.y < noSnapRect.y() || eventPoint.y >= noSnapRect.bottom()) :
- (eventPoint.x < noSnapRect.x() || eventPoint.x >= noSnapRect.right());
-#else
return !noSnapRect.Contains(eventPoint);
-#endif
}
} // namespace content
« no previous file with comments | « content/renderer/webscrollbarbehavior_impl_aura.h ('k') | content/renderer/webscrollbarbehavior_impl_gtkoraura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698