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

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

Issue 1558493002: Reland: Make ScrollbarThemeAura selectively invalidate scrollbar parts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ScrollableAreaTest.InvalidatesCompositedScrollbarsIfPartsNeedRepaint for Oilpan Created 5 years 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/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);
}

Powered by Google App Engine
This is Rietveld 408576698