Bug 196442 - Unable to copy and paste a PDF from Notes into Mail compose body
Summary: Unable to copy and paste a PDF from Notes into Mail compose body
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on: 196435
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-01 07:39 PDT by Wenson Hsieh
Modified: 2019-04-01 14:22 PDT (History)
7 users (show)

See Also:


Attachments
Patch (28.58 KB, patch)
2019-04-01 10:52 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Rebase on trunk (18.28 KB, patch)
2019-04-01 10:57 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (18.28 KB, patch)
2019-04-01 14:04 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2019-04-01 07:39:40 PDT
<rdar://problem/48573098>
Comment 1 Wenson Hsieh 2019-04-01 10:52:09 PDT
Created attachment 366404 [details]
Patch
Comment 2 Wenson Hsieh 2019-04-01 10:57:25 PDT
Created attachment 366405 [details]
Rebase on trunk
Comment 3 Tim Horton 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?
Comment 4 Wenson Hsieh 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.
Comment 5 Wenson Hsieh 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 :/
Comment 6 Wenson Hsieh 2019-04-01 14:04:18 PDT
Created attachment 366420 [details]
Patch for landing
Comment 7 WebKit Commit Bot 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>