Title: [213662] trunk/Source
Revision
213662
Author
[email protected]
Date
2017-03-09 13:24:36 -0800 (Thu, 09 Mar 2017)

Log Message

[WK2] Add a UI delegate hook for custom handling of data interaction operations
https://bugs.webkit.org/show_bug.cgi?id=169430
<rdar://problem/30954654>

Reviewed by Tim Horton.

Source/WebCore:

Ensure that m_documentUnderMouse is properly cleaned up even in the case where no drag operation was performed
due to the drop bailing at the client layer.

* page/DragController.cpp:
(WebCore::DragController::dragEnded):

Source/WebKit2:

Introduce a new SPI method on the UI delegate for clients who need to override data interaction operation behaviors.
Note that implementing this delegate method and returning YES will not propagate a `drop` event to the page.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (213661 => 213662)


--- trunk/Source/WebCore/ChangeLog	2017-03-09 21:23:34 UTC (rev 213661)
+++ trunk/Source/WebCore/ChangeLog	2017-03-09 21:24:36 UTC (rev 213662)
@@ -1,3 +1,17 @@
+2017-03-09  Wenson Hsieh  <[email protected]>
+
+        [WK2] Add a UI delegate hook for custom handling of data interaction operations
+        https://bugs.webkit.org/show_bug.cgi?id=169430
+        <rdar://problem/30954654>
+
+        Reviewed by Tim Horton.
+
+        Ensure that m_documentUnderMouse is properly cleaned up even in the case where no drag operation was performed
+        due to the drop bailing at the client layer.
+
+        * page/DragController.cpp:
+        (WebCore::DragController::dragEnded):
+
 2017-03-08  Matt Rajca  <[email protected]>
 
         Let clients control autoplay quirks with website policies.

Modified: trunk/Source/WebCore/page/DragController.cpp (213661 => 213662)


--- trunk/Source/WebCore/page/DragController.cpp	2017-03-09 21:23:34 UTC (rev 213661)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-03-09 21:24:36 UTC (rev 213662)
@@ -184,6 +184,7 @@
 {
     m_dragInitiator = nullptr;
     m_didInitiateDrag = false;
+    m_documentUnderMouse = nullptr;
     clearDragCaret();
     
     m_client.dragEnded();

Modified: trunk/Source/WebKit2/ChangeLog (213661 => 213662)


--- trunk/Source/WebKit2/ChangeLog	2017-03-09 21:23:34 UTC (rev 213661)
+++ trunk/Source/WebKit2/ChangeLog	2017-03-09 21:24:36 UTC (rev 213662)
@@ -1,3 +1,16 @@
+2017-03-09  Wenson Hsieh  <[email protected]>
+
+        [WK2] Add a UI delegate hook for custom handling of data interaction operations
+        https://bugs.webkit.org/show_bug.cgi?id=169430
+        <rdar://problem/30954654>
+
+        Reviewed by Tim Horton.
+
+        Introduce a new SPI method on the UI delegate for clients who need to override data interaction operation behaviors.
+        Note that implementing this delegate method and returning YES will not propagate a `drop` event to the page.
+
+        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
+
 2017-03-08  Matt Rajca  <[email protected]>
 
         Let clients control autoplay quirks with website policies.

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h (213661 => 213662)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h	2017-03-09 21:23:34 UTC (rev 213661)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h	2017-03-09 21:24:36 UTC (rev 213662)
@@ -88,6 +88,7 @@
 - (void)_webView:(WKWebView *)webView getAlternateURLFromImage:(UIImage *)image completionHandler:(void (^)(NSURL *alternateURL, NSDictionary *userInfo))completionHandler WK_API_AVAILABLE(ios(WK_IOS_TBA));
 - (NSURL *)_webView:(WKWebView *)webView alternateURLFromImage:(UIImage *)image userInfo:(NSDictionary **)userInfo WK_API_AVAILABLE(ios(WK_IOS_TBA));
 - (NSArray<UIItemProvider *> *)_webView:(WKWebView *)webView adjustedDataInteractionItemProviders:(NSArray<UIItemProvider *> *)originalItemProviders WK_API_AVAILABLE(ios(WK_IOS_TBA));
+- (BOOL)_webView:(WKWebView *)webView performDataInteractionOperationWithItemProviders:(NSArray<UIItemProvider *> *)itemProviders WK_API_AVAILABLE(ios(WK_IOS_TBA));
 #else
 - (NSMenu *)_webView:(WKWebView *)webView contextMenu:(NSMenu *)menu forElement:(_WKContextMenuElementInfo *)element WK_API_AVAILABLE(macosx(10.12));
 - (NSMenu *)_webView:(WKWebView *)webView contextMenu:(NSMenu *)menu forElement:(_WKContextMenuElementInfo *)element userInfo:(id <NSSecureCoding>)userInfo WK_API_AVAILABLE(macosx(10.12));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to