browser(firefox): pass null for the data transfer (#5723)

This commit is contained in:
Joel Einbinder 2021-03-04 17:20:45 -08:00 committed by GitHub
parent 8ffcbb3808
commit e56f56c11e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -1,2 +1,2 @@
1236
Changed: lushnikov@chromium.org Tue 02 Mar 2021 06:38:43 PM PST
1237
Changed: joel.einbinder@gmail.com Thu 04 Mar 2021 05:16:38 PM PST

View File

@ -790,8 +790,6 @@ class PageAgent {
const element = window.windowUtils.elementFromPoint(x, y, false, false);
const event = window.document.createEvent('DragEvent');
const dataTransfer = dragService.getCurrentSession().dataTransfer.mozCloneForEvent(type);
dataTransfer.dropEffect = 'move';
event.initDragEvent(
type,
true /* bubble */,
@ -808,7 +806,7 @@ class PageAgent {
modifiers & 8 /* metaKey */,
0 /* button */, // firefox always has the button as 0 on drops, regardless of which was pressed
null /* relatedTarget */,
dataTransfer,
null,
);
if (type !== 'drop' || dragService.dragAction)
window.windowUtils.dispatchDOMEventViaPresShellForTesting(element, event);