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

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

Issue 2509843004: Disable overlay scrollbars to hide them on non-Mac. (Closed)
Patch Set: Renamed to shouldDisableInvisibleScrollbars 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 742a651142649cf011455bdb5dbd3840902678ca..9ced75cbdf05708c2e71e5bdb9db1eb12d60eab1 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -553,6 +553,8 @@ bool PaintLayerScrollableArea::shouldSuspendScrollAnimations() const {
}
void PaintLayerScrollableArea::scrollbarVisibilityChanged() {
+ updateScrollbarEnabledState();
+
if (LayoutView* view = box().view())
return view->clearHitTestCache();
}
@@ -656,6 +658,20 @@ void PaintLayerScrollableArea::updateScrollDimensions() {
updateScrollOrigin();
}
+void PaintLayerScrollableArea::updateScrollbarEnabledState() {
+ bool forceDisabled =
+ ScrollbarTheme::theme().shouldDisableInvisibleScrollbars() &&
+ 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) {
@@ -749,11 +765,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()) {
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698