Closed
Bug 1420590
Opened 7 years ago
Closed 7 years ago
dragleave event returns bad target
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla59
People
(Reporter: danny0838, Assigned: stone)
References
Details
Attachments
(2 files)
1.02 KB,
text/html
|
Details | |
1.34 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0
Build ID: 20171024165158
Steps to reproduce:
1. download the attachment and open it in Firefox.
2. drag something into the page and then drag out.
Actual results:
When dragleave fires, the event.target is set to document (if e10s activated) or XULDocument (if e10s not activated; and accessing event.target throws an error in this case).
Expected results:
The event.target should be the .dropmask element. (in other browsers)
Attachment #8931845 -
Attachment description: Illustration the dragleave bug → Illustration of the dragleave bug
Updated•7 years ago
|
Component: Untriaged → Drag and Drop
Product: Firefox → Core
Comment 2•7 years ago
|
||
Within EventStateManager::FireDragEnterOrExit an event is created and AssignDragEventData is called to copy over data from the existing event. However, the event target in mTarget is sometimes not the same as the one passed to EventDispatcher::Dispatch. Specifically, for dragexit/dragleave events, it is sLastDragOverFrame's content.
It does seem to work if I manually null out mTarget and mOriginalTarget before calling EventDispatcher::Dispatch.
Is this a suitable fix? Should I just do this in all cases? That is, something like the following for dragexit/dragleave events:
event.AssignDragEventData(*aDragEvent, true);
+ event.mTarget = nullptr;
+ event.mOriginalTarget = nullptr;
Flags: needinfo?(bugs)
Updated•7 years ago
|
Status: UNCONFIRMED → NEW
status-firefox57:
--- → wontfix
status-firefox58:
--- → fix-optional
status-firefox59:
--- → fix-optional
Ever confirmed: true
Priority: -- → P2
Comment 3•7 years ago
|
||
Hmm, is this a regression from bug 1327185, sort of.
Blocks: 1327185
Flags: needinfo?(bugs)
Comment 4•7 years ago
|
||
But yes, that looks reasonable. Or one could pass false to AssignDragEventData and set only the needed *Target variables.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → sshih
Assignee | ||
Comment 5•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8940061 -
Flags: review?(bugs)
Updated•7 years ago
|
Attachment #8940061 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 6•7 years ago
|
||
Pushed by sshih@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b1af0e28db1
dragleave event returns bad target. r=smaug.
Comment 8•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
Updated•6 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•