Title: [226312] trunk/Source
Revision
226312
Author
wenson_hs...@apple.com
Date
2017-12-30 11:30:40 -0800 (Sat, 30 Dec 2017)

Log Message

[Attachment Support] Remove current macOS support for dragging file-backed attachments
https://bugs.webkit.org/show_bug.cgi?id=181188

Reviewed by Dan Bernstein.

Source/WebCore:

Support for dragging attachments out as files on the NSPasteboard was introduced in r181760. However, this is
(1) a macOS-specific implementation, and (2) does not support attachments whose files are backed by inline data
rather than a filepath. As part of adding further WebKit attachment element support, subsequent patches will
reimplement support for dragging attachment elements in a cross-Cocoa-platform way that also allows for either
data- or file-backed blobs to be written to the pasteboard.

No new functionality; no new tests. All existing layout and API tests still pass.

* page/DragClient.h:
(WebCore::DragClient::declareAndWriteDragImage):
(WebCore::DragClient::declareAndWriteAttachment): Deleted.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/DragController.h:
(WebCore::DragController::draggingImageURL const):
(WebCore::DragController::draggingAttachmentURL const): Deleted.
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::declareAndWriteAttachment): Deleted.
* page/mac/DragControllerMac.mm:
(WebCore::DragController::declareAndWriteAttachment): Deleted.
* page/win/DragControllerWin.cpp:
(WebCore::DragController::declareAndWriteAttachment): Deleted.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::absoluteAttachmentURL const): Deleted.
* rendering/HitTestResult.h:

Source/WebKit:

See WebCore/ChangeLog for more detail.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::setPromisedDataForAttachment): Deleted.
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::setPromisedDataForAttachment): Deleted.
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted.
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::declareAndWriteAttachment): Deleted.

Source/WebKitLegacy/mac:

See WebCore/ChangeLog for more detail.

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::declareAndWriteAttachment): Deleted.
* WebView/WebHTMLView.mm:
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (226311 => 226312)


--- trunk/Source/WebCore/ChangeLog	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/ChangeLog	2017-12-30 19:30:40 UTC (rev 226312)
@@ -1,3 +1,36 @@
+2017-12-30  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [Attachment Support] Remove current macOS support for dragging file-backed attachments
+        https://bugs.webkit.org/show_bug.cgi?id=181188
+
+        Reviewed by Dan Bernstein.
+
+        Support for dragging attachments out as files on the NSPasteboard was introduced in r181760. However, this is
+        (1) a macOS-specific implementation, and (2) does not support attachments whose files are backed by inline data
+        rather than a filepath. As part of adding further WebKit attachment element support, subsequent patches will
+        reimplement support for dragging attachment elements in a cross-Cocoa-platform way that also allows for either
+        data- or file-backed blobs to be written to the pasteboard.
+
+        No new functionality; no new tests. All existing layout and API tests still pass.
+
+        * page/DragClient.h:
+        (WebCore::DragClient::declareAndWriteDragImage):
+        (WebCore::DragClient::declareAndWriteAttachment): Deleted.
+        * page/DragController.cpp:
+        (WebCore::DragController::startDrag):
+        * page/DragController.h:
+        (WebCore::DragController::draggingImageURL const):
+        (WebCore::DragController::draggingAttachmentURL const): Deleted.
+        * page/gtk/DragControllerGtk.cpp:
+        (WebCore::DragController::declareAndWriteAttachment): Deleted.
+        * page/mac/DragControllerMac.mm:
+        (WebCore::DragController::declareAndWriteAttachment): Deleted.
+        * page/win/DragControllerWin.cpp:
+        (WebCore::DragController::declareAndWriteAttachment): Deleted.
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::absoluteAttachmentURL const): Deleted.
+        * rendering/HitTestResult.h:
+
 2017-12-28  Zalan Bujtas  <za...@apple.com>
 
         RenderTreeUpdater::GeneratedContent should hold a weak reference to RenderQuote.

Modified: trunk/Source/WebCore/page/DragClient.h (226311 => 226312)


--- trunk/Source/WebCore/page/DragClient.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/page/DragClient.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -58,10 +58,7 @@
     // Mac-specific helper function to allow access to web archives and NSPasteboard extras in WebKit.
     // This is not abstract as that would require another #if PLATFORM(COCOA) for the SVGImage client empty implentation.
     virtual void declareAndWriteDragImage(const String&, Element&, const URL&, const String&, Frame*) { }
-#if ENABLE(ATTACHMENT_ELEMENT)
-    virtual void declareAndWriteAttachment(const String&, Element&, const URL&, const String&, Frame*) { }
 #endif
-#endif
 
     virtual ~DragClient() = default;
 };

Modified: trunk/Source/WebCore/page/DragController.cpp (226311 => 226312)


--- trunk/Source/WebCore/page/DragController.cpp	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/page/DragController.cpp	2017-12-30 19:30:40 UTC (rev 226312)
@@ -870,10 +870,6 @@
 
     URL linkURL = hitTestResult.absoluteLinkURL();
     URL imageURL = hitTestResult.absoluteImageURL();
-#if ENABLE(ATTACHMENT_ELEMENT)
-    URL attachmentURL = hitTestResult.absoluteAttachmentURL();
-    m_draggingAttachmentURL = URL();
-#endif
 
     IntPoint mouseDraggedPoint = src.view()->windowToContents(dragEvent.position());
 
@@ -1079,11 +1075,7 @@
         auto previousSelection = src.selection().selection();
         if (hasData == HasNonDefaultPasteboardData::No) {
             selectElement(element);
-            if (!attachmentURL.isEmpty()) {
-                // Use the attachment URL specified by the file attribute to populate the pasteboard.
-                m_draggingAttachmentURL = attachmentURL;
-                declareAndWriteAttachment(dataTransfer, element, attachmentURL);
-            } else if (src.editor().client()) {
+            if (src.editor().client()) {
 #if PLATFORM(COCOA)
                 // Otherwise, if no file URL is specified, call out to the injected bundle to populate the pasteboard with data.
                 auto& editor = src.editor();

Modified: trunk/Source/WebCore/page/DragController.h (226311 => 226312)


--- trunk/Source/WebCore/page/DragController.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/page/DragController.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -74,9 +74,6 @@
         bool didInitiateDrag() const { return m_didInitiateDrag; }
         DragOperation sourceDragOperation() const { return m_sourceDragOperation; }
         const URL& draggingImageURL() const { return m_draggingImageURL; }
-#if ENABLE(ATTACHMENT_ELEMENT)
-        const URL& draggingAttachmentURL() const { return m_draggingAttachmentURL; }
-#endif
         void setDragOffset(const IntPoint& offset) { m_dragOffset = offset; }
         const IntPoint& dragOffset() const { return m_dragOffset; }
         DragSourceAction dragSourceAction() const { return m_dragSourceAction; }
@@ -132,9 +129,6 @@
 
         void cleanupAfterSystemDrag();
         void declareAndWriteDragImage(DataTransfer&, Element&, const URL&, const String& label);
-#if ENABLE(ATTACHMENT_ELEMENT)
-        void declareAndWriteAttachment(DataTransfer&, Element&, const URL&);
-#endif
         Page& m_page;
         DragClient& m_client;
 
@@ -151,9 +145,6 @@
         IntPoint m_dragOffset;
         URL m_draggingImageURL;
         bool m_isPerformingDrop { false };
-#if ENABLE(ATTACHMENT_ELEMENT)
-        URL m_draggingAttachmentURL;
-#endif
     };
 
     WEBCORE_EXPORT bool isDraggableLink(const Element&);

Modified: trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp (226311 => 226312)


--- trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp	2017-12-30 19:30:40 UTC (rev 226312)
@@ -76,10 +76,4 @@
     frame->editor().writeImageToPasteboard(dataTransfer.pasteboard(), element, url, label);
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void DragController::declareAndWriteAttachment(DataTransfer&, Element&, const URL&)
-{
 }
-#endif
-
-}

Modified: trunk/Source/WebCore/page/mac/DragControllerMac.mm (226311 => 226312)


--- trunk/Source/WebCore/page/mac/DragControllerMac.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/page/mac/DragControllerMac.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -138,14 +138,6 @@
 
 #endif
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void DragController::declareAndWriteAttachment(DataTransfer& dataTransfer, Element& element, const URL& url)
-{
-    const HTMLAttachmentElement& attachment = downcast<HTMLAttachmentElement>(element);
-    m_client.declareAndWriteAttachment(dataTransfer.pasteboard().name(), element, url, attachment.file()->path(), element.document().frame());
-}
-#endif
-    
 void DragController::declareAndWriteDragImage(DataTransfer& dataTransfer, Element& element, const URL& url, const String& label)
 {
     m_client.declareAndWriteDragImage(dataTransfer.pasteboard().name(), element, url, label, element.document().frame());

Modified: trunk/Source/WebCore/page/win/DragControllerWin.cpp (226311 => 226312)


--- trunk/Source/WebCore/page/win/DragControllerWin.cpp	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/page/win/DragControllerWin.cpp	2017-12-30 19:30:40 UTC (rev 226312)
@@ -67,12 +67,6 @@
 {
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void DragController::declareAndWriteAttachment(DataTransfer&, Element&, const URL&)
-{
-}
-#endif
-
 void DragController::declareAndWriteDragImage(DataTransfer& dataTransfer, Element& element, const URL& url, const String& label)
 {
     Pasteboard& pasteboard = dataTransfer.pasteboard();

Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (226311 => 226312)


--- trunk/Source/WebCore/rendering/HitTestResult.cpp	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp	2017-12-30 19:30:40 UTC (rev 226312)
@@ -341,30 +341,6 @@
     return m_innerNonSharedNode->renderBox()->absoluteContentQuad().enclosingBoundingBox();
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-URL HitTestResult::absoluteAttachmentURL() const
-{
-    if (!m_innerNonSharedNode)
-        return URL();
-    
-    if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()->isAttachment()))
-        return URL();
-    
-    if (!is<HTMLAttachmentElement>(*m_innerNonSharedNode))
-        return URL();
-    File* attachmentFile = downcast<HTMLAttachmentElement>(*m_innerNonSharedNode).file();
-    if (!attachmentFile)
-        return URL();
-    
-    auto filepath = attachmentFile->path();
-    if (!filepath.isEmpty())
-        return URL::fileURLWithFileSystemPath(filepath);
-
-    ASSERT(attachmentFile->url().protocolIsBlob());
-    return attachmentFile->url();
-}
-#endif
-
 URL HitTestResult::absoluteImageURL() const
 {
     if (!m_innerNonSharedNode)

Modified: trunk/Source/WebCore/rendering/HitTestResult.h (226311 => 226312)


--- trunk/Source/WebCore/rendering/HitTestResult.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebCore/rendering/HitTestResult.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -105,9 +105,6 @@
     WEBCORE_EXPORT URL absolutePDFURL() const;
     WEBCORE_EXPORT URL absoluteMediaURL() const;
     WEBCORE_EXPORT URL absoluteLinkURL() const;
-#if ENABLE(ATTACHMENT_ELEMENT)
-    WEBCORE_EXPORT URL absoluteAttachmentURL() const;
-#endif
     WEBCORE_EXPORT String textContent() const;
     bool isOverLink() const;
     WEBCORE_EXPORT bool isContentEditable() const;

Modified: trunk/Source/WebKit/ChangeLog (226311 => 226312)


--- trunk/Source/WebKit/ChangeLog	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/ChangeLog	2017-12-30 19:30:40 UTC (rev 226312)
@@ -1,3 +1,29 @@
+2017-12-30  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [Attachment Support] Remove current macOS support for dragging file-backed attachments
+        https://bugs.webkit.org/show_bug.cgi?id=181188
+
+        Reviewed by Dan Bernstein.
+
+        See WebCore/ChangeLog for more detail.
+
+        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+        (WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted.
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::setPromisedDataForAttachment): Deleted.
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/mac/PageClientImplMac.h:
+        * UIProcess/mac/PageClientImplMac.mm:
+        (WebKit::PageClientImpl::setPromisedDataForAttachment): Deleted.
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::setPromisedDataForAttachment): Deleted.
+        * WebProcess/WebCoreSupport/WebDragClient.h:
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::WebDragClient::declareAndWriteAttachment): Deleted.
+
 2017-12-28  Brady Eidson  <beid...@apple.com>
 
         Add a ProcessIdentifier, vended from the UI process, to each child process

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -115,15 +115,6 @@
     notImplemented();
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-
-void WebPageProxy::setPromisedDataForAttachment(const String&, const String&, const String&, const String&, const String&, const String&)
-{
-    notImplemented();
-}
-
-#endif
-
 void WebPageProxy::setDragCaretRect(const IntRect& dragCaretRect)
 {
     if (m_currentDragCaretRect == dragCaretRect)

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -415,9 +415,6 @@
     void dragImageForView(NSView *, NSImage *, CGPoint clientPoint, bool linkDrag);
     void setFileAndURLTypes(NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, NSPasteboard *);
     void setPromisedDataForImage(WebCore::Image*, NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, WebCore::SharedBuffer* archiveBuffer, NSString *pasteboardName);
-#if ENABLE(ATTACHMENT_ELEMENT)
-    void setPromisedDataForAttachment(NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, NSString *pasteboardName);
-#endif
     void pasteboardChangedOwner(NSPasteboard *);
     void provideDataForPasteboard(NSPasteboard *, NSString *type);
     NSArray *namesOfPromisedFilesDroppedAtDestination(NSURL *dropDestination);

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -3835,20 +3835,6 @@
     m_promisedImage = image;
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void WebViewImpl::setPromisedDataForAttachment(NSString *filename, NSString *extension, NSString *title, NSString *url, NSString *visibleURL, NSString *pasteboardName)
-{
-    NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:pasteboardName];
-    RetainPtr<NSMutableArray> types = adoptNS([[NSMutableArray alloc] initWithObjects:WebCore::legacyFilesPromisePasteboardType(), nil]);
-    [types addObjectsFromArray:PasteboardTypes::forURL()];
-    [pasteboard declareTypes:types.get() owner:m_view.getAutoreleased()];
-    setFileAndURLTypes(filename, extension, title, url, visibleURL, pasteboard);
-    [pasteboard setPropertyList:@[title] forType:WebCore::legacyFilenamesPasteboardType()];
-
-    m_promisedImage = nullptr;
-}
-#endif
-
 void WebViewImpl::pasteboardChangedOwner(NSPasteboard *pasteboard)
 {
     m_promisedImage = nullptr;

Modified: trunk/Source/WebKit/UIProcess/PageClient.h (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/PageClient.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/PageClient.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -191,10 +191,7 @@
 
 #if USE(APPKIT)
     virtual void setPromisedDataForImage(const String& pasteboardName, Ref<WebCore::SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl, RefPtr<WebCore::SharedBuffer>&& archiveBuffer) = 0;
-#if ENABLE(ATTACHMENT_ELEMENT)
-    virtual void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl) = 0;
 #endif
-#endif
 
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -870,10 +870,7 @@
     void startDrag(const WebCore::DragItem&, const ShareableBitmap::Handle& dragImageHandle);
     void setPromisedDataForImage(const String& pasteboardName, const SharedMemory::Handle& imageHandle, uint64_t imageSize, const String& filename, const String& extension,
                          const String& title, const String& url, const String& visibleURL, const SharedMemory::Handle& archiveHandle, uint64_t archiveSize);
-#if ENABLE(ATTACHMENT_ELEMENT)
-    void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL);
 #endif
-#endif
 #if PLATFORM(GTK)
     void startDrag(WebSelectionData&&, uint64_t dragOperation, const ShareableBitmap::Handle& dragImage);
 #endif

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2017-12-30 19:30:40 UTC (rev 226312)
@@ -309,10 +309,7 @@
 #if PLATFORM(COCOA) && ENABLE(DRAG_SUPPORT)
     StartDrag(struct WebCore::DragItem dragItem, WebKit::ShareableBitmap::Handle dragImage)
     SetPromisedDataForImage(String pasteboardName, WebKit::SharedMemory::Handle imageHandle, uint64_t imageSize, String filename, String extension, String title, String url, String visibleURL, WebKit::SharedMemory::Handle archiveHandle, uint64_t archiveSize)
-#if ENABLE(ATTACHMENT_ELEMENT)
-    SetPromisedDataForAttachment(String pasteboardName, String filename, String extension, String title, String url, String visibleURL)
 #endif
-#endif
 #if PLATFORM(GTK) && ENABLE(DRAG_SUPPORT)
     StartDrag(struct WebKit::WebSelectionData selection, uint64_t dragOperation, WebKit::ShareableBitmap::Handle dragImage)
 #endif

Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -97,9 +97,6 @@
     void setDragImage(const WebCore::IntPoint& clientPosition, Ref<ShareableBitmap>&& dragImage, WebCore::DragSourceAction) override;
     void setPromisedDataForImage(const String& pasteboardName, Ref<WebCore::SharedBuffer>&& imageBuffer, const String& filename, const String& extension, const String& title,
         const String& url, const String& visibleUrl, RefPtr<WebCore::SharedBuffer>&& archiveBuffer) override;
-#if ENABLE(ATTACHMENT_ELEMENT)
-    void setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleUrl) override;
-#endif
     void updateSecureInputState() override;
     void resetSecureInputState() override;
     void notifyInputContextAboutDiscardedComposition() override;

Modified: trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/mac/PageClientImplMac.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -364,13 +364,6 @@
     m_impl->setPromisedDataForImage(image.get(), filename, extension, title, url, visibleURL, archiveBuffer.get(), pasteboardName);
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void PageClientImpl::setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL)
-{
-    m_impl->setPromisedDataForAttachment(filename, extension, title, url, visibleURL, pasteboardName);
-}
-#endif
-
 void PageClientImpl::updateSecureInputState()
 {
     m_impl->updateSecureInputState();

Modified: trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm (226311 => 226312)


--- trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/UIProcess/mac/WebPageProxyMac.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -290,15 +290,7 @@
     m_pageClient.setPromisedDataForImage(pasteboardName, WTFMove(imageBuffer), filename, extension, title, url, visibleURL, WTFMove(archiveBuffer));
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void WebPageProxy::setPromisedDataForAttachment(const String& pasteboardName, const String& filename, const String& extension, const String& title, const String& url, const String& visibleURL)
-{
-    MESSAGE_CHECK_URL(url);
-    MESSAGE_CHECK_URL(visibleURL);
-    m_pageClient.setPromisedDataForAttachment(pasteboardName, filename, extension, title, url, visibleURL);
-}
 #endif
-#endif
 
 void WebPageProxy::performDictionaryLookupAtLocation(const WebCore::FloatPoint& point)
 {

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h (226311 => 226312)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebDragClient.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -51,10 +51,7 @@
 
 #if PLATFORM(COCOA)
     void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String&, WebCore::Frame*) override;
-#if ENABLE(ATTACHMENT_ELEMENT)
-    void declareAndWriteAttachment(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String& path, WebCore::Frame*) override;
 #endif
-#endif
 
     void dragControllerDestroyed() override;
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (226311 => 226312)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -115,19 +115,6 @@
     return image;
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void WebDragClient::declareAndWriteAttachment(const String& pasteboardName, Element& element, const URL& url, const String& path, WebCore::Frame* frame)
-{
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    ASSERT(pasteboardName == String(NSDragPboard));
-#pragma clang diagnostic pop
-    
-    NSURL* nsURL = (NSURL *)url;
-    m_page->send(Messages::WebPageProxy::SetPromisedDataForAttachment(pasteboardName, String(nsURL.lastPathComponent), String(nsURL.pathExtension), path, String(nsURL.absoluteString), userVisibleString(nsURL)));
-}
-#endif
-
 void WebDragClient::declareAndWriteDragImage(const String& pasteboardName, Element& element, const URL& url, const String& label, Frame*)
 {
 #pragma clang diagnostic push
@@ -232,15 +219,6 @@
     m_page->didConcludeEditDataInteraction();
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-
-void WebDragClient::declareAndWriteAttachment(const String&, Element&, const URL&, const String&, Frame*)
-{
-    notImplemented();
-}
-
-#endif
-
 #endif // PLATFORM(IOS)
 
 } // namespace WebKit

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (226311 => 226312)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2017-12-30 19:30:40 UTC (rev 226312)
@@ -1,3 +1,18 @@
+2017-12-30  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [Attachment Support] Remove current macOS support for dragging file-backed attachments
+        https://bugs.webkit.org/show_bug.cgi?id=181188
+
+        Reviewed by Dan Bernstein.
+
+        See WebCore/ChangeLog for more detail.
+
+        * WebCoreSupport/WebDragClient.h:
+        * WebCoreSupport/WebDragClient.mm:
+        (WebDragClient::declareAndWriteAttachment): Deleted.
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
+
 2017-12-22  Wenson Hsieh  <wenson_hs...@apple.com>
 
         Unreviewed, continue to fix build failures due to AppKit API deprecation

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h (226311 => 226312)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.h	2017-12-30 19:30:40 UTC (rev 226312)
@@ -44,9 +44,6 @@
     void beginDrag(WebCore::DragItem, WebCore::Frame&, const WebCore::IntPoint& mouseDownPosition, const WebCore::IntPoint& mouseDraggedPosition, WebCore::DataTransfer&, WebCore::DragSourceAction) override;
 
     void declareAndWriteDragImage(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String&, WebCore::Frame*) override;
-#if ENABLE(ATTACHMENT_ELEMENT)
-    void declareAndWriteAttachment(const String& pasteboardName, WebCore::Element&, const WebCore::URL&, const String& path, WebCore::Frame*) override;
-#endif
     void didConcludeEditDrag() override;
 private:
     WebView* m_webView;

Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.mm (226311 => 226312)


--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebDragClient.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -169,15 +169,6 @@
     [[NSPasteboard pasteboardWithName:pasteboardName] _web_declareAndWriteDragImageForElement:kit(&element) URL:url title:title archive:[kit(&element) webArchive] source:getTopHTMLView(frame)];
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void WebDragClient::declareAndWriteAttachment(const String& pasteboardName, Element& element, const URL& url, const String& path, WebCore::Frame* frame)
-{
-    ASSERT(pasteboardName);
-    
-    [[NSPasteboard pasteboardWithName:pasteboardName] _web_declareAndWriteDragImageForElement:kit(&element) URL:url title:path archive:nil source:getTopHTMLView(frame)];
-}
-#endif
-
 #elif !ENABLE(DATA_INTERACTION)
 
 bool WebDragClient::useLegacyDragClient()
@@ -214,14 +205,8 @@
 {
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void WebDragClient::declareAndWriteAttachment(const String&, Element&, const URL&, const String&, WebCore::Frame*)
-{
-}
 #endif
 
-#endif
-
 #if PLATFORM(IOS)
 
 bool WebDragClient::useLegacyDragClient()
@@ -258,12 +243,6 @@
         frame->editor().writeImageToPasteboard(*Pasteboard::createForDragAndDrop(), element, url, label);
 }
 
-#if ENABLE(ATTACHMENT_ELEMENT)
-void WebDragClient::declareAndWriteAttachment(const String&, Element&, const URL&, const String&, Frame*)
-{
-}
-#endif
-
 void WebDragClient::didConcludeEditDrag()
 {
     [m_webView _didConcludeEditDataInteraction];

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (226311 => 226312)


--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2017-12-30 19:05:32 UTC (rev 226311)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2017-12-30 19:30:40 UTC (rev 226312)
@@ -4365,10 +4365,6 @@
         const URL& imageURL = page->dragController().draggingImageURL();
         if (!imageURL.isEmpty())
             draggingElementURL = imageURL;
-#if ENABLE(ATTACHMENT_ELEMENT)
-        else
-            draggingElementURL = page->dragController().draggingAttachmentURL();
-#endif
 
         wrapper = [[self _dataSource] _fileWrapperForURL:draggingElementURL];
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to