Closed Bug 469465 Opened 16 years ago Closed 16 years ago

Drag'n'drop to create bookmark doesn't work

Categories

(SeaMonkey :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neil, Assigned: neil)

References

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

Unlike most other ways of adding a bookmark, drag'n'drop tries to be clever and use the linked page's title from history rather than the link text. Of course the code needs to be updated to work with Places.
Attached patch Proposed patch (obsolete) — Splinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #352839 - Flags: review?(jag)
Blocks: 469153
No longer blocks: 469153
Comment on attachment 352839 [details] [diff] [review]
Proposed patch

Does it make sense to use the document's charset for URLs (and the bookmarks themselves, for that matter) that can be pasted or dropped from anywhere?
Attached patch Revised patch (obsolete) — Splinter Review
As discussed on IRC.
Attachment #352839 - Attachment is obsolete: true
Attachment #352868 - Flags: review?(jag)
Attachment #352839 - Flags: review?(jag)
Reading the code for |nsBookmarksService::CreateBookmark()| it expects the charset passed in (if any) to be the one from the last visit. I don't think |focusedWindow.document.characterSet| is always the right one.

How about something like:

    if (!aName || !aCharSet) {
      try {
        let navHistory = Components.classes["@mozilla.org/browser/nav-history-service;1"]
                                   .getService(Components.interfaces.nsINavHistoryService);
        let uri = makeURI(aURL, aCharSet);
         // look the name and/or charset up in history
        if (!aName)
          aName = navHistory.getPageTitle(uri);
        if (!aCharSet)
          aCharSet = navHistory.getCharsetForURI(uri);
      } catch (e) {}
    }
    if (!aName)
      aName = aDefaultName || aURL;
Attachment #352868 - Attachment is obsolete: true
Attachment #352898 - Flags: review?(jag)
Attachment #352868 - Flags: review?(jag)
Attachment #352898 - Flags: superreview+
Attachment #352898 - Flags: review?(jag)
Attachment #352898 - Flags: review+
Comment on attachment 352898 [details] [diff] [review]
Third time lucky?

r/sr=jag
Pushed changeset 8c03ecb42b18 to comm-central.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: