Closed Bug 393609 Opened 17 years ago Closed 17 years ago

Cocoa drag-drop fails to put link text (urld) on pasteboard

Categories

(Core :: Widget: Cocoa, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta1

People

(Reporter: alqahira, Assigned: stanshebs)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

Since the Cocoa drag-drop rewrite, the text of a link (<a href="link_url">text of a link</a>) is no longer included on the clipboard.  (There are actually a vast number of flavors we no longer put on the clipboard--see attachment 278006 [details] in bug 363577--but we may not really want to restore all of them.)  This absence breaks at least drags->bookmarks in Camino (bug 363577).

(See also bug 380582 about including a Unicode variant of urld on the clipboard as well as urld.)
Flags: blocking1.9?
Not sure, but bug 386790 might fix this? Do you actually need the string "<a hrefblahblahblah" on the clipboard, or are you looking at the NSURLPboardType (you'd get an NSURL off it)?
(In reply to comment #0)
> (See also bug 380582 about including a Unicode variant of urld on the clipboard
> as well as urld.)

One point that's relevant here is that, absent a good argument against it, I'd like to see urld as UTF-8 (which removes the need for bug 380582). See comments 5 and 8 of bug 296064; I'm don't see the expectation argument as compelling given that the whole problem is that under the old system clients have *absolutely* no idea what encoding the string is in.

> Do you actually need the string "<a hrefblahblahblah" on the clipboard,
> or are you looking at the NSURLPboardType (you'd get an NSURL off it)?

The title information isn't determinable from the URL. It's not the href part that matters, it's the "text of a link" part. E.g., if you grab the link "resolution" below and drag it, the work "resolution" needs to be avaialable in addition to "https://bugzilla.mozilla.org/page.cgi?id=fields.html#resolution"
I have a patch for 386790, but I got it partly by cribbing from Camino code. On the other hand, it's adding handling for the x-moz-url flavor to generic Cocoa drag handling, so maybe it will catch some of these cases too.

I wonder what Safari does in this case -- copy/pasting text with multiple URLs in it works fine to paste into Adium -- I'm guessing they're using NSHTMLPboardType and letting NSTextView do the heavy lifting of parsing that, but it would be interesting to test out
Flags: blocking1.9? → blocking1.9+
Assignee: joshmoz → stanshebs
The text of a link seems to be handled as if it were a title, in other words the transferable contains "url\ntext" if you drag a link on a page, and "url\npagetitle" if you drag from the url bar. Not clear if this bit of ambiguity is a feature or not, there seems not be a flavor that can include two textual elements in addition to url. Anyway, Camino's bookmark dragging is fixed by taking the post-newline piece and adding it to the pasteboard twice, once as 'urln' and once as 'urld'. The patch is very simple, but depends on 386790's fix.
Depends on: 386790
Attached patch add urld data to pasteboard (obsolete) — Splinter Review
Attachment #281735 - Flags: review?(joshmoz)
(This will obviously need a different constant name as well, per bug 386790 comment 12)
As before, with constant renamed for Camino compatibility.
Attachment #281735 - Attachment is obsolete: true
Attachment #282182 - Flags: review?(joshmoz)
Attachment #281735 - Flags: review?(joshmoz)
Attachment #282182 - Flags: superreview?(roc)
Attachment #282182 - Flags: review?(joshmoz)
Attachment #282182 - Flags: review+
Attachment #282182 - Flags: approval1.9?
Attachment #282182 - Flags: approval1.9?
Target Milestone: --- → mozilla1.9 M9
Attachment #282182 - Flags: superreview?(roc)
Attachment #282182 - Flags: superreview+
Attachment #282182 - Flags: approval1.9+
landed on trunk
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: