Closed Bug 1498381 Opened 1 year ago Closed 1 year ago

EventUtils.js dispatches artificial mouseup after dnd

Categories

(Core :: DOM: Events, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(2 files)

No description provided.
When using dnd natively, mouseup isn't dispatched.
Once click handling is changed, the artificial mouseup maps to the mousedown and click may be dispatched more often than currently.
Attachment #9016584 - Flags: review?(masayuki)
Comment on attachment 9016584 [details] [diff] [review]
EventUtils_mouseup_export.diff

Indeed, I see mouseup event only after I cancel D&D with Escape key (on Windows).

>@@ -2460,17 +2458,16 @@ async function synthesizePlainDragAndDro
>     await new Promise(r => setTimeout(r, 0));
> 
>     event = createDragEventObject("drop", destElement, destWindow,
>                                   dataTransfer, {});
>     sendDragEvent(event, destElement, destWindow);
> 
>     await new Promise(r => setTimeout(r, 0));
> 
>-    synthesizeMouseAtCenter(destElement, { type: "mouseup" }, destWindow);
>   } finally {

nit: the previous empty line must be unnecessary.
Attachment #9016584 - Flags: review?(masayuki) → review+
I'll actually come up with a bit different patch so that I can fix also bug 1498379 here.
Or perhaps not. That is so different issue and I don't want to expand the scope of bug 1089326 too much.
Priority: -- → P2
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/962c7631d98c
EventUtils.js shouldn't dispatch artificial mouseup after dnd, r=masayuki
https://hg.mozilla.org/mozilla-central/rev/962c7631d98c
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Backed out 2 changesets (bug 1498379, bug 1498381) for permafailing at /test/tabs/browser_multiselect_tabs_drag_to_bookmarks_toolbar.js a=backout

Backout link: https://hg.mozilla.org/mozilla-central/rev/4b02380c0bbb5151f1a1f4606c29f2a1cbb70225

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&resultStatus=pending,running,success,testfailed,busted,exception&revision=03f328ed7618d4fcdaad1688f4f2012f11f55084&selectedJob=205254870

Log link: https://treeherder.mozilla.org/logviewer.html#?job_id=205254870&repo=mozilla-inbound&lineNumber=5838

Log snippet: 

11:27:33     INFO - Console message: [JavaScript Error: "Empty array passed for required input property:
11:27:33     INFO -                            guids" {file: "resource://gre/modules/PlacesTransactions.jsm" line: 826}]
11:27:33     INFO - validateInput@resource://gre/modules/PlacesTransactions.jsm:826:17
11:27:33     INFO - DefineTransaction.validatePropertyValue@resource://gre/modules/PlacesTransactions.jsm:847:36
11:27:33     INFO - DefineTransaction.verifyInput@resource://gre/modules/PlacesTransactions.jsm:891:24
11:27:33     INFO - ctor@resource://gre/modules/PlacesTransactions.jsm:693:15
11:27:33     INFO - ctor@resource://gre/modules/PlacesTransactions.jsm:689:14
11:27:33     INFO - getTransactionsForTransferItems@resource:///modules/PlacesUIUtils.jsm:1181:13
11:27:33     INFO - handleTransferItems@resource:///modules/PlacesUIUtils.jsm:934:22
11:27:33     INFO - async*onDrop@chrome://browser/content/places/controller.js:1441:11
11:27:33     INFO - async*PT__onDrop@chrome://browser/content/places/browserPlacesViews.js:1824:7
11:27:33     INFO - PT_handleEvent@chrome://browser/content/places/browserPlacesViews.js:1225:9
11:27:33     INFO - sendDragEvent@chrome://mochikit/content/tests/SimpleTest/EventUtils.js:263:10
11:27:33     INFO - synthesizePlainDragAndDrop@chrome://mochikit/content/tests/SimpleTest/EventUtils.js:2462:5
11:27:33     INFO - async*test@chrome://mochitests/content/browser/browser/base/content/test/tabs/browser_multiselect_tabs_drag_to_bookmarks_toolbar.js:42:9
11:27:33     INFO - Async*Tester_execTest/<@chrome://mochikit/content/browser-test.js:1093:34
11:27:33     INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1084:16
11:27:33     INFO - nextTest/<@chrome://mochikit/content/browser-test.js:986:9
11:27:33     INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:795:59
11:27:33     INFO - 
11:27:33     INFO - Buffered messages finished
11:27:33     INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/tabs/browser_multiselect_tabs_drag_to_bookmarks_toolbar.js | Uncaught exception - waiting for 2 bookmarks - timed out after 50 tries.
11:27:33     INFO - Leaving test bound test
11:27:33     INFO - GECKO(1180) | --DOMWINDOW == 11 (085DC800) [pid = 3888] [serial = 37] [outer = 00000000] [url = about:blank]
11:27:33     INFO - GECKO(1180) | --DOMWINDOW == 10 (0BFF3800) [pid = 3888] [serial = 32] [outer = 00000000] [url = about:blank]
11:27:33     INFO - GECKO(1180) | --DOMWINDOW == 9 (0BF1DC00) [pid = 3888] [serial = 35] [outer = 00000000] [url = http://mochi.test:8888/]
11:27:33     INFO - GECKO(1180) | --DOMWINDOW == 8 (0BF1F000) [pid = 3888] [serial = 38] [outer = 00000000] [url = http://mochi.test:8888/]
11:27:33     INFO - GECKO(1180) | MEMORY STAT | vsize 787MB | vsizeMaxContiguous 613MB | residentFast 247MB | heapAllocated 89MB
Status: RESOLVED → REOPENED
Flags: needinfo?(bugs)
Resolution: FIXED → ---
change only synthesizeDropAfterDragOver
Flags: needinfo?(bugs)
Pushed by opettay@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2c7473068da1
EventUtils.js shouldn't dispatch artificial mouseup after dnd, r=masayuki
https://hg.mozilla.org/mozilla-central/rev/2c7473068da1
Status: REOPENED → RESOLVED
Closed: 1 year ago1 year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.