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/Scrollbar.cpp

Issue 2835403002: Call ScrollableArea::ShowOverlayScrollbars for explicit scrolls only. (Closed)
Patch Set: fix VisualViewport Created 3 years, 8 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 0cc3aa168cc781f4b65e8058ebfa727a2c691ea6..fe31bb28925a3d77f3fa771e98ed977210022d84 100644
--- a/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
+++ b/third_party/WebKit/Source/platform/scroll/Scrollbar.cpp
@@ -544,8 +544,11 @@ void Scrollbar::SetEnabled(bool e) {
enabled_ = e;
GetTheme().UpdateEnabledState(*this);
- ScrollbarPart invalid_parts = GetTheme().InvalidateOnEnabledChange();
- SetNeedsPaintInvalidation(invalid_parts);
+ // We can skip thumb/track repaint when hiding an overlay scrollbar, but not
+ // when showing (since the proportions may have changed while hidden).
+ bool skipPartsRepaint = IsOverlayScrollbar() && scrollable_area_ &&
+ scrollable_area_->ScrollbarsHidden();
+ SetNeedsPaintInvalidation(skipPartsRepaint ? kNoPart : kAllParts);
bokan 2017/04/25 23:21:17 On the CC side (for Aura anyway) we only need to p
skobes 2017/04/26 01:28:58 I think ideally we would not repurpose the enabled
bokan 2017/04/26 11:51:09 It's an unfortunate quirk of main-thread painting
}
int Scrollbar::ScrollbarThickness() const {

Powered by Google App Engine
This is Rietveld 408576698