Bug 185205 - Can't copy and paste URLs that have no title into Mail (macOS)
Summary: Can't copy and paste URLs that have no title into Mail (macOS)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-02 10:40 PDT by Aditya Keerthi
Modified: 2018-08-10 16:26 PDT (History)
6 users (show)

See Also:


Attachments
Proposed fix (5.23 KB, patch)
2018-05-02 14:17 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff
Patch (7.30 KB, patch)
2018-05-02 14:42 PDT, Aditya Keerthi
thorton: review+
Details | Formatted Diff | Diff
Patch (7.25 KB, patch)
2018-05-02 15:18 PDT, Aditya Keerthi
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aditya Keerthi 2018-05-02 10:40:47 PDT
Steps To Reproduce:
1. Open https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video in Safari
2. Right click the video and select Copy Video address
3. Paste into new Mail message

Results:
Paste does not paste anything.
Pasting into Messages and contenteditable divs works.
Comment 1 Aditya Keerthi 2018-05-02 10:41:48 PDT
<rdar://problem/36352406>
Comment 2 Aditya Keerthi 2018-05-02 14:17:38 PDT
Created attachment 339338 [details]
Proposed fix
Comment 3 Aditya Keerthi 2018-05-02 14:42:23 PDT
Created attachment 339344 [details]
Patch
Comment 4 Tim Horton 2018-05-02 15:05:26 PDT
Comment on attachment 339344 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=339344&action=review

> Source/WebCore/platform/mac/PasteboardMac.mm:202
> -        paths.append(pasteboardURL.title.stripWhiteSpace());
> +        paths.append([title stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]);

We should probably just use our stripWhiteSpace, not Cocoa’s. You’re going to turn it into a String soon anyway, might as well do it before that step and use more WebKit code.

> Tools/TestWebKitAPI/Tests/mac/ContextMenuCanCopyURL.mm:116
> +    urls = [WebURLsWithTitles URLsFromPasteboard: [NSPasteboard generalPasteboard]];

No spaces after colons.
Comment 5 Aditya Keerthi 2018-05-02 15:18:35 PDT
Created attachment 339354 [details]
Patch
Comment 6 WebKit Commit Bot 2018-05-02 15:55:50 PDT
Comment on attachment 339354 [details]
Patch

Clearing flags on attachment: 339354

Committed r231276: <https://trac.webkit.org/changeset/231276>