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

Unified Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp

Issue 1591953005: Make ScrollbarThemeAura selectively invalidate scrollbar parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge with master; remove blank line Created 4 years, 11 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/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);
}
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | third_party/WebKit/Source/platform/scroll/ScrollbarTheme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698