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

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

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: Rebase Created 4 years, 2 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
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 d24d79670ec318bbe425e2f953f40ce35ecc177f..edcba00f7e7e0af53a2d28f112856e8e16eb141b 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -652,6 +652,22 @@ void PaintLayerScrollableArea::setScrollOffsetUnconditionally(
scrollOffsetChanged(offset, scrollType);
}
+void PaintLayerScrollableArea::didChangeScrollbarsHidden() {
+ updateScrollbarsEnabledState();
+}
+
+void PaintLayerScrollableArea::updateScrollbarsEnabledState() {
+ // overflow:scroll should just enable/disable.
+ if (box().style()->overflowX() == OverflowScroll && horizontalScrollbar()) {
+ horizontalScrollbar()->setEnabled(hasHorizontalOverflow() &&
+ !scrollbarsHidden());
+ }
+ if (box().style()->overflowY() == OverflowScroll && verticalScrollbar()) {
+ verticalScrollbar()->setEnabled(hasVerticalOverflow() &&
+ !scrollbarsHidden());
+ }
+}
+
void PaintLayerScrollableArea::updateAfterLayout() {
ASSERT(box().hasOverflowClip());
@@ -738,11 +754,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());
+ updateScrollbarsEnabledState();
// Set up the range (and page step/line step).
if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) {

Powered by Google App Engine
This is Rietveld 408576698