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

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

Issue 2509843004: Disable overlay scrollbars to hide them on non-Mac. (Closed)
Patch Set: Fix tests 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: 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 f4d15b2eedadc3050bed99b495cc9f3bc1f32b17..88711260d5bea2d9fc0e4c43a1a5fdd2fbc13586 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -551,6 +551,8 @@ bool PaintLayerScrollableArea::shouldSuspendScrollAnimations() const {
}
void PaintLayerScrollableArea::scrollbarVisibilityChanged() {
+ updateScrollbarEnabledState();
+
if (LayoutView* view = box().view())
return view->clearHitTestCache();
}
@@ -654,6 +656,19 @@ void PaintLayerScrollableArea::updateScrollDimensions() {
updateScrollOrigin();
}
+void PaintLayerScrollableArea::updateScrollbarEnabledState() {
+ bool forceDisabled = ScrollbarTheme::theme().disableInvisibleScrollbars() &&
+ scrollbarsHidden();
+ // overflow:scroll should just enable/disable.
+ if (box().style()->overflowX() == OverflowScroll && horizontalScrollbar()) {
+ horizontalScrollbar()->setEnabled(hasHorizontalOverflow() &&
+ !forceDisabled);
+ }
+ if (box().style()->overflowY() == OverflowScroll && verticalScrollbar()) {
+ verticalScrollbar()->setEnabled(hasVerticalOverflow() && !forceDisabled);
+ }
+}
+
void PaintLayerScrollableArea::setScrollOffsetUnconditionally(
const ScrollOffset& offset,
ScrollType scrollType) {
@@ -747,11 +762,7 @@ void PaintLayerScrollableArea::updateAfterLayout() {
// compositing/overflow/automatically-opt-into-composited-scrolling-after-style-change.html.
DisableCompositingQueryAsserts disabler;
- // overflow:scroll should just enable/disable.
- if (box().style()->overflowX() == OverflowScroll && horizontalScrollbar())
- horizontalScrollbar()->setEnabled(hasHorizontalOverflow());
- if (box().style()->overflowY() == OverflowScroll && verticalScrollbar())
- verticalScrollbar()->setEnabled(hasVerticalOverflow());
+ updateScrollbarEnabledState();
// Set up the range (and page step/line step).
if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {

Powered by Google App Engine
This is Rietveld 408576698