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 bee8890306df34c4c687aa4480f5ff69f1d57277..ce658303345c049c85141c436d3c79c859c04949 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()) { |