Bug 212614 - Add a helper method to populate a DataTransfer before dispatching a "dragstart" event
Summary: Add a helper method to populate a DataTransfer before dispatching a "dragstar...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2020-06-01 15:00 PDT by Wenson Hsieh
Modified: 2020-06-02 18:50 PDT (History)
6 users (show)

See Also:


Attachments
Patch (9.72 KB, patch)
2020-06-01 17:02 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Fix WinCairo build (9.90 KB, patch)
2020-06-01 17:07 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2020-06-01 15:00:48 PDT
Work towards <rdar://problem/61368402>
Comment 1 Wenson Hsieh 2020-06-01 17:02:29 PDT Comment hidden (obsolete)
Comment 2 Wenson Hsieh 2020-06-01 17:07:21 PDT
Created attachment 400773 [details]
Fix WinCairo build
Comment 3 Tim Horton 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?
Comment 4 Wenson Hsieh 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.
Comment 5 EWS 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].