[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

weinig at apple.com weinig at apple.com
Wed Dec 22 18:19:28 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 08ce4d803e6da74f3612df4981c79e9a286fcf1a
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 9 21:47:06 2010 +0000

    WebKit2 needs smooth scrolling support on the mac
    <rdar://problem/8219402>
    
    Reviewed by Dan Bernstein.
    
    * WebCore.xcodeproj/project.pbxproj: Change ScrollAnimatorMac.cpp to ScrollAnimatorMac.mm.
    * platform/mac/ScrollAnimatorMac.cpp: Removed.
    * platform/mac/ScrollAnimatorMac.h:
    * platform/mac/ScrollAnimatorMac.mm: Copied from platform/mac/ScrollAnimatorMac.cpp.
    (-[ScrollAnimationHelperDelegate initWithScrollAnimator:WebCore::]):
    (-[ScrollAnimationHelperDelegate bounds]):
    (-[ScrollAnimationHelperDelegate _immediateScrollToPoint:]):
    (-[ScrollAnimationHelperDelegate convertSizeToBase:]):
    (-[ScrollAnimationHelperDelegate convertSizeFromBase:]):
    (-[ScrollAnimationHelperDelegate superview]):
    (-[ScrollAnimationHelperDelegate documentView]):
    (-[ScrollAnimationHelperDelegate window]):
    (-[ScrollAnimationHelperDelegate _recursiveRecomputeToolTips]):
    (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
    (WebCore::ScrollAnimatorMac::scroll):
    (WebCore::ScrollAnimatorMac::setScrollPositionAndStopAnimation):
    (WebCore::ScrollAnimatorMac::currentPosition):
    (WebCore::ScrollAnimatorMac::immediateScrollToPoint):
    Add implementation of ScrollAnimator for the Mac.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73644 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 41687be..de64ec3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-12-09  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Dan Bernstein.
+
+        WebKit2 needs smooth scrolling support on the mac
+        <rdar://problem/8219402>
+
+        * WebCore.xcodeproj/project.pbxproj: Change ScrollAnimatorMac.cpp to ScrollAnimatorMac.mm.
+        * platform/mac/ScrollAnimatorMac.cpp: Removed.
+        * platform/mac/ScrollAnimatorMac.h:
+        * platform/mac/ScrollAnimatorMac.mm: Copied from platform/mac/ScrollAnimatorMac.cpp.
+        (-[ScrollAnimationHelperDelegate initWithScrollAnimator:WebCore::]):
+        (-[ScrollAnimationHelperDelegate bounds]):
+        (-[ScrollAnimationHelperDelegate _immediateScrollToPoint:]):
+        (-[ScrollAnimationHelperDelegate convertSizeToBase:]):
+        (-[ScrollAnimationHelperDelegate convertSizeFromBase:]):
+        (-[ScrollAnimationHelperDelegate superview]):
+        (-[ScrollAnimationHelperDelegate documentView]):
+        (-[ScrollAnimationHelperDelegate window]):
+        (-[ScrollAnimationHelperDelegate _recursiveRecomputeToolTips]):
+        (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::scroll):
+        (WebCore::ScrollAnimatorMac::setScrollPositionAndStopAnimation):
+        (WebCore::ScrollAnimatorMac::currentPosition):
+        (WebCore::ScrollAnimatorMac::immediateScrollToPoint):
+        Add implementation of ScrollAnimator for the Mac.
+
 2010-12-09  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index b5daae9..7a1b190 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -4817,6 +4817,7 @@
 		BC491B780C023EFD009D6316 /* JSHTMLMarqueeElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */; };
 		BC491B790C023EFD009D6316 /* JSHTMLMarqueeElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */; };
 		BC4EDEF40C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */; };
+		BC51156E12B1749C00C96754 /* ScrollAnimatorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC51156D12B1749C00C96754 /* ScrollAnimatorMac.mm */; };
 		BC5156E80C03B741008BB0EE /* DOMHTMLMarqueeElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */; };
 		BC5156E90C03B741008BB0EE /* DOMHTMLMarqueeElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */; };
 		BC5156EA0C03B741008BB0EE /* DOMHTMLMarqueeElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC5156E70C03B741008BB0EE /* DOMHTMLMarqueeElementInternal.h */; };
@@ -5039,7 +5040,6 @@
 		BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */; };
 		BCACF3BC1072921A00C0C8A3 /* UserContentURLPattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */; };
 		BCACF3BD1072921A00C0C8A3 /* UserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		BCAE1FA612939DB7004CB026 /* ScrollAnimatorMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCAE1FA412939DB7004CB026 /* ScrollAnimatorMac.cpp */; };
 		BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */; };
 		BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */; };
 		BCB16C170979C3BD00467741 /* MemoryCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */; };
@@ -11045,6 +11045,7 @@
 		BC491B760C023EFD009D6316 /* JSHTMLMarqueeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMarqueeElement.cpp; sourceTree = "<group>"; };
 		BC491B770C023EFD009D6316 /* JSHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLMarqueeElement.h; sourceTree = "<group>"; };
 		BC4EDEF30C08F3FB007EDD49 /* JSHTMLAppletElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLAppletElementCustom.cpp; sourceTree = "<group>"; };
+		BC51156D12B1749C00C96754 /* ScrollAnimatorMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollAnimatorMac.mm; sourceTree = "<group>"; };
 		BC5156E50C03B741008BB0EE /* DOMHTMLMarqueeElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLMarqueeElement.h; sourceTree = "<group>"; };
 		BC5156E60C03B741008BB0EE /* DOMHTMLMarqueeElement.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMHTMLMarqueeElement.mm; sourceTree = "<group>"; };
 		BC5156E70C03B741008BB0EE /* DOMHTMLMarqueeElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMHTMLMarqueeElementInternal.h; sourceTree = "<group>"; };
@@ -11284,7 +11285,6 @@
 		BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Scrollbar.cpp; path = platform/Scrollbar.cpp; sourceTree = SOURCE_ROOT; };
 		BCACF3BA1072921A00C0C8A3 /* UserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserContentURLPattern.cpp; sourceTree = "<group>"; };
 		BCACF3BB1072921A00C0C8A3 /* UserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserContentURLPattern.h; sourceTree = "<group>"; };
-		BCAE1FA412939DB7004CB026 /* ScrollAnimatorMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollAnimatorMac.cpp; sourceTree = "<group>"; };
 		BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimatorMac.h; sourceTree = "<group>"; };
 		BCAEFCAD1016CE4A0040D34E /* DOMRGBColor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMRGBColor.mm; sourceTree = "<group>"; };
 		BCB16BFE0979C3BD00467741 /* MemoryCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryCache.cpp; sourceTree = "<group>"; };
@@ -13645,7 +13645,7 @@
 				447D69010FA626810015CCB1 /* RuntimeApplicationChecks.h */,
 				447D69020FA626810015CCB1 /* RuntimeApplicationChecks.mm */,
 				1CE24F960D7CAF0E007E04C2 /* SchedulePairMac.mm */,
-				BCAE1FA412939DB7004CB026 /* ScrollAnimatorMac.cpp */,
+				BC51156D12B1749C00C96754 /* ScrollAnimatorMac.mm */,
 				BCAE1FA512939DB7004CB026 /* ScrollAnimatorMac.h */,
 				BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */,
 				BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */,
@@ -24262,7 +24262,6 @@
 				4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */,
 				934CC0E10ED39D6F00A658F2 /* ScriptValue.cpp in Sources */,
 				CA3BF67C10D99BAE00E6CE53 /* ScrollAnimator.cpp in Sources */,
-				BCAE1FA612939DB7004CB026 /* ScrollAnimatorMac.cpp in Sources */,
 				BCAA90C30A7EBA60008B1229 /* Scrollbar.cpp in Sources */,
 				BC9BC64D0E7C4889008B9849 /* ScrollbarClient.cpp in Sources */,
 				BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */,
@@ -24826,6 +24825,7 @@
 				FDA15ECD12B03F61003A583A /* JSJavaScriptAudioNode.cpp in Sources */,
 				FDA15ED112B03F94003A583A /* JSDelayNode.cpp in Sources */,
 				494BC40D12AEDD9E00743BD2 /* TransformationMatrixCA.cpp in Sources */,
+				BC51156E12B1749C00C96754 /* ScrollAnimatorMac.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/platform/mac/ScrollAnimatorMac.cpp b/WebCore/platform/mac/ScrollAnimatorMac.cpp
deleted file mode 100644
index f127a62..0000000
--- a/WebCore/platform/mac/ScrollAnimatorMac.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(SMOOTH_SCROLLING)
-
-#include "ScrollAnimatorMac.h"
-
-namespace WebCore {
-
-ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
-{
-    return new ScrollAnimatorMac(client);
-}
-
-ScrollAnimatorMac::ScrollAnimatorMac(ScrollbarClient* client)
-    : ScrollAnimator(client)
-{
-}
-
-ScrollAnimatorMac::~ScrollAnimatorMac()
-{
-}
-
-bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity granularity, float step, float multiplier)
-{
-    return ScrollAnimator::scroll(orientation, granularity, step, multiplier);
-}
-
-void ScrollAnimatorMac::setScrollPositionAndStopAnimation(ScrollbarOrientation orientation, float pos)
-{
-    return ScrollAnimator::setScrollPositionAndStopAnimation(orientation, pos);
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(SMOOTH_SCROLLING)
diff --git a/WebCore/platform/mac/ScrollAnimatorMac.h b/WebCore/platform/mac/ScrollAnimatorMac.h
index 3beaa4e..234e43c 100644
--- a/WebCore/platform/mac/ScrollAnimatorMac.h
+++ b/WebCore/platform/mac/ScrollAnimatorMac.h
@@ -28,8 +28,15 @@
 
 #if ENABLE(SMOOTH_SCROLLING)
 
+#include "FloatPoint.h"
 #include "ScrollAnimator.h"
-#include "Timer.h"
+#include <wtf/RetainPtr.h>
+
+#ifdef __OBJC__
+ at class ScrollAnimationHelperDelegate;
+#else
+class ScrollAnimationHelperDelegate;
+#endif
 
 namespace WebCore {
 
@@ -40,6 +47,14 @@ public:
 
     virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, float multiplier);
     virtual void setScrollPositionAndStopAnimation(ScrollbarOrientation, float position);
+
+    // Called by the ScrollAnimationHelperDelegate.
+    FloatPoint currentPosition() const;
+    void immediateScrollToPoint(const FloatPoint& newPosition);
+
+private:
+    RetainPtr<id> m_scrollAnimationHelper;
+    RetainPtr<ScrollAnimationHelperDelegate> m_scrollAnimationHelperDelegate;
 };
 
 } // namespace WebCore
diff --git a/WebCore/platform/mac/ScrollAnimatorMac.mm b/WebCore/platform/mac/ScrollAnimatorMac.mm
new file mode 100644
index 0000000..c8aec8c
--- /dev/null
+++ b/WebCore/platform/mac/ScrollAnimatorMac.mm
@@ -0,0 +1,179 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(SMOOTH_SCROLLING)
+
+#include "ScrollAnimatorMac.h"
+#include "ScrollbarClient.h"
+
+ at interface NSObject (NSScrollAnimationHelperDetails)
+- (id)initWithDelegate:(id)delegate;
+- (void)_stopRun;
+- (BOOL)_isAnimating;
+- (NSPoint)targetOrigin;
+ at end
+
+ at interface ScrollAnimationHelperDelegate : NSObject
+{
+    WebCore::ScrollAnimatorMac* _animator;
+}
+
+- (id)initWithScrollAnimator:(WebCore::ScrollAnimatorMac*)scrollAnimator;
+
+- (NSRect)bounds;
+- (void)_immediateScrollToPoint:(NSPoint)newPosition;
+- (NSSize)convertSizeToBase:(NSSize)size;
+- (NSSize)convertSizeFromBase:(NSSize)size;
+
+- (id)superview; // Return nil.
+- (id)documentView; // Return nil.
+- (id)window; // Return nil.
+- (void)_recursiveRecomputeToolTips; // No-op.
+ at end
+
+static NSSize abs(NSSize size)
+{
+    NSSize finalSize = size;
+    if (finalSize.width < 0)
+        finalSize.width = -finalSize.width;
+    if (finalSize.height < 0)
+        finalSize.height = -finalSize.height;
+    return finalSize;    
+}
+
+ at implementation ScrollAnimationHelperDelegate
+
+- (id)initWithScrollAnimator:(WebCore::ScrollAnimatorMac*)scrollAnimator
+{
+    self = [super init];
+    if (!self)
+        return nil;
+
+    _animator = scrollAnimator;
+    return self;
+}
+
+- (NSRect)bounds
+{
+    WebCore::FloatPoint currentPosition = _animator->currentPosition();
+    return NSMakeRect(currentPosition.x(), currentPosition.y(), 0, 0);
+}
+
+- (void)_immediateScrollToPoint:(NSPoint)newPosition
+{
+    _animator->immediateScrollToPoint(newPosition);
+}
+
+- (NSSize)convertSizeToBase:(NSSize)size
+{
+    return abs(size);
+}
+
+- (NSSize)convertSizeFromBase:(NSSize)size
+{
+    return abs(size);
+}
+
+- (id)superview
+{
+    return nil;
+}
+
+- (id)documentView
+{
+    return nil;
+}
+
+- (id)window
+{
+    return nil;
+}
+
+- (void)_recursiveRecomputeToolTips
+{
+}
+
+ at end
+
+namespace WebCore {
+
+ScrollAnimator* ScrollAnimator::create(ScrollbarClient* client)
+{
+    return new ScrollAnimatorMac(client);
+}
+
+ScrollAnimatorMac::ScrollAnimatorMac(ScrollbarClient* client)
+    : ScrollAnimator(client)
+{
+    m_scrollAnimationHelperDelegate.adoptNS([[ScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
+    m_scrollAnimationHelper.adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
+}
+
+ScrollAnimatorMac::~ScrollAnimatorMac()
+{
+}
+
+bool ScrollAnimatorMac::scroll(ScrollbarOrientation orientation, ScrollGranularity, float step, float multiplier)
+{
+    float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_currentPosY;
+    float newPos = std::max<float>(std::min<float>(currentPos + (step * multiplier), static_cast<float>(m_client->scrollSize(orientation))), 0);
+    if (currentPos == newPos)
+        return false;
+
+    NSPoint newPoint;
+    if ([m_scrollAnimationHelper.get() _isAnimating]) {
+        NSPoint targetOrigin = [m_scrollAnimationHelper.get() targetOrigin];
+        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targetOrigin.y) : NSMakePoint(targetOrigin.x, newPos);
+    } else
+        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, m_currentPosY) : NSMakePoint(m_currentPosX, newPos);
+
+    [m_scrollAnimationHelper.get() scrollToPoint:newPoint];
+    return true;
+}
+
+void ScrollAnimatorMac::setScrollPositionAndStopAnimation(ScrollbarOrientation orientation, float pos)
+{
+    [m_scrollAnimationHelper.get() _stopRun];
+    ScrollAnimator::setScrollPositionAndStopAnimation(orientation, pos);
+}
+
+FloatPoint ScrollAnimatorMac::currentPosition() const
+{
+    return FloatPoint(m_currentPosX, m_currentPosY);
+}
+
+void ScrollAnimatorMac::immediateScrollToPoint(const FloatPoint& newPosition)
+{
+    m_currentPosX = newPosition.x();
+    m_currentPosY = newPosition.y();
+
+    m_client->setScrollOffsetFromAnimation(IntPoint(m_currentPosX, m_currentPosY));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SMOOTH_SCROLLING)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list