Specify Chrome's File/Directory drag-and-drop behavior


Back in the days when prefixed APIs were considered awesome, Google Chrome proposed and shipped a sandboxed File System API with types such as FileEntry and DirectoryEntry, and ways of enumerating directories and getting at file data, in addition to APIs for creating files and directories and writing to them. Chrome also introduced drag-and-drop support for directories via DataTransferItem's webkitGetAsEntry(), using the same Entry types as the FS API - in effect exposing a d&d operation as a temporary virtual filesystem.

While the sandboxed FS API never caught on (and became a WG Note), other browser vendors have indicated an intention to implement compatible drag-and-drop support including the prefixed entry point. The associated types are only loosely described in earlier drafts of the FS API, and the entry points aren’t covered at all.

I believe it would be beneficial to the web platform to specify this common behavior to help ensure that new implementations are interoperable, guide authoring tests, and help web developers adopt this functionality. I have started writing a spec describing the current behavior in Chrome:

As mentioned in the explainer, it is an explicit non-goal of this effort to preclude innovative work in this area – notably https://github.com/wicg/directory-upload — but to fully specify the existing behavior already shipping in browser(s), “warts and all”. Assuming further implementations appear, moving some or all parts of this specification into [HTML] and/or [FileAPI] may make the most sense once all issues have been resolved.

Is there sufficient interest from other potential implementers to move this work into the WICG?


We at Microsoft support documenting these APIs given that we have implemented them to be interoperable with Chrome. Mozilla is implementing these APIs as well for interoperability. It would be beneficial for the web community to have these APIs documented as a reference for web developers and other browser vendors that wish to be interoperable.


SGTM, let’s move them over.


Thanks! Moved:

repo: https://github.com/wicg/entries-api

spec: https://wicg.github.io/entries-api/