RESOLVED FIXED 212614
Add a helper method to populate a DataTransfer before dispatching a "dragstart" event
https://bugs.webkit.org/show_bug.cgi?id=212614
Summary Add a helper method to populate a DataTransfer before dispatching a "dragstar...
Wenson Hsieh
Reported 2020-06-01 15:00:48 PDT
Attachments
Patch (9.72 KB, patch)
2020-06-01 17:02 PDT, Wenson Hsieh
no flags
Fix WinCairo build (9.90 KB, patch)
2020-06-01 17:07 PDT, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2020-06-01 17:02:29 PDT Comment hidden (obsolete)
Wenson Hsieh
Comment 2 2020-06-01 17:07:21 PDT
Created attachment 400773 [details] Fix WinCairo build
Tim Horton
Comment 3 2020-06-01 17:20:59 PDT
Comment on attachment 400773 [details] Fix WinCairo build View in context: https://bugs.webkit.org/attachment.cgi?id=400773&action=review > Source/WebCore/ChangeLog:11 > + dispatching the "dragstart" event. There should be no change in behavior yet, since StaticPasteboard doesn't > + implement methods for writing data to the pasteboard, which this new method uses. This feels oddly backwards (landing the patch that does nothing because it calls unimplemented methods). But I assume the follow-up is coming shortly? > Source/WebCore/page/DragController.cpp:965 > + auto hitTestResult = hitTestResultForDragStart(src, *state.source, dragOrigin); Are we hit testing twice now? Must we?
Wenson Hsieh
Comment 4 2020-06-01 17:41:40 PDT
Comment on attachment 400773 [details] Fix WinCairo build View in context: https://bugs.webkit.org/attachment.cgi?id=400773&action=review >> Source/WebCore/ChangeLog:11 >> + implement methods for writing data to the pasteboard, which this new method uses. > > This feels oddly backwards (landing the patch that does nothing because it calls unimplemented methods). But I assume the follow-up is coming shortly? The second part is on the way! >> Source/WebCore/page/DragController.cpp:965 >> + auto hitTestResult = hitTestResultForDragStart(src, *state.source, dragOrigin); > > Are we hit testing twice now? Must we? Hm…we might be able to, but then again it’s possible that the “dragstart” event handler might’ve changed the DOM such that the hit-tested node is no longer the same as it was during this point in time. I considered making prepareForDragStart() return an Optional<HitTestResult>, which could then be handed back to startDrag() to avoid the (probably) redundant hit-testing.
EWS
Comment 5 2020-06-02 18:50:50 PDT
Committed r262469: <https://trac.webkit.org/changeset/262469> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400773 [details].
Note You need to log in before you can comment on or make changes to this bug.