Allow drag&drop of image from browser. b=146299 [checking in for mjudge] r=cmanske, sr=jag

git-svn-id: svn://10.0.0.236/trunk@123775 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cmanske%netscape.com 2002-06-21 06:16:14 +00:00
parent af2cd6c3ea
commit 8e324f78b9

View File

@ -666,7 +666,7 @@ nsContentAreaDragDrop::NormalizeSelection(nsIDOMNode* inBaseNode, nsISelection*
return;
PRUint32 listLen = 0;
childNodes->GetLength(&listLen);
PRInt32 index = 0;
PRUint32 index = 0;
for ( ; index < listLen; ++index ) {
nsCOMPtr<nsIDOMNode> indexedNode;
childNodes->Item(index, getter_AddRefs(indexedNode));
@ -837,6 +837,9 @@ nsContentAreaDragDrop::BuildDragData(nsIDOMEvent* inMouseEvent, nsAString & outU
// also grab the image data
GetImageFromDOMNode(draggedNode, outImage);
// select siblings up to and including the selected link. this
// shouldn't be fatal, and we should still do the drag if this fails
NormalizeSelection(draggedNode, selection);
} // img
else {
nsCOMPtr<nsIDOMHTMLLinkElement> link(do_QueryInterface(draggedNode));