Title: [226067] trunk
Revision
226067
Author
[email protected]
Date
2017-12-18 12:13:56 -0800 (Mon, 18 Dec 2017)

Log Message

Support Autoscrolling in contenteditable for WK2
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):

Modified Paths

Added Paths

Diff

Added: trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable-expected.txt (0 => 226067)


--- trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable-expected.txt	2017-12-18 20:13:56 UTC (rev 226067)
@@ -0,0 +1,3 @@
+PASS: Text Box has been scrolled.
+PASS: Correct Cursor Location
+

Added: trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html (0 => 226067)


--- trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html	2017-12-18 20:13:56 UTC (rev 226067)
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+    <script src=""
+    <script src=""
+    <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>

Modified: trunk/LayoutTests/fast/events/touch/ios/resources/basic-gestures.js (226066 => 226067)


--- trunk/LayoutTests/fast/events/touch/ios/resources/basic-gestures.js	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/LayoutTests/fast/events/touch/ios/resources/basic-gestures.js	2017-12-18 20:13:56 UTC (rev 226067)
@@ -1,3 +1,14 @@
+function didShowKeyboard()
+{
+	return `
+	(function() {
+        uiController.didShowKeyboardCallback = function() {
+            uiController.uiScriptComplete();
+		}
+    })();`
+}
+
+
 function longPressAtPoint(x, y)
 {
     return `
@@ -8,10 +19,20 @@
     })();`
 }
 
-function longPressAndHoldAtPoint(X, Y)
+function liftUpAtPoint(x, y)
 {
     return `
     (function() {
+        uiController.liftUpAtPoint(${x}, ${y}, 1, function() {
+            uiController.uiScriptComplete();
+        });
+    })();`
+}
+
+function longPressAndHoldAtPoint(x, y)
+{
+    return `
+    (function() {
     var eventStream = {
     events : [
         {
@@ -26,8 +47,8 @@
                         inputType : "finger",
                         phase : "began",
                         id : 1,
-                        x : ${X},
-                        y : ${Y},
+                        x : ${x},
+                        y : ${y},
                         pressure : 0
                     }
                 ]
@@ -40,8 +61,8 @@
                         inputType : "finger",
                         phase : "moved",
                         id : 1,
-                        x : ${X},
-                        y : ${Y},
+                        x : ${x},
+                        y : ${y},
                         pressure : 0
                     }
                 ]
@@ -108,6 +129,51 @@
     })();`
 }
 
+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 `

Modified: trunk/Source/WebCore/ChangeLog (226066 => 226067)


--- trunk/Source/WebCore/ChangeLog	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/ChangeLog	2017-12-18 20:13:56 UTC (rev 226067)
@@ -1,3 +1,32 @@
+2017-12-18  Megan Gardner  <[email protected]>
+
+        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  <[email protected]>
 
         Add support for response blob given to fetch events

Modified: trunk/Source/WebCore/page/AutoscrollController.cpp (226066 => 226067)


--- trunk/Source/WebCore/page/AutoscrollController.cpp	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/page/AutoscrollController.cpp	2017-12-18 20:13:56 UTC (rev 226067)
@@ -243,7 +243,7 @@
             m_autoscrollRenderer->autoscroll(m_dragAndDropAutoscrollReferencePosition);
         break;
     case AutoscrollForSelection: {
-        if (!frame.eventHandler().mousePressed()) {
+        if (!frame.eventHandler().shouldUpdateAutoscroll()) {
             stopAutoscrollTimer();
             return;
         }
@@ -250,7 +250,7 @@
 #if ENABLE(DRAG_SUPPORT)
         frame.eventHandler().updateSelectionForMouseDrag();
 #endif
-        m_autoscrollRenderer->autoscroll(frame.eventHandler().effectiveMousePositionForSelectionAutoscroll());
+        m_autoscrollRenderer->autoscroll(frame.eventHandler().targetPositionInWindowForSelectionAutoscroll());
         break;
     }
     case NoAutoscroll:

Modified: trunk/Source/WebCore/page/EventHandler.cpp (226066 => 226067)


--- trunk/Source/WebCore/page/EventHandler.cpp	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/page/EventHandler.cpp	2017-12-18 20:13:56 UTC (rev 226067)
@@ -2681,16 +2681,30 @@
 {
 }
 
-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)
 {

Modified: trunk/Source/WebCore/page/EventHandler.h (226066 => 226067)


--- trunk/Source/WebCore/page/EventHandler.h	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/page/EventHandler.h	2017-12-18 20:13:56 UTC (rev 226067)
@@ -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 @@
     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 @@
 #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)

Modified: trunk/Source/WebCore/page/ios/EventHandlerIOS.mm (226066 => 226067)


--- trunk/Source/WebCore/page/ios/EventHandlerIOS.mm	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/page/ios/EventHandlerIOS.mm	2017-12-18 20:13:56 UTC (rev 226067)
@@ -27,6 +27,7 @@
 #import "EventHandler.h"
 
 #import "AXObjectCache.h"
+#import "AutoscrollController.h"
 #import "Chrome.h"
 #import "ChromeClient.h"
 #import "DataTransfer.h"
@@ -558,7 +559,30 @@
 {
     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)
 
 bool EventHandler::eventLoopHandleMouseDragged(const MouseEventWithHitTestResults&)

Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (226066 => 226067)


--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm	2017-12-18 20:13:56 UTC (rev 226067)
@@ -1141,7 +1141,7 @@
     return adjustmentFactor;
 }
 
-IntPoint EventHandler::effectiveMousePositionForSelectionAutoscroll() const
+IntPoint EventHandler::targetPositionInWindowForSelectionAutoscroll() const
 {
     Page* page = m_frame.page();
     if (!page)

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (226066 => 226067)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2017-12-18 20:13:56 UTC (rev 226067)
@@ -2752,9 +2752,9 @@
     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);
 }
 

Modified: trunk/Source/WebKit/ChangeLog (226066 => 226067)


--- trunk/Source/WebKit/ChangeLog	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/ChangeLog	2017-12-18 20:13:56 UTC (rev 226067)
@@ -1,3 +1,30 @@
+2017-12-18  Megan Gardner  <[email protected]>
+
+        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  <[email protected]>
 
         Add support for response blob given to fetch events

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (226066 => 226067)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2017-12-18 20:13:56 UTC (rev 226067)
@@ -625,6 +625,13 @@
 - (CGRect)unobscuredContentRect;
 @end
 
+@protocol UITextAutoscrolling
+- (void)startAutoscroll:(CGPoint)point;
+- (void)cancelAutoscroll;
+- (void)scrollSelectionToVisible:(BOOL)animated;
+@end
+
+
 @protocol UIWebFormAccessoryDelegate;
 
 @interface UIWebFormAccessory : UIInputView

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (226066 => 226067)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-12-18 20:13:56 UTC (rev 226067)
@@ -582,6 +582,8 @@
     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);

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (226066 => 226067)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2017-12-18 20:13:56 UTC (rev 226067)
@@ -241,7 +241,7 @@
 
 @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

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (226066 => 226067)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2017-12-18 20:13:56 UTC (rev 226067)
@@ -691,6 +691,24 @@
     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"]);

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (226066 => 226067)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2017-12-18 20:13:56 UTC (rev 226067)
@@ -713,6 +713,16 @@
     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()) {

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (226066 => 226067)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2017-12-18 20:13:56 UTC (rev 226067)
@@ -605,6 +605,8 @@
     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&);
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (226066 => 226067)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2017-12-18 20:13:56 UTC (rev 226067)
@@ -99,6 +99,8 @@
     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)

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (226066 => 226067)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2017-12-18 20:13:56 UTC (rev 226067)
@@ -1381,6 +1381,17 @@
         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)
 {

Modified: trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj (226066 => 226067)


--- trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj	2017-12-18 19:53:23 UTC (rev 226066)
+++ trunk/Source/bmalloc/bmalloc.xcodeproj/project.pbxproj	2017-12-18 20:13:56 UTC (rev 226067)
@@ -185,7 +185,7 @@
 		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; };
@@ -416,7 +416,7 @@
 			children = (
 				14F271BE18EA3963008C152F /* libbmalloc.a */,
 				14CC394418EA8743004AFE34 /* libmbmalloc.dylib */,
-				0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */,
+				0F7EB7EF1F95285300F1ABCB /* testbmalloc */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -659,7 +659,7 @@
 			);
 			name = testbmalloc;
 			productName = testbmalloc;
-			productReference = 0F7EB7EF1F95285300F1ABCB /* libtestbmalloc */;
+			productReference = 0F7EB7EF1F95285300F1ABCB /* testbmalloc */;
 			productType = "com.apple.product-type.tool";
 		};
 		14CC394318EA8743004AFE34 /* mbmalloc */ = {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to