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 a35862c461793a1fd504d8c8cc86ad5e55166bba..092d313fa65dba5601ce612c348baed1818f57ad 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -984,17 +984,6 @@ 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. |
@@ -1470,19 +1459,21 @@ void LayoutBox::ClearOverrideContainingBlockContentLogicalHeight() { |
LayoutUnit LayoutBox::AdjustBorderBoxLogicalWidthForBoxSizing( |
float width) const { |
LayoutUnit borders_plus_padding = CollapsedBorderAndCSSPaddingLogicalWidth(); |
+ LayoutUnit scrollbar_size(VerticalScrollbarWidth()); |
LayoutUnit result(width); |
if (Style()->BoxSizing() == EBoxSizing::kContentBox) |
- return result + borders_plus_padding; |
- return std::max(result, borders_plus_padding); |
+ return std::max(result, scrollbar_size) + borders_plus_padding; |
+ return std::max(result, borders_plus_padding + scrollbar_size); |
} |
LayoutUnit LayoutBox::AdjustBorderBoxLogicalHeightForBoxSizing( |
float height) const { |
LayoutUnit borders_plus_padding = CollapsedBorderAndCSSPaddingLogicalHeight(); |
+ LayoutUnit scrollbar_size(HorizontalScrollbarHeight()); |
LayoutUnit result(height); |
if (Style()->BoxSizing() == EBoxSizing::kContentBox) |
- return result + borders_plus_padding; |
- return std::max(result, borders_plus_padding); |
+ return std::max(result, scrollbar_size) + borders_plus_padding; |
+ return std::max(result, borders_plus_padding + scrollbar_size); |
} |
LayoutUnit LayoutBox::AdjustContentBoxLogicalWidthForBoxSizing( |
@@ -1490,7 +1481,7 @@ LayoutUnit LayoutBox::AdjustContentBoxLogicalWidthForBoxSizing( |
LayoutUnit result(width); |
if (Style()->BoxSizing() == EBoxSizing::kBorderBox) |
result -= CollapsedBorderAndCSSPaddingLogicalWidth(); |
- return std::max(LayoutUnit(), result); |
+ return std::max(LayoutUnit(VerticalScrollbarWidth()), result); |
} |
LayoutUnit LayoutBox::AdjustContentBoxLogicalHeightForBoxSizing( |
@@ -1498,7 +1489,7 @@ LayoutUnit LayoutBox::AdjustContentBoxLogicalHeightForBoxSizing( |
LayoutUnit result(height); |
if (Style()->BoxSizing() == EBoxSizing::kBorderBox) |
result -= CollapsedBorderAndCSSPaddingLogicalHeight(); |
- return std::max(LayoutUnit(), result); |
+ return std::max(LayoutUnit(HorizontalScrollbarHeight()), result); |
} |
// Hit Testing |