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. |