Bug 205758

Summary: Add support for DragEvent
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: HTML EditingAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, annulen, beidson, commit-queue, darin, dbates, esprehn+autocc, ews-watchlist, ggaren, gyuyoung.kim, kangil.han, kondapallykalyan, megan_gardner, rniwa, ryuan.choi, sergio, simon.fraser, webkit-bug-importer, wenson_hsieh, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://html.spec.whatwg.org/multipage/dnd.html#the-dragevent-interface
See Also: https://bugs.webkit.org/show_bug.cgi?id=205803
https://bugs.webkit.org/show_bug.cgi?id=205817
https://bugs.webkit.org/show_bug.cgi?id=205819
Attachments:
Description Flags
WIP Patch
none
WIP Patch
none
WIP Patch
none
WIP Patch
none
WIP Patch
none
Patch
none
Patch
none
Patch none

Chris Dumez
Reported 2020-01-03 16:15:40 PST
Add support for DragEvent: - https://html.spec.whatwg.org/multipage/dnd.html#the-dragevent-interface Both Blink and Gecko support it. In WebKit, no DragEvent and we added the dataTransfer attribute to MouseEvent instead.
Attachments
WIP Patch (25.96 KB, patch)
2020-01-03 16:21 PST, Chris Dumez
no flags
WIP Patch (28.39 KB, patch)
2020-01-03 16:28 PST, Chris Dumez
no flags
WIP Patch (30.31 KB, patch)
2020-01-03 16:49 PST, Chris Dumez
no flags
WIP Patch (30.95 KB, patch)
2020-01-03 17:04 PST, Chris Dumez
no flags
WIP Patch (34.33 KB, patch)
2020-01-03 17:42 PST, Chris Dumez
no flags
Patch (53.06 KB, patch)
2020-01-03 18:11 PST, Chris Dumez
no flags
Patch (56.21 KB, patch)
2020-01-03 19:15 PST, Chris Dumez
no flags
Patch (56.27 KB, patch)
2020-01-03 20:31 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2020-01-03 16:21:15 PST
Created attachment 386726 [details] WIP Patch
Chris Dumez
Comment 2 2020-01-03 16:28:20 PST
Created attachment 386728 [details] WIP Patch
Chris Dumez
Comment 3 2020-01-03 16:49:53 PST
Created attachment 386731 [details] WIP Patch
Chris Dumez
Comment 4 2020-01-03 17:04:11 PST
Created attachment 386733 [details] WIP Patch
Chris Dumez
Comment 5 2020-01-03 17:42:09 PST
Created attachment 386736 [details] WIP Patch
Chris Dumez
Comment 6 2020-01-03 18:11:49 PST
Chris Dumez
Comment 7 2020-01-03 19:15:30 PST
Darin Adler
Comment 8 2020-01-03 19:29:22 PST
Comment on attachment 386745 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=386745&action=review > Source/WebCore/dom/DragEvent.h:47 > + static Ref<DragEvent> create(const AtomString& eventType, DragEventInit&& init) > + { > + return adoptRef(*new DragEvent(eventType, WTFMove(init))); > + } There's no good reason for this function body to be in the header; inlining this at the call site isn’t really valuable since it’s going to call a constructor, which is not inlined. Instead we can let the constructor get inlined in the create function. And so the create function can be in the .cpp file. Nice to have a little less code in the header, I think. > Source/WebCore/dom/DragEvent.h:52 > + static Ref<DragEvent> createForBindings() > + { > + return adoptRef(*new DragEvent); > + } Ditto. > Source/WebCore/dom/DragEvent.idl:33 > + DataTransfer? dataTransfer = null; Is the "= null" really required? > Source/WebCore/page/EventHandler.cpp:2255 > + // FIXME: Use DragEvent::create which takes PlatformMouseEvent. Is this FIXME valuable? Does the suggestec change need to be made? Would it improve things? > LayoutTests/fast/events/constructors/mouse-event-constructor.html:30 > +shouldBe("new MouseEvent('eventType').dataTransfer", "undefined"); More than just "should be undefined". The property shouldn’t even be present! Might be better to check that. Something ike this: shouldBeFalse("dataTransfer in (new MouseEvent('eventType'))")
Chris Dumez
Comment 9 2020-01-03 20:31:54 PST
WebKit Commit Bot
Comment 10 2020-01-03 23:05:33 PST
Comment on attachment 386749 [details] Patch Clearing flags on attachment: 386749 Committed r254029: <https://trac.webkit.org/changeset/254029>
WebKit Commit Bot
Comment 11 2020-01-03 23:05:35 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 12 2020-01-03 23:06:20 PST
Simon Fraser (smfr)
Comment 13 2020-01-04 10:15:36 PST
Build fix in bug 205765.
Note You need to log in before you can comment on or make changes to this bug.