Bug 8276 - REGRESSION (NativeTextField): Pasting a Finder item into a text field results in a file: URL being pasted instead of just the file name
Summary: REGRESSION (NativeTextField): Pasting a Finder item into a text field results...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: Regression
Depends on:
Blocks:
 
Reported: 2006-04-09 05:38 PDT by mitz
Modified: 2006-10-05 15:30 PDT (History)
0 users

See Also:


Attachments
Paste as plain text when targeting a text field (10.55 KB, patch)
2006-04-11 05:52 PDT, mitz
no flags Details | Formatted Diff | Diff
Same code patch, with a change log and a manual test for this bug and bug 8283 (17.45 KB, patch)
2006-04-18 12:07 PDT, mitz
darin: review+
Details | Formatted Diff | Diff
Contents of resources/plain-text-paste (2.70 KB, application/octet-stream)
2006-04-18 12:09 PDT, mitz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2006-04-09 05:38:23 PDT
Steps to reproduce:
1) Select an item in the Finder
2) Choose Edit > Copy "<name of selected item>"
3) In Safari, go to http://www.google.com/
4) Choose Edit > Paste

Expected results:
Only the name of the item copied from the finder should be pasted into the field.

Actual results:
A file: URL for the copied item is pasted into the field.
Comment 1 Adele Peterson 2006-04-10 13:44:52 PDT
While this is a native text field regression, we think the symptom is mild, so we're moving it to P2.
Comment 2 mitz 2006-04-11 05:52:13 PDT
Created attachment 7642 [details]
Paste as plain text when targeting a text field

-[WebHTMLView _plainTextFromPasteboard:] is based on observing the behavior of AppKit text fields. This patch also addresses bug 8283.
Comment 3 Darin Adler 2006-04-11 08:10:23 PDT
Comment on attachment 7642 [details]
Paste as plain text when targeting a text field

Looks fine. I'm not sure about the part about enabling the pasteAsRichText: selector, but frankly I don't understand the value of that selector anyway, nor do I think it's used in any common case.

r=me
Comment 4 mitz 2006-04-11 15:16:42 PDT
Comment on attachment 7642 [details]
Paste as plain text when targeting a text field

Thanks to Justin I've noticed that this patch makes dragging a link into a text field result in the link's text being pasted instead of the URL. This is actually behavior that would be nice to have in rich text (pasting an anchor) but not in fields.
Comment 5 mitz 2006-04-12 13:01:33 PDT
(In reply to comment #4)
> [T]his patch makes dragging a link into a text
> field result in the link's text being pasted instead of the URL.

I was wrong (again!), it doesn't, since the NSStringPboardType contains the URL in that case. So I think the patch is fine, but I don't know how to make a test for it.
Comment 6 mitz 2006-04-18 12:07:20 PDT
Created attachment 7806 [details]
Same code patch, with a change log and a manual test for this bug and bug 8283
Comment 7 mitz 2006-04-18 12:09:05 PDT
Created attachment 7808 [details]
Contents of resources/plain-text-paste
Comment 8 Darin Adler 2006-04-19 19:34:12 PDT
Comment on attachment 7806 [details]
Same code patch, with a change log and a manual test for this bug and bug 8283

r=me again
Comment 9 mitz 2006-09-10 15:11:58 PDT
The resources for the test weren't checked in properly. Their resource forks and Finder metadata need to be preserved for the test to work. I think the right way to do it is to use /Developer/Tools/SplitForks on the directory and then check in the AppleDouble pairs.
Comment 10 Mark Rowe (bdash) 2006-10-05 15:30:16 PDT
Fixed in r16827.