WebKit Bugzilla
Attachment 346990 Details for
Bug 188490
: [macOS 10.15] Image dragged from Safari does not appear in Notes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188490-20180812144701.patch (text/plain), 4.51 KB, created by
Wenson Hsieh
on 2018-08-12 14:47:02 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-08-12 14:47:02 PDT
Size:
4.51 KB
patch
obsolete
>Subversion Revision: 234777 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 879ad8451ef588adfce07d7d7e22d8bcdb0f6819..f78d27fbbd7d1eed858d68e5034fbe3e4e09f96c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,36 @@ >+2018-08-12 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [macOS] Dragging image from Safari fails if receiver inspects pasteboard contents but asks for file promise >+ https://bugs.webkit.org/show_bug.cgi?id=188490 >+ <rdar://problem/42830265> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Currently, we clean up some UI-process-side promised drag data stored in WebViewImpl in two places: (1) when the >+ pasteboard changes owners, and (2) when weâre asked to provide pasteboard data for the TIFF image type. This >+ results in the following two behaviors: >+ >+ (1) A drop destination cannot query for promised image data more than once (which is the symptom described in >+ this bug, <rdar://problem/42830265>), since we clear the promised image data when AppKit first asks us to >+ provide TIFF data. >+ >+ (2) If the drop target chooses to accept the drop but ends up not asking for the promised image data, weâll keep >+ a reference to the drag image around until the next image drag happens, since we currently rely on the receiver >+ to ask for promised image data in order to clean up promised image data. >+ >+ To fix this, we adjust cleanup logic for `m_promisedImage` (and related information) into a separate helper >+ method (`clearPromisedDragData`), and invoke this helper when the drag session ends, after the destination has >+ had a chance to extract data on drop; this happens during `-draggedImage:endedAt:operation:`. >+ >+ Testing is blocked on <https://bugs.webkit.org/show_bug.cgi?id=181898>. >+ >+ * UIProcess/Cocoa/WebViewImpl.h: >+ * UIProcess/Cocoa/WebViewImpl.mm: >+ (WebKit::WebViewImpl::draggedImage): >+ (WebKit::WebViewImpl::pasteboardChangedOwner): >+ (WebKit::WebViewImpl::clearPromisedDragData): >+ (WebKit::WebViewImpl::provideDataForPasteboard): >+ > 2018-08-10 Chris Dumez <cdumez@apple.com> > > Crash under NetworkResourceLoader::convertToDownload() >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >index 26db6bd0a522997c1df8b8740c90c533c931972a..c612e94dec406a82e4a9125168eb7bd4205ddd61 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.h >@@ -566,6 +566,8 @@ private: > bool useMediaPlaybackControlsView() const; > bool isRichlyEditable() const; > >+ void clearPromisedDragData(); >+ > bool m_clientWantsMediaPlaybackControlsView { false }; > bool m_canCreateTouchBars { false }; > bool m_startedListeningToCustomizationEvents { false }; >diff --git a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >index 180989d7bd0d51978cc33a77bc7c2c4ddf89164a..33b20e06d7dd0100fbd0f1847ecda89120397bce 100644 >--- a/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >+++ b/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm >@@ -3648,6 +3648,7 @@ void WebViewImpl::draggedImage(NSImage *image, CGPoint endPoint, NSDragOperation > > // Prevent queued mouseDragged events from coming after the drag and fake mouseUp event. > m_ignoresMouseDraggedEvents = true; >+ clearPromisedDragData(); > > m_page->dragEnded(WebCore::IntPoint(windowMouseLoc), WebCore::IntPoint(WebCore::globalPoint(windowMouseLoc, [m_view window])), operation); > } >@@ -3899,6 +3900,11 @@ void WebViewImpl::setPromisedDataForImage(WebCore::Image* image, NSString *filen > } > > void WebViewImpl::pasteboardChangedOwner(NSPasteboard *pasteboard) >+{ >+ clearPromisedDragData(); >+} >+ >+void WebViewImpl::clearPromisedDragData() > { > m_promisedImage = nullptr; > m_promisedFilename = emptyString(); >@@ -3907,12 +3913,9 @@ void WebViewImpl::pasteboardChangedOwner(NSPasteboard *pasteboard) > > void WebViewImpl::provideDataForPasteboard(NSPasteboard *pasteboard, NSString *type) > { >- // FIXME: need to support NSRTFDPboardType >- >- if ([type isEqual:WebCore::legacyTIFFPasteboardType()] && m_promisedImage) { >+ // FIXME: Need to support NSRTFDPboardType. >+ if ([type isEqual:WebCore::legacyTIFFPasteboardType()] && m_promisedImage) > [pasteboard setData:(__bridge NSData *)m_promisedImage->tiffRepresentation() forType:WebCore::legacyTIFFPasteboardType()]; >- m_promisedImage = nullptr; >- } > } > > static BOOL fileExists(NSString *path)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188490
:
346990
|
347062
|
347315
|
375417