Index: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
index 365aa95b9bd288613a228ecac38d1b69cdbefee7..b783cb95830ab5c27e8478cb3a47ff36b9ef6ada 100644 |
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp |
@@ -244,17 +244,18 @@ void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy |
// Tell the derived class to scroll its contents. |
setScrollOffset(truncatedPosition, scrollType); |
- Scrollbar* verticalScrollbar = this->verticalScrollbar(); |
- |
// Tell the scrollbars to update their thumb postions. |
+ // If a scrollbar does not have its own layer, it must always be invalidated |
+ // to reflect the new thumb position, even if the theme would not otherwise |
+ // require invalidation of any part. |
if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) { |
- horizontalScrollbar->offsetDidChange(); |
- if (horizontalScrollbar->isOverlayScrollbar() && !hasLayerForHorizontalScrollbar()) |
+ bool offsetChanged = horizontalScrollbar->offsetDidChange(); |
+ if (offsetChanged && !hasLayerForHorizontalScrollbar()) |
setScrollbarNeedsPaintInvalidation(HorizontalScrollbar); |
} |
- if (verticalScrollbar) { |
- verticalScrollbar->offsetDidChange(); |
- if (verticalScrollbar->isOverlayScrollbar() && !hasLayerForVerticalScrollbar()) |
+ if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) { |
+ bool offsetChanged = verticalScrollbar->offsetDidChange(); |
+ if (offsetChanged && !hasLayerForVerticalScrollbar()) |
setScrollbarNeedsPaintInvalidation(VerticalScrollbar); |
} |