Index: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
diff --git a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
index dd67570f155ea693fd59f513845248d6114ad8d9..f2071b4c20f820a770b309b88c196575c088ba4e 100644 |
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp |
@@ -139,12 +139,14 @@ void Scrollbar::offsetDidChange() |
if (position == m_currentPos) |
return; |
+ float oldPosition = m_currentPos; |
int oldThumbPosition = theme().thumbPosition(*this); |
m_currentPos = position; |
- // TODO(jbroman): The theme should provide the parts to invalidate. |
- // At the moment, the only theme that doesn't invalidate everything is Mac, |
- // which invalidates this as needed in ScrollAnimatorMac. |
- setNeedsPaintInvalidation(NoPart); |
+ |
+ ScrollbarPart invalidParts = theme().invalidateOnThumbPositionChange( |
+ *this, oldPosition, position); |
+ setNeedsPaintInvalidation(invalidParts); |
+ |
if (m_pressedPart == ThumbPart) |
setPressedPos(m_pressedPos + theme().thumbPosition(*this) - oldThumbPosition); |
} |