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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2759213002: Add auto scrollbars if content would be visible without them. (Closed)
Patch Set: test Created 3 years, 9 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 | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
index 291ea69ec6a4b0d4fd5d516cae3f9155a72e388a..2ba7106b7c64e89e5baedabaa892ef8a26ce63fc 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1208,16 +1208,18 @@ void PaintLayerScrollableArea::computeScrollbarExistence(
if (box().hasAutoHorizontalScrollbar()) {
if (option == ForbidAddingAutoBars)
needsHorizontalScrollbar &= hasHorizontalScrollbar();
- needsHorizontalScrollbar &= box().isRooted() &&
- this->hasHorizontalOverflow() &&
- box().pixelSnappedClientHeight();
+ needsHorizontalScrollbar &=
+ box().isRooted() && this->hasHorizontalOverflow() &&
+ box().pixelSnappedClientHeight() + box().horizontalScrollbarHeight() >
+ 0;
}
if (box().hasAutoVerticalScrollbar()) {
if (option == ForbidAddingAutoBars)
needsVerticalScrollbar &= hasVerticalScrollbar();
- needsVerticalScrollbar &= box().isRooted() && this->hasVerticalOverflow() &&
- box().pixelSnappedClientWidth();
+ needsVerticalScrollbar &=
+ box().isRooted() && this->hasVerticalOverflow() &&
+ box().pixelSnappedClientWidth() + box().verticalScrollbarWidth() > 0;
}
// Look for the scrollbarModes and reset the needs Horizontal & vertical
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698