2011-04-09 Jon Lee <jonlee@apple.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Apr 2011 08:31:00 +0000 (08:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Apr 2011 08:31:00 +0000 (08:31 +0000)
        Reviewed by Beth Dakin.

        Overlay scrollbar flashes in scrollable <textarea> with each keystroke (58180)
        https://bugs.webkit.org/show_bug.cgi?id=58180
        <rdar://problem/9047984>

        * platform/mac/ScrollAnimatorMac.mm:
        (WebCore::ScrollAnimatorMac::immediateScrollToPoint): Check that there is a change before submitting
        (WebCore::ScrollAnimatorMac::immediateScrollByDeltaX):
        (WebCore::ScrollAnimatorMac::immediateScrollByDeltaY):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/ScrollAnimatorMac.mm

index 5dc5d78..6e69f79 100644 (file)
@@ -1,3 +1,16 @@
+2011-04-09  Jon Lee  <jonlee@apple.com>
+
+        Reviewed by Beth Dakin.
+
+        Overlay scrollbar flashes in scrollable <textarea> with each keystroke (58180)
+        https://bugs.webkit.org/show_bug.cgi?id=58180
+        <rdar://problem/9047984>
+
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::ScrollAnimatorMac::immediateScrollToPoint): Check that there is a change before submitting
+        (WebCore::ScrollAnimatorMac::immediateScrollByDeltaX):
+        (WebCore::ScrollAnimatorMac::immediateScrollByDeltaY):
+
 2011-04-09  Sreeram Ramachandran  <sreeram@google.com>
 
         Reviewed by Ryosuke Niwa.
index 197b527..0a843bb 100644 (file)
@@ -580,6 +580,9 @@ void ScrollAnimatorMac::immediateScrollToPoint(const FloatPoint& newPosition)
 {
     FloatPoint adjustedPosition = adjustScrollPositionIfNecessary(newPosition);
  
+    if (adjustedPosition.x() == m_currentPosX && adjustedPosition.y() == m_currentPosY)
+        return;
+    
     m_currentPosX = adjustedPosition.x();
     m_currentPosY = adjustedPosition.y();
     notityPositionChanged();
@@ -587,13 +590,23 @@ void ScrollAnimatorMac::immediateScrollToPoint(const FloatPoint& newPosition)
 
 void ScrollAnimatorMac::immediateScrollByDeltaX(float deltaX)
 {
-    m_currentPosX = adjustScrollXPositionIfNecessary(m_currentPosX + deltaX);
+    float newPosX = adjustScrollXPositionIfNecessary(m_currentPosX + deltaX);
+    
+    if (newPosX == m_currentPosX)
+        return;
+    
+    m_currentPosX = newPosX;
     notityPositionChanged();
 }
 
 void ScrollAnimatorMac::immediateScrollByDeltaY(float deltaY)
 {
-    m_currentPosY = adjustScrollYPositionIfNecessary(m_currentPosY + deltaY);
+    float newPosY = adjustScrollYPositionIfNecessary(m_currentPosY + deltaY);
+    
+    if (newPosY == m_currentPosY)
+        return;
+    
+    m_currentPosY = newPosY;
     notityPositionChanged();
 }