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)
commitc5af32de9b015c706b42f0e95f1fe1a69b82826f
treec329a2d89cc4ebb477cbef38fceaa83112504211
parent75d83878ecbf08e5a766626ae8c791a0c0746815
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):

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