[iOS] Rename some WebKit-internal functions and variables that reference "data intera...
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 19:45:07 +0000 (19:45 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Jan 2019 19:45:07 +0000 (19:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193829

Reviewed by Tim Horton.

Source/WebCore:

No change in behavior.

* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tryToBeginDragAtPoint):
(WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
* platform/ios/WebItemProviderPasteboard.mm:
(linkTemporaryItemProviderFilesToDropStagingDirectory):

Source/WebKit:

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setDragCaretRect):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didHandleDragStartRequest):
(WebKit::PageClientImpl::didConcludeEditDrag):
(WebKit::PageClientImpl::didChangeDragCaretRect):
(WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
(WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
(WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView setupDragAndDropInteractions]):
(-[WKContentView teardownDragAndDropInteractions]):
(-[WKContentView _didHandleDragStartRequest:]):
(-[WKContentView _didConcludeEditDrag:]):
(-[WKContentView _didChangeDragCaretRect:currentRect:]):
(-[WKContentView _dragInteraction:prepareForSession:completion:]):
(-[WKContentView setupDataInteractionDelegates]): Deleted.
(-[WKContentView teardownDataInteractionDelegates]): Deleted.
(-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
(-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
(-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didHandleDragStartRequest):
(WebKit::WebPageProxy::requestDragStart):
(WebKit::WebPageProxy::didConcludeEditDrag):
(WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
(WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
(WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::didConcludeEditDrag):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::requestDragStart):
(WebKit::WebPage::requestAdditionalItemsForDragSession):
(WebKit::WebPage::didConcludeEditDrag):
(WebKit::WebPage::requestStartDataInteraction): Deleted.
(WebKit::WebPage::didConcludeEditDataInteraction): Deleted.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebDragClient.mm:
(WebDragClient::didConcludeEditDrag):
* WebView/WebView.mm:
(-[WebView _requestStartDataInteraction:globalPosition:]):
(-[WebView _didConcludeEditDrag]):
(-[WebView _didConcludeEditDataInteraction]): Deleted.
* WebView/WebViewInternal.h:

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

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.h
Source/WebCore/page/ios/EventHandlerIOS.mm
Source/WebCore/platform/ios/WebItemProviderPasteboard.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/WebPageProxy.messages.in
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.mm
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewInternal.h

index 33abcc8..52ec35a 100644 (file)
@@ -1,3 +1,19 @@
+2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
+        https://bugs.webkit.org/show_bug.cgi?id=193829
+
+        Reviewed by Tim Horton.
+
+        No change in behavior.
+
+        * page/EventHandler.h:
+        * page/ios/EventHandlerIOS.mm:
+        (WebCore::EventHandler::tryToBeginDragAtPoint):
+        (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
+        * platform/ios/WebItemProviderPasteboard.mm:
+        (linkTemporaryItemProviderFilesToDropStagingDirectory):
+
 2019-01-25  Jon Davis  <jond@apple.com>
 
         Updated feature status for several features 
index 5634961..ce6ea32 100644 (file)
@@ -329,8 +329,8 @@ public:
 
     static Widget* widgetForEventTarget(Element* eventTarget);
 
-#if ENABLE(DATA_INTERACTION)
-    WEBCORE_EXPORT bool tryToBeginDataInteractionAtPoint(const IntPoint& clientPosition, const IntPoint& globalPosition);
+#if PLATFORM(IOS_FAMILY) && ENABLE(DRAG_SUPPORT)
+    WEBCORE_EXPORT bool tryToBeginDragAtPoint(const IntPoint& clientPosition, const IntPoint& globalPosition);
 #endif
     
 #if PLATFORM(IOS_FAMILY)
index 099076d..c92aded 100644 (file)
@@ -650,7 +650,7 @@ bool EventHandler::eventLoopHandleMouseDragged(const MouseEventWithHitTestResult
     return false;
 }
 
-bool EventHandler::tryToBeginDataInteractionAtPoint(const IntPoint& clientPosition, const IntPoint&)
+bool EventHandler::tryToBeginDragAtPoint(const IntPoint& clientPosition, const IntPoint&)
 {
     Ref<Frame> protectedFrame(m_frame);
 
@@ -673,7 +673,7 @@ bool EventHandler::tryToBeginDataInteractionAtPoint(const IntPoint& clientPositi
     auto hitTestedMouseEvent = document->prepareMouseEvent(request, documentPoint, syntheticMouseMoveEvent);
 
     RefPtr<Frame> subframe = subframeForHitTestResult(hitTestedMouseEvent);
-    if (subframe && subframe->eventHandler().tryToBeginDataInteractionAtPoint(adjustedClientPosition, adjustedGlobalPosition))
+    if (subframe && subframe->eventHandler().tryToBeginDragAtPoint(adjustedClientPosition, adjustedGlobalPosition))
         return true;
 
     if (!eventMayStartDrag(syntheticMousePressEvent))
index 3545d7e..816a30f 100644 (file)
@@ -690,12 +690,12 @@ static NSURL *linkTemporaryItemProviderFilesToDropStagingDirectory(NSURL *url, N
 {
     static NSString *defaultDropFolderName = @"folder";
     static NSString *defaultDropFileName = @"file";
-    static NSString *dataInteractionDirectoryPrefix = @"data-interaction";
+    static NSString *droppedDataDirectoryPrefix = @"dropped-data";
     if (!url)
         return nil;
 
-    NSString *temporaryDataInteractionDirectory = FileSystem::createTemporaryDirectory(dataInteractionDirectoryPrefix);
-    if (!temporaryDataInteractionDirectory)
+    NSString *temporaryDropDataDirectory = FileSystem::createTemporaryDirectory(droppedDataDirectoryPrefix);
+    if (!temporaryDropDataDirectory)
         return nil;
 
     NSURL *destination = nil;
@@ -708,7 +708,7 @@ static NSURL *linkTemporaryItemProviderFilesToDropStagingDirectory(NSURL *url, N
     if (![suggestedName containsString:@"."] && !isFolder)
         suggestedName = [suggestedName stringByAppendingPathExtension:url.pathExtension];
 
-    destination = [NSURL fileURLWithPath:[temporaryDataInteractionDirectory stringByAppendingPathComponent:suggestedName]];
+    destination = [NSURL fileURLWithPath:[temporaryDropDataDirectory stringByAppendingPathComponent:suggestedName]];
     return [fileManager linkItemAtURL:url toURL:destination error:nil] ? destination : nil;
 }
 
index bc5bb28..3007228 100644 (file)
@@ -1,3 +1,56 @@
+2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
+        https://bugs.webkit.org/show_bug.cgi?id=193829
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+        (WebKit::WebPageProxy::setDragCaretRect):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::didHandleDragStartRequest):
+        (WebKit::PageClientImpl::didConcludeEditDrag):
+        (WebKit::PageClientImpl::didChangeDragCaretRect):
+        (WebKit::PageClientImpl::didHandleStartDataInteractionRequest): Deleted.
+        (WebKit::PageClientImpl::didConcludeEditDataInteraction): Deleted.
+        (WebKit::PageClientImpl::didChangeDataInteractionCaretRect): Deleted.
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView setupInteraction]):
+        (-[WKContentView cleanupInteraction]):
+        (-[WKContentView setupDragAndDropInteractions]):
+        (-[WKContentView teardownDragAndDropInteractions]):
+        (-[WKContentView _didHandleDragStartRequest:]):
+        (-[WKContentView _didConcludeEditDrag:]):
+        (-[WKContentView _didChangeDragCaretRect:currentRect:]):
+        (-[WKContentView _dragInteraction:prepareForSession:completion:]):
+        (-[WKContentView setupDataInteractionDelegates]): Deleted.
+        (-[WKContentView teardownDataInteractionDelegates]): Deleted.
+        (-[WKContentView _didHandleStartDataInteractionRequest:]): Deleted.
+        (-[WKContentView _didConcludeEditDataInteraction:]): Deleted.
+        (-[WKContentView _didChangeDataInteractionCaretRect:currentRect:]): Deleted.
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::didHandleDragStartRequest):
+        (WebKit::WebPageProxy::requestDragStart):
+        (WebKit::WebPageProxy::didConcludeEditDrag):
+        (WebKit::WebPageProxy::didHandleStartDataInteractionRequest): Deleted.
+        (WebKit::WebPageProxy::requestStartDataInteraction): Deleted.
+        (WebKit::WebPageProxy::didConcludeEditDataInteraction): Deleted.
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::WebDragClient::didConcludeEditDrag):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::requestDragStart):
+        (WebKit::WebPage::requestAdditionalItemsForDragSession):
+        (WebKit::WebPage::didConcludeEditDrag):
+        (WebKit::WebPage::requestStartDataInteraction): Deleted.
+        (WebKit::WebPage::didConcludeEditDataInteraction): Deleted.
+
 2019-01-25  Alex Christensen  <achristensen@webkit.org>
 
         WKWebView.goBack should reload if there is a safe browsing warning
index 354f5af..2010f65 100644 (file)
@@ -155,7 +155,7 @@ void WebPageProxy::setDragCaretRect(const IntRect& dragCaretRect)
 
     auto previousRect = m_currentDragCaretRect;
     m_currentDragCaretRect = dragCaretRect;
-    pageClient().didChangeDataInteractionCaretRect(previousRect, dragCaretRect);
+    pageClient().didChangeDragCaretRect(previousRect, dragCaretRect);
 }
 
 #endif // PLATFORM(IOS_FAMILY)
index 2b71abe..43413af 100644 (file)
@@ -458,10 +458,10 @@ public:
 #endif
 
 #if ENABLE(DATA_INTERACTION)
-    virtual void didHandleStartDataInteractionRequest(bool started) = 0;
+    virtual void didHandleDragStartRequest(bool started) = 0;
     virtual void didHandleAdditionalDragItemsRequest(bool added) = 0;
-    virtual void didConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData>) = 0;
-    virtual void didChangeDataInteractionCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) = 0;
+    virtual void didConcludeEditDrag(Optional<WebCore::TextIndicatorData>) = 0;
+    virtual void didChangeDragCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) = 0;
 #endif
 
 #if ENABLE(ATTACHMENT_ELEMENT)
index 283fde6..6c8f85c 100644 (file)
@@ -679,11 +679,11 @@ public:
     void cancelAutoscroll();
     void hardwareKeyboardAvailabilityChanged();
 #if ENABLE(DATA_INTERACTION)
-    void didHandleStartDataInteractionRequest(bool started);
+    void didHandleDragStartRequest(bool started);
     void didHandleAdditionalDragItemsRequest(bool added);
-    void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
+    void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
-    void didConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData>);
+    void didConcludeEditDrag(Optional<WebCore::TextIndicatorData>);
 #endif
 #endif
 #if ENABLE(DATA_DETECTION)
index 90f7c97..9961366 100644 (file)
@@ -327,9 +327,9 @@ messages -> WebPageProxy {
 #endif
 
 #if ENABLE(DATA_INTERACTION)
-    DidHandleStartDataInteractionRequest(bool started)
+    DidHandleDragStartRequest(bool started)
     DidHandleAdditionalDragItemsRequest(bool added)
-    DidConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData> textIndicator)
+    DidConcludeEditDrag(Optional<WebCore::TextIndicatorData> textIndicator)
 #endif
 
 #if PLATFORM(COCOA)
index 68e54db..9ce54b7 100644 (file)
@@ -222,11 +222,11 @@ private:
 
 #if ENABLE(DATA_INTERACTION)
     void didPerformDragOperation(bool handled) override;
-    void didHandleStartDataInteractionRequest(bool started) override;
+    void didHandleDragStartRequest(bool started) override;
     void didHandleAdditionalDragItemsRequest(bool added) override;
     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& image) override;
-    void didConcludeEditDataInteraction(Optional<WebCore::TextIndicatorData>) override;
-    void didChangeDataInteractionCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) override;
+    void didConcludeEditDrag(Optional<WebCore::TextIndicatorData>) override;
+    void didChangeDragCaretRect(const WebCore::IntRect& previousCaretRect, const WebCore::IntRect& caretRect) override;
 #endif
 
     void didFinishProcessingAllPendingMouseEvents() final { }
index f2304ac..e05da73 100644 (file)
@@ -788,9 +788,9 @@ void PageClientImpl::didPerformDragOperation(bool handled)
     [m_contentView _didPerformDragOperation:handled];
 }
 
-void PageClientImpl::didHandleStartDataInteractionRequest(bool started)
+void PageClientImpl::didHandleDragStartRequest(bool started)
 {
-    [m_contentView _didHandleStartDataInteractionRequest:started];
+    [m_contentView _didHandleDragStartRequest:started];
 }
 
 void PageClientImpl::didHandleAdditionalDragItemsRequest(bool added)
@@ -803,14 +803,14 @@ void PageClientImpl::startDrag(const DragItem& item, const ShareableBitmap::Hand
     [m_contentView _startDrag:ShareableBitmap::create(image)->makeCGImageCopy() item:item];
 }
 
-void PageClientImpl::didConcludeEditDataInteraction(Optional<TextIndicatorData> data)
+void PageClientImpl::didConcludeEditDrag(Optional<TextIndicatorData> data)
 {
-    [m_contentView _didConcludeEditDataInteraction:data];
+    [m_contentView _didConcludeEditDrag:data];
 }
 
-void PageClientImpl::didChangeDataInteractionCaretRect(const IntRect& previousCaretRect, const IntRect& caretRect)
+void PageClientImpl::didChangeDragCaretRect(const IntRect& previousCaretRect, const IntRect& caretRect)
 {
-    [m_contentView _didChangeDataInteractionCaretRect:previousCaretRect currentRect:caretRect];
+    [m_contentView _didChangeDragCaretRect:previousCaretRect currentRect:caretRect];
 }
 #endif
 
index d508a3e..5ea7776 100644 (file)
@@ -429,11 +429,11 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW)
 #if ENABLE(DATA_INTERACTION)
 - (void)_didChangeDragInteractionPolicy;
 - (void)_didPerformDragOperation:(BOOL)handled;
-- (void)_didHandleStartDataInteractionRequest:(BOOL)started;
+- (void)_didHandleDragStartRequest:(BOOL)started;
 - (void)_didHandleAdditionalDragItemsRequest:(BOOL)added;
 - (void)_startDrag:(RetainPtr<CGImageRef>)image item:(const WebCore::DragItem&)item;
-- (void)_didConcludeEditDataInteraction:(Optional<WebCore::TextIndicatorData>)data;
-- (void)_didChangeDataInteractionCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
+- (void)_didConcludeEditDrag:(Optional<WebCore::TextIndicatorData>)data;
+- (void)_didChangeDragCaretRect:(CGRect)previousRect currentRect:(CGRect)rect;
 #endif
 
 - (void)reloadContextViewForPresentedListViewController;
index b28f177..541a6c3 100644 (file)
@@ -692,7 +692,7 @@ static inline bool hasFocusedElement(WebKit::FocusedElementInformation focusedEl
     [self _createAndConfigureLongPressGestureRecognizer];
 
 #if ENABLE(DATA_INTERACTION)
-    [self setupDataInteractionDelegates];
+    [self setupDragAndDropInteractions];
 #endif
 
     _twoFingerSingleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_twoFingerSingleTapGestureRecognized:)]);
@@ -808,7 +808,7 @@ static inline bool hasFocusedElement(WebKit::FocusedElementInformation focusedEl
 
 #if ENABLE(DATA_INTERACTION)
     [existingLocalDragSessionContext(_dragDropInteractionState.dragSession()) cleanUpTemporaryDirectories];
-    [self teardownDataInteractionDelegates];
+    [self teardownDragAndDropInteractions];
 #endif
 
     _inspectorNodeSearchEnabled = NO;
@@ -5431,7 +5431,7 @@ static BOOL shouldEnableDragInteractionForPolicy(_WKDragInteractionPolicy policy
     return (id <WKUIDelegatePrivate>)[_webView UIDelegate];
 }
 
-- (void)setupDataInteractionDelegates
+- (void)setupDragAndDropInteractions
 {
     _dragInteraction = adoptNS([[UIDragInteraction alloc] initWithDelegate:self]);
     _dropInteraction = adoptNS([[UIDropInteraction alloc] initWithDelegate:self]);
@@ -5442,7 +5442,7 @@ static BOOL shouldEnableDragInteractionForPolicy(_WKDragInteractionPolicy policy
     [self addInteraction:_dropInteraction.get()];
 }
 
-- (void)teardownDataInteractionDelegates
+- (void)teardownDragAndDropInteractions
 {
     if (_dragInteraction)
         [self removeInteraction:_dragInteraction.get()];
@@ -5492,7 +5492,7 @@ static BOOL shouldEnableDragInteractionForPolicy(_WKDragInteractionPolicy policy
         _page->didStartDrag();
 }
 
-- (void)_didHandleStartDataInteractionRequest:(BOOL)started
+- (void)_didHandleDragStartRequest:(BOOL)started
 {
     BlockPtr<void()> savedCompletionBlock = _dragDropInteractionState.takeDragStartCompletionBlock();
     ASSERT(savedCompletionBlock);
@@ -5586,7 +5586,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
     return extractItemProvidersFromDragItems(session.items);
 }
 
-- (void)_didConcludeEditDataInteraction:(Optional<WebCore::TextIndicatorData>)data
+- (void)_didConcludeEditDrag:(Optional<WebCore::TextIndicatorData>)data
 {
     if (!data)
         return;
@@ -5599,12 +5599,12 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
     if (!unselectedSnapshotImage)
         return;
 
-    auto dataInteractionUnselectedContentImage = adoptNS([[UIImage alloc] initWithCGImage:unselectedSnapshotImage.get() scale:_page->deviceScaleFactor() orientation:UIImageOrientationUp]);
-    RetainPtr<UIImageView> unselectedContentSnapshot = adoptNS([[UIImageView alloc] initWithImage:dataInteractionUnselectedContentImage.get()]);
+    auto unselectedContentImageForEditDrag = adoptNS([[UIImage alloc] initWithCGImage:unselectedSnapshotImage.get() scale:_page->deviceScaleFactor() orientation:UIImageOrientationUp]);
+    auto unselectedContentSnapshot = adoptNS([[UIImageView alloc] initWithImage:unselectedContentImageForEditDrag.get()]);
     [unselectedContentSnapshot setFrame:data->contentImageWithoutSelectionRectInRootViewCoordinates];
 
-    RetainPtr<WKContentView> protectedSelf = self;
-    RetainPtr<UIView> visibleContentViewSnapshot = adoptNS(_visibleContentViewSnapshot.leakRef());
+    auto protectedSelf = retainPtr(self);
+    auto visibleContentViewSnapshot = adoptNS(_visibleContentViewSnapshot.leakRef());
 
     _isAnimatingConcludeEditDrag = YES;
     [self insertSubview:unselectedContentSnapshot.get() belowSubview:visibleContentViewSnapshot.get()];
@@ -5639,7 +5639,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
     _page->dragEnded(WebCore::roundedIntPoint(client), WebCore::roundedIntPoint(global), _page->currentDragOperation());
 }
 
-- (void)_didChangeDataInteractionCaretRect:(CGRect)previousRect currentRect:(CGRect)rect
+- (void)_didChangeDragCaretRect:(CGRect)previousRect currentRect:(CGRect)rect
 {
     BOOL previousRectIsEmpty = CGRectIsEmpty(previousRect);
     BOOL currentRectIsEmpty = CGRectIsEmpty(rect);
@@ -5853,7 +5853,7 @@ static NSArray<NSItemProvider *> *extractItemProvidersFromDropSession(id <UIDrop
     _dragDropInteractionState.prepareForDragSession(session, completion);
 
     auto dragOrigin = WebCore::roundedIntPoint([session locationInView:self]);
-    _page->requestStartDataInteraction(dragOrigin, WebCore::roundedIntPoint([self convertPoint:dragOrigin toView:self.window]));
+    _page->requestDragStart(dragOrigin, WebCore::roundedIntPoint([self convertPoint:dragOrigin toView:self.window]));
 
     RELEASE_LOG(DragAndDrop, "Drag session requested: %p at origin: {%d, %d}", session, dragOrigin.x(), dragOrigin.y());
 }
index 8a5302d..4726894 100644 (file)
@@ -1117,9 +1117,9 @@ void WebPageProxy::hardwareKeyboardAvailabilityChanged()
 
 #if ENABLE(DATA_INTERACTION)
 
-void WebPageProxy::didHandleStartDataInteractionRequest(bool started)
+void WebPageProxy::didHandleDragStartRequest(bool started)
 {
-    pageClient().didHandleStartDataInteractionRequest(started);
+    pageClient().didHandleDragStartRequest(started);
 }
 
 void WebPageProxy::didHandleAdditionalDragItemsRequest(bool added)
@@ -1127,10 +1127,10 @@ void WebPageProxy::didHandleAdditionalDragItemsRequest(bool added)
     pageClient().didHandleAdditionalDragItemsRequest(added);
 }
 
-void WebPageProxy::requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition)
+void WebPageProxy::requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition)
 {
     if (isValid())
-        m_process->send(Messages::WebPage::RequestStartDataInteraction(clientPosition, globalPosition), m_pageID);
+        m_process->send(Messages::WebPage::RequestDragStart(clientPosition, globalPosition), m_pageID);
 }
 
 void WebPageProxy::requestAdditionalItemsForDragSession(const IntPoint& clientPosition, const IntPoint& globalPosition)
@@ -1139,9 +1139,9 @@ void WebPageProxy::requestAdditionalItemsForDragSession(const IntPoint& clientPo
         m_process->send(Messages::WebPage::RequestAdditionalItemsForDragSession(clientPosition, globalPosition), m_pageID);
 }
 
-void WebPageProxy::didConcludeEditDataInteraction(Optional<TextIndicatorData> data)
+void WebPageProxy::didConcludeEditDrag(Optional<TextIndicatorData> data)
 {
-    pageClient().didConcludeEditDataInteraction(data);
+    pageClient().didConcludeEditDrag(data);
 }
 
 #endif
index f87d934..6b7d64a 100644 (file)
@@ -210,7 +210,7 @@ void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Eleme
 
 void WebDragClient::didConcludeEditDrag()
 {
-    m_page->didConcludeEditDataInteraction();
+    m_page->didConcludeEditDrag();
 }
 
 #endif // PLATFORM(IOS_FAMILY)
index a7ff384..e764f99 100644 (file)
@@ -1095,7 +1095,7 @@ public:
     void setUseIconLoadingClient(bool);
 
 #if ENABLE(DATA_INTERACTION)
-    void didConcludeEditDataInteraction();
+    void didConcludeEditDrag();
 #endif
 
     WebURLSchemeHandlerProxy* urlSchemeHandlerForScheme(const String&);
@@ -1181,7 +1181,7 @@ private:
 #endif
 
 #if PLATFORM(IOS_FAMILY) && ENABLE(DATA_INTERACTION)
-    void requestStartDataInteraction(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
+    void requestDragStart(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
     void requestAdditionalItemsForDragSession(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition);
 #endif
 
index 5cfe804..4dbe0a3 100644 (file)
@@ -289,7 +289,7 @@ messages -> WebPage LegacyReceiver {
 #endif
 
 #if ENABLE(DATA_INTERACTION)
-    RequestStartDataInteraction(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition)
+    RequestDragStart(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition)
     RequestAdditionalItemsForDragSession(WebCore::IntPoint clientPosition, WebCore::IntPoint globalPosition)
 #endif
 
index 87d1be1..fac629b 100644 (file)
@@ -656,10 +656,10 @@ void WebPage::requestFocusedElementInformation(WebKit::CallbackID callbackID)
 }
 
 #if ENABLE(DATA_INTERACTION)
-void WebPage::requestStartDataInteraction(const IntPoint& clientPosition, const IntPoint& globalPosition)
+void WebPage::requestDragStart(const IntPoint& clientPosition, const IntPoint& globalPosition)
 {
-    bool didStart = m_page->mainFrame().eventHandler().tryToBeginDataInteractionAtPoint(clientPosition, globalPosition);
-    send(Messages::WebPageProxy::DidHandleStartDataInteractionRequest(didStart));
+    bool didStart = m_page->mainFrame().eventHandler().tryToBeginDragAtPoint(clientPosition, globalPosition);
+    send(Messages::WebPageProxy::DidHandleDragStartRequest(didStart));
 }
 
 void WebPage::requestAdditionalItemsForDragSession(const IntPoint& clientPosition, const IntPoint& globalPosition)
@@ -671,22 +671,22 @@ void WebPage::requestAdditionalItemsForDragSession(const IntPoint& clientPositio
     m_page->dragController().dragEnded();
     m_page->mainFrame().eventHandler().dragSourceEndedAt(event, DragOperationNone, MayExtendDragSession::Yes);
 
-    bool didHandleDrag = m_page->mainFrame().eventHandler().tryToBeginDataInteractionAtPoint(clientPosition, globalPosition);
+    bool didHandleDrag = m_page->mainFrame().eventHandler().tryToBeginDragAtPoint(clientPosition, globalPosition);
     send(Messages::WebPageProxy::DidHandleAdditionalDragItemsRequest(didHandleDrag));
 }
 
-void WebPage::didConcludeEditDataInteraction()
+void WebPage::didConcludeEditDrag()
 {
     Optional<TextIndicatorData> textIndicatorData;
 
-    static auto defaultEditDataInteractionTextIndicatorOptions = TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection | TextIndicatorOptionExpandClipBeyondVisibleRect | TextIndicatorOptionPaintAllContent | TextIndicatorOptionIncludeMarginIfRangeMatchesSelection | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionComputeEstimatedBackgroundColor| TextIndicatorOptionUseSelectionRectForSizing | TextIndicatorOptionIncludeSnapshotWithSelectionHighlight;
+    static auto defaultTextIndicatorOptionsForEditDrag = TextIndicatorOptionIncludeSnapshotOfAllVisibleContentWithoutSelection | TextIndicatorOptionExpandClipBeyondVisibleRect | TextIndicatorOptionPaintAllContent | TextIndicatorOptionIncludeMarginIfRangeMatchesSelection | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionComputeEstimatedBackgroundColor| TextIndicatorOptionUseSelectionRectForSizing | TextIndicatorOptionIncludeSnapshotWithSelectionHighlight;
     auto& frame = m_page->focusController().focusedOrMainFrame();
     if (auto range = frame.selection().selection().toNormalizedRange()) {
-        if (auto textIndicator = TextIndicator::createWithRange(*range, defaultEditDataInteractionTextIndicatorOptions, TextIndicatorPresentationTransition::None, FloatSize()))
+        if (auto textIndicator = TextIndicator::createWithRange(*range, defaultTextIndicatorOptionsForEditDrag, TextIndicatorPresentationTransition::None, FloatSize()))
             textIndicatorData = textIndicator->data();
     }
 
-    send(Messages::WebPageProxy::DidConcludeEditDataInteraction(textIndicatorData));
+    send(Messages::WebPageProxy::DidConcludeEditDrag(WTFMove(textIndicatorData)));
 }
 #endif
 
index 247391e..30a2b2a 100644 (file)
@@ -1,3 +1,18 @@
+2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
+        https://bugs.webkit.org/show_bug.cgi?id=193829
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebDragClient.mm:
+        (WebDragClient::didConcludeEditDrag):
+        * WebView/WebView.mm:
+        (-[WebView _requestStartDataInteraction:globalPosition:]):
+        (-[WebView _didConcludeEditDrag]):
+        (-[WebView _didConcludeEditDataInteraction]): Deleted.
+        * WebView/WebViewInternal.h:
+
 2019-01-24  John Wilander  <wilander@apple.com>
 
         Add Ad Click Attribution as an internal/experimental feature
index dc9a411..640ce83 100644 (file)
@@ -244,7 +244,7 @@ void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Eleme
 
 void WebDragClient::didConcludeEditDrag()
 {
-    [m_webView _didConcludeEditDataInteraction];
+    [m_webView _didConcludeEditDrag];
 }
 
 #endif // PLATFORM(IOS_FAMILY)
index 7c5092e..1f60224 100644 (file)
@@ -1827,7 +1827,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
 - (BOOL)_requestStartDataInteraction:(CGPoint)clientPosition globalPosition:(CGPoint)globalPosition
 {
     WebThreadLock();
-    return _private->page->mainFrame().eventHandler().tryToBeginDataInteractionAtPoint(IntPoint(clientPosition), IntPoint(globalPosition));
+    return _private->page->mainFrame().eventHandler().tryToBeginDragAtPoint(IntPoint(clientPosition), IntPoint(globalPosition));
 }
 
 - (void)_startDrag:(const DragItem&)dragItem
@@ -1939,7 +1939,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     _private->draggedLinkURL = nil;
 }
 
-- (void)_didConcludeEditDataInteraction
+- (void)_didConcludeEditDrag
 {
     _private->dataOperationTextIndicator = nullptr;
     auto* page = _private->page;
index 579c8d8..84f6f89 100644 (file)
@@ -264,7 +264,7 @@ OBJC_CLASS NSTextAlternatives;
 
 #if ENABLE(DATA_INTERACTION) && defined(__cplusplus)
 - (void)_startDrag:(const WebCore::DragItem&)dragItem;
-- (void)_didConcludeEditDataInteraction;
+- (void)_didConcludeEditDrag;
 #endif
 
 - (void)_preferencesChanged:(WebPreferences *)preferences;