Bug 8276

Summary: REGRESSION (NativeTextField): Pasting a Finder item into a text field results in a file: URL being pasted instead of just the file name
Product: WebKit Reporter: mitz
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Regression
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Paste as plain text when targeting a text field
none
Same code patch, with a change log and a manual test for this bug and bug 8283
darin: review+
Contents of resources/plain-text-paste none

mitz
Reported 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.
Attachments
Paste as plain text when targeting a text field (10.55 KB, patch)
2006-04-11 05:52 PDT, mitz
no flags
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+
Contents of resources/plain-text-paste (2.70 KB, application/octet-stream)
2006-04-18 12:09 PDT, mitz
no flags
Adele Peterson
Comment 1 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.
mitz
Comment 2 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.
Darin Adler
Comment 3 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
mitz
Comment 4 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.
mitz
Comment 5 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.
mitz
Comment 6 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
mitz
Comment 7 2006-04-18 12:09:05 PDT
Created attachment 7808 [details] Contents of resources/plain-text-paste
Darin Adler
Comment 8 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
mitz
Comment 9 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.
Mark Rowe (bdash)
Comment 10 2006-10-05 15:30:16 PDT
Fixed in r16827.
Note You need to log in before you can comment on or make changes to this bug.