2011-01-21 Tony Chang <tony@chromium.org>
authortony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jan 2011 22:32:15 +0000 (22:32 +0000)
committertony@chromium.org <tony@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jan 2011 22:32:15 +0000 (22:32 +0000)
        Reviewed by Sam Weinig.

        reduce number of FrameLoaderClient::didChangeScrollOffset calls
        https://bugs.webkit.org/show_bug.cgi?id=52915

        Only notify of changes in scroll offset when there actually is a change.
        This regressed in r76291.

        Covered by Chromium browser_tests.

        * platform/ScrollAnimator.cpp:
        (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76395 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/ScrollAnimator.cpp

index 852dab2..0488da5 100644 (file)
@@ -1,3 +1,18 @@
+2011-01-21  Tony Chang  <tony@chromium.org>
+
+        Reviewed by Sam Weinig.
+
+        reduce number of FrameLoaderClient::didChangeScrollOffset calls
+        https://bugs.webkit.org/show_bug.cgi?id=52915
+
+        Only notify of changes in scroll offset when there actually is a change.
+        This regressed in r76291.
+
+        Covered by Chromium browser_tests.
+
+        * platform/ScrollAnimator.cpp:
+        (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
+
 2011-01-21  Pavel Feldman  <pfeldman@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index 9def297..428a79d 100644 (file)
@@ -71,9 +71,11 @@ bool ScrollAnimator::scroll(ScrollbarOrientation orientation, ScrollGranularity,
 
 void ScrollAnimator::scrollToOffsetWithoutAnimation(const FloatPoint& offset)
 {
-    m_currentPosX = offset.x();
-    m_currentPosY = offset.y();
-    notityPositionChanged();
+    if (m_currentPosX != offset.x() || m_currentPosY != offset.y()) {
+        m_currentPosX = offset.x();
+        m_currentPosY = offset.y();
+        notityPositionChanged();
+    }
 }
 
 FloatPoint ScrollAnimator::currentPosition() const