Open Bug 148207 Opened 24 years ago Updated 5 years ago

dragged imagemap links return relative URI

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P5)

defect

Tracking

()

People

(Reporter: paula, Unassigned)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Dragging an imagemap link area to the tab bar, bookmarks, location field, or other destination conveys an incomplete URI if the area's HREF is a relative URL. For example, on http://builder.com.com, the navigation tab bar in the page header is an image map. Try dragging a link ("Program", "Architect", etc.) from the image map to the tab bar. Since the image map uses relative URLs such as /builder/area.jhtml?id=u003 the new tab will get a 404 by trying to load http://builder/area.jhtml?id=u003 Likewise, dragging a link to the bookmarks or location bar gets only the relative URL. The domain is not added in as it would be for a regular relative link.
I'm seeing this in Mac OS X, build 052918 (1.0 release). Should be All/All
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
*** Bug 154464 has been marked as a duplicate of this bug. ***
Summary: dragged imagemap links return incomplete URI → dragged imagemap links return relative URI
Attached patch Hacked patch (obsolete) — Splinter Review
The attached patch uses GetAnchorURL to retrieve the full URL, it then uses CreateLinkText to format it as a nice HTML link. Is there a faster/more efficient way to do this? I'm not an expert on Mozilla APIs? Incidentally the "old" code produces invalid HTML - it appends a HREF link to an IMG tag, for example: <img src="link.htm">
Comment on attachment 93702 [details] [diff] [review] Hacked patch Index: content/base/src/nsContentAreaDragDrop.cpp =================================================================== RCS file: /cvsroot/mozilla/content/base/src/nsContentAreaDragDrop.cpp,v retrieving revision 1.13 diff -u -r1.13 nsContentAreaDragDrop.cpp --- content/base/src/nsContentAreaDragDrop.cpp 9 Aug 2002 23:45:45 -0000 1.13 +++ content/base/src/nsContentAreaDragDrop.cpp 12 Aug 2002 11:52:25 -0000 @@ -803,15 +803,13 @@ nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(draggedNode)); if ( area ) { *outIsAnchor = PR_TRUE; - // grab the href as the url, use alt text as the title of the area if it's there. - // the drag data is the image tag and src attribute. - area->GetAttribute(NS_LITERAL_STRING("href"), urlString); + // grab the href as the url, use alt text as the title of the link if it's there. + the drag data is the image tag and src attribute. + GetAnchorURL(parentAnchor, urlString); area->GetAttribute(NS_LITERAL_STRING("alt"), titleString); if ( titleString.IsEmpty() ) titleString = urlString; - htmlString = NS_LITERAL_STRING("<img src=\"") + - urlString + - NS_LITERAL_STRING("\">"); + CreateLinkText(urlString, titleString, htmlString); } // area else { nsCOMPtr<nsIDOMHTMLImageElement> img(do_QueryInterface(draggedNode));
Attachment #93702 - Attachment is obsolete: true
Attached patch Hacked patchSplinter Review
Uploaded the wrong patch - sorry!
qa contact -> pmac
QA Contact: tpreston → pmac
Comment on attachment 94914 [details] [diff] [review] Hacked patch Hmm. This patch seems pretty good and reasonable, but the original intent seems to me that if you drag / drop an area, you want to have an <img src> pointing at the area. The original behavior certainly looks broken. Asking blizzard for the review (this is an old patch someone else made), blizzard, can you forward this to someone more appropriate if you're not the guy?
Attachment #94914 - Flags: review?(blizzard)
Assignee: bross2 → nobody
QA Contact: pmac
QA Contact: drag-drop

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: