Title: [211384] branches/safari-604.1.5-branch/Source/WebKit/mac
Revision
211384
Author
matthew_han...@apple.com
Date
2017-01-30 13:02:16 -0800 (Mon, 30 Jan 2017)

Log Message

Merge r211323. rdar://problem/30107776

Modified Paths

Diff

Modified: branches/safari-604.1.5-branch/Source/WebKit/mac/ChangeLog (211383 => 211384)


--- branches/safari-604.1.5-branch/Source/WebKit/mac/ChangeLog	2017-01-30 21:02:13 UTC (rev 211383)
+++ branches/safari-604.1.5-branch/Source/WebKit/mac/ChangeLog	2017-01-30 21:02:16 UTC (rev 211384)
@@ -1,3 +1,30 @@
+2017-01-30  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r211323. rdar://problem/30107776
+
+    2017-01-27  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            [WK1] Do not prevent the drag client from initializing on Mac
+            https://bugs.webkit.org/show_bug.cgi?id=167541
+
+            Reviewed by Dan Bernstein.
+
+            Fixes fallout from r211192. To ensure compability with WebKit clients, we need to ensure that WebDragClient is
+            initialized everywhere when creating a WebView. Stub out method implementations as no-ops for non-Mac platforms.
+            This caused certain clients, such as Mail, to crash when a webView closes due to  null dereference.
+
+            * WebCoreSupport/WebDragClient.mm:
+            (WebDragClient::WebDragClient):
+            (WebDragClient::actionMaskForDrag):
+            (WebDragClient::willPerformDragDestinationAction):
+            (WebDragClient::dragSourceActionMaskForPoint):
+            (WebDragClient::willPerformDragSourceAction):
+            (WebDragClient::startDrag):
+            (WebDragClient::declareAndWriteDragImage):
+            (WebDragClient::declareAndWriteAttachment):
+            * WebView/WebView.mm:
+            (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+
 2017-01-26  Chris Dumez  <cdu...@apple.com>
 
         Crash when navigating back to a page in PacheCache when one of its frames has been removed

Modified: branches/safari-604.1.5-branch/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm (211383 => 211384)


--- branches/safari-604.1.5-branch/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm	2017-01-30 21:02:13 UTC (rev 211383)
+++ branches/safari-604.1.5-branch/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm	2017-01-30 21:02:16 UTC (rev 211384)
@@ -25,7 +25,7 @@
 
 #import "WebDragClient.h"
 
-#if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
+#if ENABLE(DRAG_SUPPORT)
 
 #import "DOMElementInternal.h"
 #import "WebArchive.h"
@@ -36,11 +36,15 @@
 #import "WebHTMLViewPrivate.h"
 #import "WebKitLogging.h"
 #import "WebKitNSStringExtras.h"
-#import "WebNSPasteboardExtras.h"
 #import "WebNSURLExtras.h"
 #import "WebUIDelegate.h"
 #import "WebUIDelegatePrivate.h"
 #import "WebViewInternal.h"
+
+#if PLATFORM(MAC)
+#import "WebNSPasteboardExtras.h"
+#endif
+
 #import <WebCore/DataTransfer.h>
 #import <WebCore/DragData.h>
 #import <WebCore/Editor.h>
@@ -57,8 +61,11 @@
 WebDragClient::WebDragClient(WebView* webView)
     : m_webView(webView) 
 {
+    UNUSED_PARAM(m_webView);
 }
 
+#if PLATFORM(MAC)
+
 static WebHTMLView *getTopHTMLView(Frame* frame)
 {
     ASSERT(frame);
@@ -138,9 +145,45 @@
 }
 #endif
 
+#else
+
+WebCore::DragDestinationAction WebDragClient::actionMaskForDrag(const WebCore::DragData&)
+{
+    return DragDestinationActionNone;
+}
+
+void WebDragClient::willPerformDragDestinationAction(WebCore::DragDestinationAction, const WebCore::DragData&)
+{
+}
+
+WebCore::DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint&)
+{
+    return DragSourceActionNone;
+}
+
+void WebDragClient::willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::DataTransfer&)
+{
+}
+
+void WebDragClient::startDrag(DragImageRef, const IntPoint&, const IntPoint&, DataTransfer&, Frame&, bool)
+{
+}
+
+void WebDragClient::declareAndWriteDragImage(const String&, Element&, const URL&, const String&, WebCore::Frame*)
+{
+}
+
+#if ENABLE(ATTACHMENT_ELEMENT)
+void WebDragClient::declareAndWriteAttachment(const String&, Element&, const URL&, const String&, WebCore::Frame*)
+{
+}
+#endif
+
+#endif
+
 void WebDragClient::dragControllerDestroyed() 
 {
     delete this;
 }
 
-#endif // ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
+#endif // ENABLE(DRAG_SUPPORT)

Modified: branches/safari-604.1.5-branch/Source/WebKit/mac/WebView/WebView.mm (211383 => 211384)


--- branches/safari-604.1.5-branch/Source/WebKit/mac/WebView/WebView.mm	2017-01-30 21:02:13 UTC (rev 211383)
+++ branches/safari-604.1.5-branch/Source/WebKit/mac/WebView/WebView.mm	2017-01-30 21:02:16 UTC (rev 211384)
@@ -1609,7 +1609,7 @@
         makeUniqueRef<WebCore::LibWebRTCProvider>()
     );
     pageConfiguration.chromeClient = new WebChromeClientIOS(self);
-#if ENABLE(DRAG_SUPPORT) && PLATFORM(MAC)
+#if ENABLE(DRAG_SUPPORT)
     pageConfiguration.dragClient = new WebDragClient(self);
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to