[whatwg] Drag-and-drop folders/files support with directory structure using DirectoryEntry

uOn Fri, Apr 6, 2012 at 10:37 PM, Glenn Maynard <glenn at zewt.org> wrote:

> On Thu, Apr 5, 2012 at 11:42 PM, Kinuko Yasuda <kinuko at chromium.org>wrote:
>
>> Does this actually need to be async?  The only information you need to
>> create the Entry are the filename and the file type (file or directory),
>> which the browser can load before performing the drop, so no file I/O is
>> needed here.
>>
>> I wanted to make it synchronous, but determining the file type (file or
>> directory) usually requires blocking file I/O operation, which could spoil
>> the async nature of this proposal if we perform the blocking stat operation
>> on every drag-enter event.
>>
>
> This can be done before exposing the drop event to the page in the first
> place, though, which means it can still happen asynchronously.  The same
> can be done for <input> file pickers.
>

I don't think we should do this.  The change would be invasive and could
delay firing a drop event indefinitely if the number of dropped files is
very huge.  Adding a drop event handler doesn't always mean the script is
interested in dropped file items (unlike <input> case).
If we keep it asynchronous the Web page could have more control over which
to instantiate when, e.g. it could only show the first few items upon drop
and then keep loading more items asynchronously only when necessary.

-- 
> Glenn Maynard
>
>

Received on Monday, 9 April 2012 01:35:51 UTC