Bug 196442

Summary: Unable to copy and paste a PDF from Notes into Mail compose body
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bdakin, commit-queue, megan_gardner, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 196435    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Rebase on trunk
thorton: review+
Patch for landing none

Wenson Hsieh
Reported 2019-04-01 07:39:40 PDT
Attachments
Patch (28.58 KB, patch)
2019-04-01 10:52 PDT, Wenson Hsieh
no flags
Rebase on trunk (18.28 KB, patch)
2019-04-01 10:57 PDT, Wenson Hsieh
thorton: review+
Patch for landing (18.28 KB, patch)
2019-04-01 14:04 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2019-04-01 10:52:09 PDT
Wenson Hsieh
Comment 2 2019-04-01 10:57:25 PDT
Created attachment 366405 [details] Rebase on trunk
Tim Horton
Comment 3 2019-04-01 12:06:22 PDT
Comment on attachment 366405 [details] Rebase on trunk View in context: https://bugs.webkit.org/attachment.cgi?id=366405&action=review > Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:223 > static String mimeTypeFromContentType(const String& contentType) Why isn't this in UTIUtilities?
Wenson Hsieh
Comment 4 2019-04-01 12:29:23 PDT
Comment on attachment 366405 [details] Rebase on trunk View in context: https://bugs.webkit.org/attachment.cgi?id=366405&action=review >> Source/WebCore/editing/cocoa/WebContentReaderCocoa.mm:223 >> static String mimeTypeFromContentType(const String& contentType) > > Why isn't this in UTIUtilities? AFAICT, no good reason :P I'll pull this out into a separate helper in a separate change (https://bugs.webkit.org/show_bug.cgi?id=196455), since there are a number of other (unrelated) places that would also benefit from this refactoring.
Wenson Hsieh
Comment 5 2019-04-01 13:09:02 PDT
Comment on attachment 366405 [details] Rebase on trunk View in context: https://bugs.webkit.org/attachment.cgi?id=366405&action=review > Source/WebCore/platform/PasteboardItemInfo.h:73 > + return isNonTextType || containsFileURLAndFileUploadContent || !suggestedFileName.isEmpty(); As we discussed on IRC, I'm going to move the (isNonTextType || containsFileURLAndFileUploadContent) part of this out of canBeTreatedAsAttachmentOrFile() and back into Pasteboard::fileContentState, where it was originally. Relaxing the heuristic for items that contain non-text types or any file URL/file upload content causes copying and pasting text from Notes to Mail compose to insert an RTFD attachment instead of inline text :/
Wenson Hsieh
Comment 6 2019-04-01 14:04:18 PDT
Created attachment 366420 [details] Patch for landing
WebKit Commit Bot
Comment 7 2019-04-01 14:21:30 PDT
Comment on attachment 366420 [details] Patch for landing Clearing flags on attachment: 366420 Committed r243713: <https://trac.webkit.org/changeset/243713>
Note You need to log in before you can comment on or make changes to this bug.