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

Unified Diff: Source/platform/scroll/ScrollView.cpp

Issue 191693002: Delay scrollContents until the next paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix nit Created 6 years, 9 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
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/scroll/ScrollView.cpp
diff --git a/Source/platform/scroll/ScrollView.cpp b/Source/platform/scroll/ScrollView.cpp
index 4b778ab6951c066d3e4ed868b0a655f81cec7463..4608aeceb358b06a16fd0f547c2217f4b7aeb187 100644
--- a/Source/platform/scroll/ScrollView.cpp
+++ b/Source/platform/scroll/ScrollView.cpp
@@ -274,9 +274,7 @@ void ScrollView::scrollTo(const IntSize& newOffset)
if (scrollbarsSuppressed())
return;
- repaintFixedElementsAfterScrolling();
- scrollContents(scrollDelta);
- updateFixedElementsAfterScrolling();
+ m_pendingScrollDelta += scrollDelta;
}
void ScrollView::setScrollPosition(const IntPoint& scrollPoint)
@@ -515,6 +513,15 @@ IntRect ScrollView::rectToCopyOnScroll() const
return scrollViewRect;
}
+void ScrollView::scrollContentsIfNeeded()
+{
+ if (m_pendingScrollDelta.isZero())
+ return;
+ IntSize scrollDelta = m_pendingScrollDelta;
+ m_pendingScrollDelta = IntSize();
+ scrollContents(scrollDelta);
+}
+
void ScrollView::scrollContents(const IntSize& scrollDelta)
{
HostWindow* window = hostWindow();
« no previous file with comments | « Source/platform/scroll/ScrollView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698