Title: [213903] trunk/Source/WebKit2
Revision
213903
Author
[email protected]
Date
2017-03-14 10:01:58 -0700 (Tue, 14 Mar 2017)

Log Message

[WK2] Adopt updated data operation interfaces for data interaction
https://bugs.webkit.org/show_bug.cgi?id=169414
<rdar://problem/30948186>

Reviewed by Tim Horton.

Plumb additional information about the data interaction caret over to the UI process after handling a data
interaction action in the web process.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
(WebKit::WebPageProxy::resetCurrentDragInformation):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::currentDragCaretRect):
(WebKit::WebPageProxy::resetCurrentDragInformation): Deleted.
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (213902 => 213903)


--- trunk/Source/WebKit2/ChangeLog	2017-03-14 17:01:40 UTC (rev 213902)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-14 17:01:58 UTC (rev 213903)
@@ -1,5 +1,27 @@
 2017-03-14  Wenson Hsieh  <[email protected]>
 
+        [WK2] Adopt updated data operation interfaces for data interaction
+        https://bugs.webkit.org/show_bug.cgi?id=169414
+        <rdar://problem/30948186>
+
+        Reviewed by Tim Horton.
+
+        Plumb additional information about the data interaction caret over to the UI process after handling a data
+        interaction action in the web process.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didPerformDragControllerAction):
+        (WebKit::WebPageProxy::resetCurrentDragInformation):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::currentDragCaretRect):
+        (WebKit::WebPageProxy::resetCurrentDragInformation): Deleted.
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::performDragControllerAction):
+
+2017-03-14  Wenson Hsieh  <[email protected]>
+
         [WK2] Data interaction tests occasionally hit assertions in debug builds
         https://bugs.webkit.org/show_bug.cgi?id=169002
         <rdar://problem/30994806>

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (213902 => 213903)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-03-14 17:01:40 UTC (rev 213902)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2017-03-14 17:01:58 UTC (rev 213903)
@@ -1815,7 +1815,7 @@
 #endif
 }
 
-void WebPageProxy::didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted)
+void WebPageProxy::didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const IntRect& insertionRect)
 {
     MESSAGE_CHECK(dragOperation <= DragOperationDelete);
 
@@ -1822,6 +1822,7 @@
     m_currentDragOperation = static_cast<DragOperation>(dragOperation);
     m_currentDragIsOverFileInput = mouseIsOverFileInput;
     m_currentDragNumberOfFilesToBeAccepted = numberOfItemsToBeAccepted;
+    m_currentDragCaretRect = insertionRect;
 }
 
 #if PLATFORM(GTK)
@@ -1846,6 +1847,14 @@
     if (isValid())
         m_process->send(Messages::WebPage::DragCancelled(), m_pageID);
 }
+
+void WebPageProxy::resetCurrentDragInformation()
+{
+    m_currentDragOperation = WebCore::DragOperationNone;
+    m_currentDragIsOverFileInput = false;
+    m_currentDragNumberOfFilesToBeAccepted = 0;
+    m_currentDragCaretRect = { };
+}
 #endif // ENABLE(DRAG_SUPPORT)
 
 void WebPageProxy::handleMouseEvent(const NativeWebMouseEvent& event)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (213902 => 213903)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-03-14 17:01:40 UTC (rev 213902)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2017-03-14 17:01:58 UTC (rev 213903)
@@ -833,7 +833,7 @@
     void dragExited(WebCore::DragData&, const String& dragStorageName = String());
     void performDragOperation(WebCore::DragData&, const String& dragStorageName, const SandboxExtension::Handle&, const SandboxExtension::HandleArray&);
 
-    void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted);
+    void didPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, const WebCore::IntRect& insertionRect);
     void dragEnded(const WebCore::IntPoint& clientPosition, const WebCore::IntPoint& globalPosition, uint64_t operation);
     void dragCancelled();
 #if PLATFORM(COCOA)
@@ -889,12 +889,8 @@
     WebCore::DragOperation currentDragOperation() const { return m_currentDragOperation; }
     bool currentDragIsOverFileInput() const { return m_currentDragIsOverFileInput; }
     unsigned currentDragNumberOfFilesToBeAccepted() const { return m_currentDragNumberOfFilesToBeAccepted; }
-    void resetCurrentDragInformation()
-    {
-        m_currentDragOperation = WebCore::DragOperationNone;
-        m_currentDragIsOverFileInput = false;
-        m_currentDragNumberOfFilesToBeAccepted = 0;
-    }
+    WebCore::IntRect currentDragCaretRect() const { return m_currentDragCaretRect; }
+    void resetCurrentDragInformation();
 #endif
 
     void preferencesDidChange();
@@ -1873,6 +1869,7 @@
     WebCore::DragOperation m_currentDragOperation;
     bool m_currentDragIsOverFileInput;
     unsigned m_currentDragNumberOfFilesToBeAccepted;
+    WebCore::IntRect m_currentDragCaretRect;
 #endif
 
     PageLoadState m_pageLoadState;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (213902 => 213903)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2017-03-14 17:01:40 UTC (rev 213902)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2017-03-14 17:01:58 UTC (rev 213903)
@@ -295,7 +295,7 @@
 
     # Drag and drop messages
 #if ENABLE(DRAG_SUPPORT)
-    DidPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted)
+    DidPerformDragControllerAction(uint64_t dragOperation, bool mouseIsOverFileInput, unsigned numberOfItemsToBeAccepted, WebCore::IntRect insertionRect)
 #endif
 #if PLATFORM(COCOA) && ENABLE(DRAG_SUPPORT)
     SetDragImage(WebCore::IntPoint clientPosition, WebKit::ShareableBitmap::Handle dragImage, std::optional<WebCore::TextIndicatorData> textIndicator, WebCore::FloatPoint dragImageAnchor, uint64_t action)

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (213902 => 213903)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2017-03-14 17:01:40 UTC (rev 213902)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2017-03-14 17:01:58 UTC (rev 213903)
@@ -195,6 +195,7 @@
     BOOL _isPerformingDataInteractionOperation;
 #if HAS_DATA_INTERACTION_SPI
     RetainPtr<WKDataInteraction> _dataInteraction;
+    RetainPtr<WKDataOperation> _dataOperation;
 #endif
     CGPoint _deferredActionSheetRequestLocation;
     RetainPtr<UIView> _visibleContentViewSnapshot;
@@ -207,11 +208,8 @@
 
 @interface WKContentView (WKInteraction) <UIGestureRecognizerDelegate, UIWebTouchEventsGestureRecognizerDelegate, UITextInputPrivate, UIWebFormAccessoryDelegate, UIWKInteractionViewProtocol, WKFileUploadPanelDelegate, WKActionSheetAssistantDelegate
 #if ENABLE(DATA_INTERACTION)
-    , WKDataInteractionItemVisualTarget, WKViewDataInteractionDestinationDelegate
-#if HAS_DATA_INTERACTION_SPI
-    , WKDataInteractionDelegate
+    , WKDataInteractionDelegate, WKDataOperationDelegate
 #endif
-#endif
 >
 
 @property (nonatomic, readonly) CGPoint lastInteractionLocation;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (213902 => 213903)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-03-14 17:01:40 UTC (rev 213902)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2017-03-14 17:01:58 UTC (rev 213903)
@@ -3463,7 +3463,7 @@
 void WebPage::performDragControllerAction(uint64_t action, const IntPoint& clientPosition, const IntPoint& globalPosition, uint64_t draggingSourceOperationMask, WebSelectionData&& selection, uint32_t flags)
 {
     if (!m_page) {
-        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0));
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0, { }));
         return;
     }
 
@@ -3471,12 +3471,12 @@
     switch (action) {
     case DragControllerActionEntered: {
         DragOperation resolvedDragOperation = m_page->dragController().dragEntered(dragData);
-        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted()));
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted(), { }));
         break;
     }
     case DragControllerActionUpdated: {
         DragOperation resolvedDragOperation = m_page->dragController().dragEntered(dragData);
-        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted()));
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted(), { }));
         break;
     }
     case DragControllerActionExited:
@@ -3496,7 +3496,7 @@
 void WebPage::performDragControllerAction(uint64_t action, const WebCore::DragData& dragData, const SandboxExtension::Handle& sandboxExtensionHandle, const SandboxExtension::HandleArray& sandboxExtensionsHandleArray)
 {
     if (!m_page) {
-        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0));
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0, { }));
         return;
     }
 
@@ -3503,17 +3503,18 @@
     switch (action) {
     case DragControllerActionEntered: {
         DragOperation resolvedDragOperation = m_page->dragController().dragEntered(dragData);
-        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted()));
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted(), m_page->dragCaretController().caretPosition().absoluteCaretBounds()));
         break;
 
     }
     case DragControllerActionUpdated: {
         DragOperation resolvedDragOperation = m_page->dragController().dragUpdated(dragData);
-        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted()));
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(resolvedDragOperation, m_page->dragController().mouseIsOverFileInput(), m_page->dragController().numberOfItemsToBeAccepted(), m_page->dragCaretController().caretPosition().absoluteCaretBounds()));
         break;
     }
     case DragControllerActionExited:
         m_page->dragController().dragExited(dragData);
+        send(Messages::WebPageProxy::DidPerformDragControllerAction(DragOperationNone, false, 0, { }));
         break;
         
     case DragControllerActionPerformDragOperation: {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to