Smooth scrolling needs a new key
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Apr 2012 01:32:16 +0000 (01:32 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Apr 2012 01:32:16 +0000 (01:32 +0000)
<rdar://problem/11331632>

Reviewed by Geoffrey Garen.

* platform/mac/ScrollAnimatorMac.mm:
(WebCore::scrollAnimationEnabledForSystem):
(WebCore::ScrollAnimatorMac::scroll):
Update for new key.

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

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

index bcb629a..973058a 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-28  Sam Weinig  <sam@webkit.org>
+
+        Smooth scrolling needs a new key
+        <rdar://problem/11331632>
+
+        Reviewed by Geoffrey Garen.
+
+        * platform/mac/ScrollAnimatorMac.mm:
+        (WebCore::scrollAnimationEnabledForSystem):
+        (WebCore::ScrollAnimatorMac::scroll):
+        Update for new key.
+
 2012-04-28  Li Yin  <li.yin@intel.com>
 
         MessagePort must set m_closed to be true at the end of MessagePort::close function
index 880d6f5..edeee38 100644 (file)
@@ -589,11 +589,20 @@ ScrollAnimatorMac::~ScrollAnimatorMac()
     }
 }
 
+static bool scrollAnimationEnabledForSystem()
+{
+#if defined(BUILDING_ON_SNOW_LEOPARD) || defined(BUILDING_ON_LION)
+    return [[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollAnimationEnabled"];
+#else
+    return [[NSUserDefaults standardUserDefaults] boolForKey:@"NSScrollAnimationEnabled"];
+#endif
+}
+
 bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
 {
     m_haveScrolledSincePageLoad = true;
 
-    if (![[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollAnimationEnabled"] || !m_scrollableArea->scrollAnimatorEnabled())
+    if (!scrollAnimationEnabledForSystem() || !m_scrollableArea->scrollAnimatorEnabled())
         return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
 
     if (granularity == ScrollByPixel)