Support Autoscrolling in contenteditable for WK2
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Dec 2017 20:13:56 +0000 (20:13 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Dec 2017 20:13:56 +0000 (20:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180789

Source/WebCore:

Reviewed by Simon Frasier and Wenson Hsieh..

Activate the autoscrollController to scroll to the position provided to us by the
UIProcess. Allows for scrolling in contentEditable for WebKit2

Test: fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html

* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::autoscrollTimerFired):
* page/EventHandler.cpp:
(WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
(WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
(WebCore::EventHandler::shouldUpdateAutoscroll):
(WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted.
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::startTextAutoscroll):
(WebCore::EventHandler::cancelTextAutoscroll):
(WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
(WebCore::EventHandler::shouldUpdateAutoscroll):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
(WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted.

Source/WebKit:

Reviewed by Simon Frasier and Wenson Hsieh.

Implements the UIKit protocol for autoscrolling and alerts the Web Process to start
(or stop) an autoscroll to the specified position. Allows for scrolling in contenteditable
in WebKit2.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView startAutoscroll:]):
(-[WKContentView cancelAutoscroll]):
(-[WKContentView scrollSelectionToVisible:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::startAutoscrollAtPosition):
(WebKit::WebPageProxy::cancelAutoscroll):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::startAutoscrollAtPosition):
(WebKit::WebPage::cancelAutoscroll):

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

20 files changed:
LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html [new file with mode: 0644]
LayoutTests/fast/events/touch/ios/resources/basic-gestures.js
Source/WebCore/ChangeLog
Source/WebCore/page/AutoscrollController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/ios/EventHandlerIOS.mm
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/rendering/RenderLayer.cpp
Source/WebKit/ChangeLog
Source/WebKit/Platform/spi/ios/UIKitSPI.h
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/bmalloc/bmalloc.xcodeproj/project.pbxproj

diff --git a/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable-expected.txt b/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable-expected.txt
new file mode 100644 (file)
index 0000000..81ae182
--- /dev/null
@@ -0,0 +1,3 @@
+PASS: Text Box has been scrolled.
+PASS: Correct Cursor Location
+
diff --git a/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html b/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html
new file mode 100644 (file)
index 0000000..58c3210
--- /dev/null
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <script src="resources/basic-gestures.js"></script>
+    <script src="resources/gesture-helpers.js"></script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+    
+        function runTest()
+        {
+            if (!testRunner.runUIScript)
+                return;
+        
+            var output = '';
+            var scrollBox = document.getElementById('textbox');
+            var targetRect = scrollBox.getBoundingClientRect();
+            
+            var tapPointX = targetRect.x + targetRect.width / 2;
+            var tapPointY = targetRect.y + targetRect.height / 2;
+            var dragX = targetRect.x + targetRect.width;
+            
+            var textLength = scrollBox.value.length;
+
+            if (testRunner.runUIScript) {
+                testRunner.runUIScript(tapAtPoint(tapPointX, tapPointY), function() {
+                    testRunner.runUIScript(didShowKeyboard(), function() {
+                        testRunner.runUIScript(longPressAndHoldAtPoint(tapPointX, tapPointY), function() {
+                            testRunner.runUIScript(continueTouchAndDragFromPointToPoint(tapPointX, tapPointY, dragX, tapPointY), function() {
+                                testRunner.runUIScript(holdAtPoint(dragX, tapPointY, 2.0), function() {
+                                    testRunner.runUIScript(continueTouchAndDragFromPointToPoint(dragX, tapPointY, dragX + 5, tapPointY), function() {
+                                        if (scrollBox.scrollLeft > 0)
+                                            output += 'PASS: Text Box has been scrolled.';
+                                        else
+                                            output += 'FAIL: Text Box has not been scrolled';
+                                        output += '<br>';
+                                                           
+                                        if ((scrollBox.selectionStart == scrollBox.selectionEnd) && (scrollBox.selectionStart == textLength))
+                                            output += 'PASS: Correct Cursor Location';
+                                        else
+                                            output += 'FAIL: cursor is at an unexpected position:' + scrollBox.selectionStart;
+                                        output += '<br>';
+                                   
+                                        document.getElementById('target').innerHTML = output;
+                                        testRunner.notifyDone();
+                                    });
+                                });
+                            });
+                        });
+                    });
+                });
+            }
+        }
+    
+        window.addEventListener('load', runTest, false);
+    </script>
+    <style>
+        #target {
+            height: 100px;
+            width: 300px;
+            background-color: silver;
+            font-family: monospace;
+            font-size: 18px;
+        }
+    </style>
+    <meta name="viewport" content="initial-scale=1">
+</head>
+<body>
+    <div id="target">
+        <input id="textbox" type="text" value="Lorem ipsum dolor sit amet, consectetur adipiscing elit" size="25"><br>
+        
+        This test requires UIScriptController to run.
+    </div>
+</body>
+</html>
index 1aea0a0..80972f4 100644 (file)
@@ -1,3 +1,14 @@
+function didShowKeyboard()
+{
+       return `
+       (function() {
+        uiController.didShowKeyboardCallback = function() {
+            uiController.uiScriptComplete();
+               }
+    })();`
+}
+
+
 function longPressAtPoint(x, y)
 {
     return `
@@ -8,7 +19,17 @@ function longPressAtPoint(x, y)
     })();`
 }
 
-function longPressAndHoldAtPoint(X, Y)
+function liftUpAtPoint(x, y)
+{
+    return `
+    (function() {
+        uiController.liftUpAtPoint(${x}, ${y}, 1, function() {
+            uiController.uiScriptComplete();
+        });
+    })();`
+}
+
+function longPressAndHoldAtPoint(x, y)
 {
     return `
     (function() {
@@ -26,8 +47,8 @@ function longPressAndHoldAtPoint(X, Y)
                         inputType : "finger",
                         phase : "began",
                         id : 1,
-                        x : ${X},
-                        y : ${Y},
+                        x : ${x},
+                        y : ${y},
                         pressure : 0
                     }
                 ]
@@ -40,8 +61,8 @@ function longPressAndHoldAtPoint(X, Y)
                         inputType : "finger",
                         phase : "moved",
                         id : 1,
-                        x : ${X},
-                        y : ${Y},
+                        x : ${x},
+                        y : ${y},
                         pressure : 0
                     }
                 ]
@@ -108,6 +129,51 @@ function touchAndDragFromPointToPoint(startX, startY, endX, endY)
     })();`
 }
 
+function holdAtPoint(x, y)
+{
+    return `
+    (function() {
+    var eventStream = {
+    events : [
+        {
+            interpolate : "linear",
+            timestep: 0.1,
+            coordinateSpace : "content",
+            startEvent : {
+                inputType : "hand",
+                timeOffset : 0,
+                touches : [
+                    {
+                        inputType : "finger",
+                        phase : "moved",
+                        id : 1,
+                        x : ${x},
+                        y : ${y},
+                        pressure : 0
+                    }
+                ]
+            },
+            endEvent : {
+                inputType : "hand",
+                timeOffset : 5.0,
+                touches : [
+                    {
+                        inputType : "finger",
+                        phase : "moved",
+                        id : 1,
+                        x : ${x},
+                        y : ${y},
+                        pressure : 0
+                    }
+                ]
+            }
+    }]};
+    
+    uiController.sendEventStream(JSON.stringify(eventStream), function() {});
+        uiController.uiScriptComplete();
+    })();`
+}
+
 function continueTouchAndDragFromPointToPoint(startX, startY, endX, endY)
 {
     return `
index b5931ec..40275f2 100644 (file)
@@ -1,3 +1,32 @@
+2017-12-18  Megan Gardner  <megan_gardner@apple.com>
+
+        Support Autoscrolling in contenteditable for WK2
+        https://bugs.webkit.org/show_bug.cgi?id=180789
+
+        Reviewed by Simon Frasier and Wenson Hsieh..
+
+        Activate the autoscrollController to scroll to the position provided to us by the
+        UIProcess. Allows for scrolling in contentEditable for WebKit2
+
+        Test: fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html
+
+        * page/AutoscrollController.cpp:
+        (WebCore::AutoscrollController::autoscrollTimerFired):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
+        (WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
+        (WebCore::EventHandler::shouldUpdateAutoscroll):
+        (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted.
+        * page/EventHandler.h:
+        * page/ios/EventHandlerIOS.mm:
+        (WebCore::EventHandler::startTextAutoscroll):
+        (WebCore::EventHandler::cancelTextAutoscroll):
+        (WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
+        (WebCore::EventHandler::shouldUpdateAutoscroll):
+        * page/mac/EventHandlerMac.mm:
+        (WebCore::EventHandler::targetPositionForSelectionAutoscroll const):
+        (WebCore::EventHandler::effectiveMousePositionForSelectionAutoscroll const): Deleted.
+
 2017-12-18  Youenn Fablet  <youenn@apple.com>
 
         Add support for response blob given to fetch events
index e5287c0..fa9bbca 100644 (file)
@@ -243,14 +243,14 @@ void AutoscrollController::autoscrollTimerFired()
             m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePosition);
         break;
     case AutoscrollForSelection: {
-        if (!frame.eventHandler().mousePressed()) {
+        if (!frame.eventHandler().shouldUpdateAutoscroll()) {
             stopAutoscrollTimer();
             return;
         }
 #if ENABLE(DRAG_SUPPORT)
         frame.eventHandler().updateSelectionForMouseDrag();
 #endif
-        m_autoscrollRenderer->autoscroll(frame.eventHandler().effectiveMousePositionForSelectionAutoscroll());
+        m_autoscrollRenderer->autoscroll(frame.eventHandler().targetPositionInWindowForSelectionAutoscroll());
         break;
     }
     case NoAutoscroll:
index 341556b..3a429f5 100644 (file)
@@ -2681,16 +2681,30 @@ void EventHandler::platformNotifyIfEndGesture(const PlatformWheelEvent&, const W
 {
 }
 
-IntPoint EventHandler::effectiveMousePositionForSelectionAutoscroll() const
+void EventHandler::clearOrScheduleClearingLatchedStateIfNeeded(const PlatformWheelEvent&)
+{
+    clearLatchedState();
+}
+    
+#if !PLATFORM(IOS)
+    
+IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const
 {
     return m_lastKnownMousePosition;
 }
-
-void EventHandler::clearOrScheduleClearingLatchedStateIfNeeded(const PlatformWheelEvent&)
+    
+#endif // !PLATFORM(IOS)
+    
+#endif // !PLATFORM(MAC)
+    
+#if !PLATFORM(IOS)
+    
+bool EventHandler::shouldUpdateAutoscroll()
 {
-    clearLatchedState();
+    return mousePressed();
 }
-#endif
+    
+#endif // !PLATFORM(IOS)
 
 Widget* EventHandler::widgetForEventTarget(Element* eventTarget)
 {
index 109de3b..6d4bc9f 100644 (file)
@@ -31,6 +31,7 @@
 #include "HitTestRequest.h"
 #include "LayoutPoint.h"
 #include "PlatformMouseEvent.h"
+#include "RenderObject.h"
 #include "ScrollTypes.h"
 #include "TextEventInputType.h"
 #include "TextGranularity.h"
@@ -188,7 +189,8 @@ public:
     IntPoint lastKnownMouseGlobalPosition() const { return m_lastKnownMouseGlobalPosition; }
     Cursor currentMouseCursor() const { return m_currentMouseCursor; }
 
-    IntPoint effectiveMousePositionForSelectionAutoscroll() const;
+    IntPoint targetPositionInWindowForSelectionAutoscroll() const;
+    bool shouldUpdateAutoscroll();
 
     static Frame* subframeForTargetNode(Node*);
     static Frame* subframeForHitTestResult(const MouseEventWithHitTestResults&);
@@ -332,6 +334,13 @@ public:
 #if ENABLE(DATA_INTERACTION)
     WEBCORE_EXPORT bool tryToBeginDataInteractionAtPoint(const IntPoint& clientPosition, const IntPoint& globalPosition);
 #endif
+    
+#if PLATFORM(IOS)
+    WEBCORE_EXPORT void startTextAutoscroll(RenderObject* renderer, const FloatPoint& positionInWindow);
+    WEBCORE_EXPORT void cancelTextAutoscroll();
+    IntPoint m_targetAutoscrollPositionInWindow;
+    bool m_isAutoscrolling { false };
+#endif
 
 private:
 #if ENABLE(DRAG_SUPPORT)
index 806d92b..495441d 100644 (file)
@@ -27,6 +27,7 @@
 #import "EventHandler.h"
 
 #import "AXObjectCache.h"
+#import "AutoscrollController.h"
 #import "Chrome.h"
 #import "ChromeClient.h"
 #import "DataTransfer.h"
@@ -558,6 +559,29 @@ PlatformMouseEvent EventHandler::currentPlatformMouseEvent() const
 {
     return PlatformEventFactory::createPlatformMouseEvent(currentEvent());
 }
+    
+void EventHandler::startTextAutoscroll(RenderObject* renderer, const FloatPoint& positionInWindow)
+{
+    m_targetAutoscrollPositionInWindow = roundedIntPoint(positionInWindow);
+    m_isAutoscrolling = true;
+    m_autoscrollController->startAutoscrollForSelection(renderer);
+}
+
+void EventHandler::cancelTextAutoscroll()
+{
+    m_isAutoscrolling = false;
+    m_autoscrollController->stopAutoscrollTimer();
+}
+    
+IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const
+{
+    return m_targetAutoscrollPositionInWindow;
+}
+    
+bool EventHandler::shouldUpdateAutoscroll()
+{
+    return m_isAutoscrolling;
+}
 
 #if ENABLE(DRAG_SUPPORT)
 
index d76563d..b56b68b 100644 (file)
@@ -1141,7 +1141,7 @@ static IntSize autoscrollAdjustmentFactorForScreenBoundaries(const IntPoint& scr
     return adjustmentFactor;
 }
 
-IntPoint EventHandler::effectiveMousePositionForSelectionAutoscroll() const
+IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const
 {
     Page* page = m_frame.page();
     if (!page)
index 6d6c05b..a7e42c3 100644 (file)
@@ -2752,9 +2752,9 @@ LayoutRect RenderLayer::getRectToExpose(const LayoutRect &visibleRect, const Lay
     return LayoutRect(LayoutPoint(x, y), visibleRect.size());
 }
 
-void RenderLayer::autoscroll(const IntPoint& position)
+void RenderLayer::autoscroll(const IntPoint& positionInWindow)
 {
-    IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(position);
+    IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(positionInWindow);
     scrollRectToVisible(SelectionRevealMode::Reveal, LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded);
 }
 
index 28c2b84..56a5471 100644 (file)
@@ -1,3 +1,30 @@
+2017-12-18  Megan Gardner  <megan_gardner@apple.com>
+
+        Support Autoscrolling in contenteditable for WK2
+        https://bugs.webkit.org/show_bug.cgi?id=180789
+
+        Reviewed by Simon Frasier and Wenson Hsieh.
+
+        Implements the UIKit protocol for autoscrolling and alerts the Web Process to start
+        (or stop) an autoscroll to the specified position. Allows for scrolling in contenteditable
+        in WebKit2.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView startAutoscroll:]):
+        (-[WKContentView cancelAutoscroll]):
+        (-[WKContentView scrollSelectionToVisible:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::startAutoscrollAtPosition):
+        (WebKit::WebPageProxy::cancelAutoscroll):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::startAutoscrollAtPosition):
+        (WebKit::WebPage::cancelAutoscroll):
+
 2017-12-18  Youenn Fablet  <youenn@apple.com>
 
         Add support for response blob given to fetch events
index 4ca1d0e..fd50ec7 100644 (file)
@@ -625,6 +625,13 @@ typedef NS_ENUM(NSInteger, UIWKGestureType) {
 - (CGRect)unobscuredContentRect;
 @end
 
+@protocol UITextAutoscrolling
+- (void)startAutoscroll:(CGPoint)point;
+- (void)cancelAutoscroll;
+- (void)scrollSelectionToVisible:(BOOL)animated;
+@end
+
+
 @protocol UIWebFormAccessoryDelegate;
 
 @interface UIWebFormAccessory : UIInputView
index 0139046..625c7f0 100644 (file)
@@ -582,6 +582,8 @@ public:
     void requestRectsAtSelectionOffsetWithText(int32_t offset, const String&, WTF::Function<void(const Vector<WebCore::SelectionRect>&, CallbackBase::Error)>&&);
     void autofillLoginCredentials(const String& username, const String& password);
     void storeSelectionForAccessibility(bool);
+    void startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow);
+    void cancelAutoscroll();
 #if ENABLE(DATA_INTERACTION)
     void didPerformDataInteractionControllerOperation(bool handled);
     void didHandleStartDataInteractionRequest(bool started);
index cde32ab..be4c3d3 100644 (file)
@@ -241,7 +241,7 @@ struct WKAutoCorrectionData {
 
 @end
 
-@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UIWebTouchEventsGestureRecognizerDelegate, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWKInteractionViewProtocol, WKFileUploadPanelDelegate, WKActionSheetAssistantDelegate
+@interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UIWebTouchEventsGestureRecognizerDelegate, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWKInteractionViewProtocol, WKFileUploadPanelDelegate, WKActionSheetAssistantDelegate, UITextAutoscrolling
 #if ENABLE(DATA_INTERACTION)
     , UIDragInteractionDelegate, UIDropInteractionDelegate
 #endif
index 14f5ae2..1514996 100644 (file)
@@ -691,6 +691,24 @@ const CGFloat minimumTapHighlightRadius = 2.0;
     return _page->unobscuredContentRect();
 }
 
+
+#pragma mark - UITextAutoscrolling
+- (void)startAutoscroll:(CGPoint)point
+{
+    _page->startAutoscrollAtPosition(point);
+}
+
+- (void)cancelAutoscroll
+{
+    _page->cancelAutoscroll();
+}
+
+- (void)scrollSelectionToVisible:(BOOL)animated
+{
+    // Used to scroll selection on keyboard up; we already scroll to visible.
+}
+
+
 - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
 {
     ASSERT([keyPath isEqualToString:@"transform"]);
index fd2c5a6..371a6c6 100644 (file)
@@ -713,6 +713,16 @@ void WebPageProxy::storeSelectionForAccessibility(bool shouldStore)
     m_process->send(Messages::WebPage::StoreSelectionForAccessibility(shouldStore), m_pageID);
 }
 
+void WebPageProxy::startAutoscrollAtPosition(const WebCore::FloatPoint& position)
+{
+    m_process->send(Messages::WebPage::StartAutoscrollAtPosition(position), m_pageID);
+}
+    
+void WebPageProxy::cancelAutoscroll()
+{
+    m_process->send(Messages::WebPage::CancelAutoscroll(), m_pageID);
+}
+
 void WebPageProxy::moveSelectionByOffset(int32_t offset, WTF::Function<void (CallbackBase::Error)>&& callbackFunction)
 {
     if (!isValid()) {
index 05759c2..e4ebc32 100644 (file)
@@ -605,6 +605,8 @@ public:
     void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID);
     void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID);
     void storeSelectionForAccessibility(bool);
+    void startAutoscrollAtPosition(const WebCore::FloatPoint&);
+    void cancelAutoscroll();
 
     void contentSizeCategoryDidChange(const String&);
 
index fbf1fa2..0234515 100644 (file)
@@ -99,6 +99,8 @@ messages -> WebPage LegacyReceiver {
     GetRectsForGranularityWithSelectionOffset(uint32_t granularity, int32_t offset, WebKit::CallbackID callbackID)
     GetRectsAtSelectionOffsetWithText(int32_t offset, String text, WebKit::CallbackID callbackID)
     StoreSelectionForAccessibility(bool shouldStore)
+    StartAutoscrollAtPosition(WebCore::FloatPoint positionInWindow)
+    CancelAutoscroll()
 #endif
 
     SetControlledByAutomation(bool controlled)
index c549956..7f2e478 100644 (file)
@@ -1381,6 +1381,17 @@ void WebPage::moveSelectionByOffset(int32_t offset, CallbackID callbackID)
         frame.selection().setSelectedRange(Range::create(*frame.document(), position, position).ptr(), position.affinity(), true, UserTriggered);
     send(Messages::WebPageProxy::VoidCallback(callbackID));
 }
+    
+void WebPage::startAutoscrollAtPosition(const WebCore::FloatPoint& positionInWindow)
+{
+    if (m_assistedNode && m_assistedNode->renderer())
+        m_page->mainFrame().eventHandler().startTextAutoscroll(m_assistedNode->renderer(), positionInWindow);
+}
+    
+void WebPage::cancelAutoscroll()
+{
+    m_page->mainFrame().eventHandler().cancelTextAutoscroll();
+}
 
 void WebPage::getRectsForGranularityWithSelectionOffset(uint32_t granularity, int32_t offset, CallbackID callbackID)
 {
index 10057ad..a99bf48 100644 (file)
                0F5BF1721F23C5710029D91D /* BExport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BExport.h; path = bmalloc/BExport.h; sourceTree = "<group>"; };
                0F74B93C1F89713E00B935D3 /* CryptoRandom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CryptoRandom.h; path = bmalloc/CryptoRandom.h; sourceTree = "<group>"; };
                0F74B93D1F89713E00B935D3 /* CryptoRandom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CryptoRandom.cpp; path = bmalloc/CryptoRandom.cpp; sourceTree = "<group>"; };
-               0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; name = libtestbmalloc; path = testbmalloc; sourceTree = BUILT_PRODUCTS_DIR; };
+               0F7EB7EF1F95285300F1ABCB /* testbmalloc */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testbmalloc; sourceTree = BUILT_PRODUCTS_DIR; };
                0F7EB7F11F95285300F1ABCB /* testbmalloc.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = testbmalloc.cpp; sourceTree = "<group>"; };
                0F7EB7FC1F9541AD00F1ABCB /* EligibilityResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EligibilityResult.h; path = bmalloc/EligibilityResult.h; sourceTree = SOURCE_ROOT; };
                0F7EB7FD1F9541AD00F1ABCB /* IsoHeapImplInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IsoHeapImplInlines.h; path = bmalloc/IsoHeapImplInlines.h; sourceTree = SOURCE_ROOT; };
                        children = (
                                14F271BE18EA3963008C152F /* libbmalloc.a */,
                                14CC394418EA8743004AFE34 /* libmbmalloc.dylib */,
-                               0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */,
+                               0F7EB7EF1F95285300F1ABCB /* testbmalloc */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                        );
                        name = testbmalloc;
                        productName = testbmalloc;
-                       productReference = 0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */;
+                       productReference = 0F7EB7EF1F95285300F1ABCB /* testbmalloc */;
                        productType = "com.apple.product-type.tool";
                };
                14CC394318EA8743004AFE34 /* mbmalloc */ = {