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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2893833004: When moving past a left-hand scrollbar, don't jump way outside the content box. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 097fec971dac558f6d294e287ee84ef1491c2e7a..dd6cd31daa600628f52523a90625cb9166c21659 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -973,6 +973,17 @@ int LayoutBox::HorizontalScrollbarHeight() const {
return GetScrollableArea()->HorizontalScrollbarHeight();
}
+LayoutUnit LayoutBox::VerticalScrollbarWidthClampedToContentBox() const {
+ LayoutUnit width(VerticalScrollbarWidth());
+ DCHECK_GE(width, LayoutUnit());
+ if (width) {
+ LayoutUnit minimum_width = LogicalWidth() - BorderAndPaddingLogicalWidth();
+ DCHECK_GE(minimum_width, LayoutUnit());
+ width = std::min(width, minimum_width);
+ }
+ return width;
+}
+
ScrollResult LayoutBox::Scroll(ScrollGranularity granularity,
const FloatSize& delta) {
// Presumably the same issue as in setScrollTop. See crbug.com/343132.
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698