Closed Bug 274268 Opened 20 years ago Closed 16 years ago

sourceNode is not null for external drags

Categories

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

x86
Windows ME
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bugzilla-mozilla, Assigned: timeless)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.8a6) Gecko/20041211 Firefox/1.0+

Once something was dragged within the application any external drag will have
the sourceNode of the previous drag.

Reproducible: Always
Steps to Reproduce:
1. Paste the following into the JavaScript Console:
Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser").addEventListener("dragdrop",function(){
var a = this.nsDragAndDrop.mDragService.getCurrentSession().sourceNode; var b =
(a ? a.localName : "no sourceNode"); this.alert(b);},true);
2. Drag something within the browser (a Bookmark)
3. Drag something to the browser (a File)

Actual Results:  
The same as step 2.


Expected Results:  
"no sourceNode"


In nsBaseDragService::EndDragSession (
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/widget/src/xpwidgets/nsBaseDragService.cpp&rev=1.33#235
) I see a "mSourceDocument = nsnull;" perhaps adding "mSourceNode = nsnull;"
would help.
Assignee: nobody → timeless
Status: UNCONFIRMED → ASSIGNED
Attachment #172018 - Flags: superreview?(bzbarsky)
Attachment #172018 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 172018 [details] [diff] [review]
fix described bug, reset fields, use 2 space instead of 1 space indentation...

sr=bzbarsky assuming this has been tested
Attachment #172018 - Flags: superreview?(bzbarsky) → superreview+
Comment on attachment 172018 [details] [diff] [review]
fix described bug, reset fields, use 2 space instead of 1 space indentation...

a) why not mTargetSize.SizeTo(0, 0);
b) why clear mDragAction and mTargetSize in StartDragSession()?
This was fixed by bug 285438.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment on attachment 172018 [details] [diff] [review]
fix described bug, reset fields, use 2 space instead of 1 space indentation...

(In reply to Neil Deakin from comment #4)
> This was fixed by bug 285438.

thanks. clearing review request
Attachment #172018 - Flags: review?(neil)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: