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 1aea0a0d24ec321486603e37668824d1eccd962d..80972f4cbf1d9cae23a84b819a63ae0c5b7abe9e 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 b5931ecba79de1035eb820bf3373cea437bb10ab..40275f24e806170de03f40115266e021b4f3f642 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 e5287c0cb2370126aee9f4f5cf833a809adbc5c6..fa9bbcacef03f306368491860ba8e55b59fc1ec6 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 341556bac83b5b9c92e582b4d037c917b631ec0b..3a429f55cf161d35dc9678bfad7ab7696e254161 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 109de3bc434c4249e1691307431d2dbef237989d..6d4bc9f69f523453b68e4923decdb3da502d2a4f 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 806d92b6d5242f0be19160f3274865f79de17c7e..495441d54ccbc370ab239595837986797d068ba4 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 d76563d095f00ad9421ce4a7048f48fb70d7a36b..b56b68b5e308436649c8a71b40611fb0fa169bf5 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 6d6c05b17f31b7f8f2a38152ff3d15247c3fda13..a7e42c3a98a2b0cd3dcd15b8a437a7b33738e6d3 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 28c2b845b2112c228890d4c5a84988ae169120f4..56a547121a341537d801f73177c1495c2b72f8d5 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 4ca1d0e038d90d553e3ae060a3ebe39a146c547a..fd50ec78fa1cd9161f179b6f066eb0b50edfc388 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 0139046982804312dcf2c9666962d8e9043f6cca..625c7f0a8fc2dc1311ec68e3ee735ae3f9af670c 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 cde32ab358c9c805423454bf2b81a26995a1bf18..be4c3d365cc799c4ad2a4efd1b0126ca0c1a8e77 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 14f5ae2486799f8d474386402c5e995f61218fa6..15149963441baac3968c461a3e36649426c19461 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 fd2c5a6a470391579336581a75508586952e090e..371a6c672605d0eea2c79257e5eb2a8cd8e2f9b2 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 05759c27c2d0adfdafadb03d3873e4656011a106..e4ebc32d5dc776c3e3bfcbb7b6c8c90312d7426b 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 fbf1fa221b88dbc18319abc75c651523b1ea6aa3..02345158819defb70168a8f01b0c5a1e61914eb6 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 c54995629c766d849da67b94b8e5aa8066395764..7f2e478c625c25a7e20b33661aabea70307db355 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 10057adc2aa90fc796813a7d77f7f5a59870d0de..a99bf484e5a1b4fc567239b64a6417cad355f55b 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 */ = {