RESOLVED FIXED 215032
REGRESSION(r261570): [GTK] Fails to send drop event to JavaScript
https://bugs.webkit.org/show_bug.cgi?id=215032
Summary REGRESSION(r261570): [GTK] Fails to send drop event to JavaScript
Joel Einbinder
Reported 2020-07-31 14:14:55 PDT
Created attachment 405738 [details] Html drag and drop demo I noticed that drag and drop stopped working for me in WebKitGTK. The dragster event fires, but not the dragover/drop events. See the attached file or this link for a minimal repro: https://code.joel.tools/vAKOQRY7GDW/ I bisected it to the commit "[GTK] Rework drag and drop handling in preparation for GTK4" https://github.com/WebKit/webkit/commit/230c1d8a9da11527b22eb7531bccc46efa0356c2
Attachments
Html drag and drop demo (953 bytes, text/html)
2020-07-31 14:14 PDT, Joel Einbinder
no flags
Patch (14.83 KB, patch)
2020-08-11 06:26 PDT, Carlos Garcia Campos
darin: review+
Carlos Garcia Campos
Comment 1 2020-08-10 10:02:42 PDT
Are you sure this regressed in r261570? I've debugged this and the problem seems to be that we end up writing custom data to the drag and drop pasteboard, something we don't support (because I thought it couldn't happen). So, I think this regressed in r261792, when we enabled custom data support. In any case, I'll check if we can support custom data for drag and drop too, or simply not use it and fallback to write strings.
Carlos Garcia Campos
Comment 2 2020-08-11 06:26:57 PDT
EWS Watchlist
Comment 3 2020-08-11 06:27:48 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Darin Adler
Comment 4 2020-08-11 14:20:58 PDT
Comment on attachment 406378 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406378&action=review > Source/WebCore/platform/gtk/PasteboardGtk.cpp:337 > + for (auto& type : customData.orderedTypes()) > + types.add(type); Are these guaranteed to be ASCII lowercase? > Source/WebCore/platform/gtk/PasteboardGtk.cpp:348 > + return copyToVector(types); This will yield the types in a random order, based on hashing. I think we probably want this sorted. > Source/WebCore/platform/gtk/PasteboardGtk.cpp:462 > + const auto& customData = data[0]; Why is it correct to look only at the first item?
Carlos Garcia Campos
Comment 5 2020-08-12 00:27:44 PDT
Comment on attachment 406378 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406378&action=review Thanks for the review! >> Source/WebCore/platform/gtk/PasteboardGtk.cpp:337 >> + types.add(type); > > Are these guaranteed to be ASCII lowercase? Yes, DataTransfer normalizes the given types. >> Source/WebCore/platform/gtk/PasteboardGtk.cpp:348 >> + return copyToVector(types); > > This will yield the types in a random order, based on hashing. I think we probably want this sorted. Why? types is a ListHashSet, not a HashSet. >> Source/WebCore/platform/gtk/PasteboardGtk.cpp:462 >> + const auto& customData = data[0]; > > Why is it correct to look only at the first item? It's not necessarily correct, but we don't support multiple items in the pasteboard, neither for clipboard nor for drag and drop. In this case it's correct, because writeCustomData is only called for dnd operations from DataTransfer::commitToPasteboard() that always passes a vector with a single element.
Carlos Garcia Campos
Comment 6 2020-08-12 00:36:01 PDT
Note You need to log in before you can comment on or make changes to this bug.