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

Unified Diff: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm

Issue 2838513003: ScrollAnimatorMac should post contentAreaScrolled only for explicit scrolls. (Closed)
Patch Set: rebase 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/mac/ScrollAnimatorMac.mm
diff --git a/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm b/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
index ccca6e5c83f57b748a2ccb269ea425554247de7b..903077a8b397ae5b2b4d680c06002416d7c74212 100644
--- a/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
+++ b/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
@@ -796,7 +796,7 @@ void ScrollAnimatorMac::ImmediateScrollTo(const ScrollOffset& new_offset) {
ScrollOffset delta = adjusted_offset - current_offset_;
current_offset_ = adjusted_offset;
- NotifyContentAreaScrolled(delta);
+ NotifyContentAreaScrolled(delta, kUserScroll);
NotifyOffsetChanged();
}
@@ -924,13 +924,15 @@ void ScrollAnimatorMac::WillRemoveHorizontalScrollbar(Scrollbar& scrollbar) {
[scrollbar_painter_controller_.Get() setHorizontalScrollerImp:nil];
}
-void ScrollAnimatorMac::NotifyContentAreaScrolled(const ScrollOffset& delta) {
+void ScrollAnimatorMac::NotifyContentAreaScrolled(const ScrollOffset& delta,
+ ScrollType scrollType) {
// This function is called when a page is going into the page cache, but the
// page
// isn't really scrolling in that case. We should only pass the message on to
// the
// ScrollbarPainterController when we're really scrolling on an active page.
- if (GetScrollableArea()->ScrollbarsCanBeActive())
+ if (IsExplicitScrollType(scrollType) &&
+ GetScrollableArea()->ScrollbarsCanBeActive())
SendContentAreaScrolledSoon(delta);
}

Powered by Google App Engine
This is Rietveld 408576698