This finally just bugged me enough last night that I did it.
Created attachment 8105 [details]
Add drag & drop support to <input type=file>
There are a few concerns I have with this patch:
1. Is this really in the right place (on the actual WebCoreFileButton instead of the WebHTMLView?)
2. Does it look right (it overlays 25% gray)
3. Should we support things other than just normal files?
*** Bug 5733 has been marked as a duplicate of this bug. ***
Ah yes, my 4th concern:
4. does this have security implications?
Bug 5733 mentions Radar # 3083272.
5. I currently don't accept file promises... maybe it should.
- WebCoreFileButton seems like a fine place to do this, at least until the file upload control is pushed down into the engine. We already accept file drags to the page content area to set the current URL. You could still hack this at the document view level but I think this is simpler.
- 25% gray overlay seems fine. If not, we can certainly tweak it.
- Handling file promise drags would be good, but I don't think you need to finish that before landing this patch.
- Not sure if there are any security implications. I think that since the user is entirely in control of the file being picked, there's no risk that a page author could programmatically traverse symlinks and gain access to a file that the user didn't expect. Maybe one of our security gurus can correct me on this.