W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2012

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

From: Kinuko Yasuda <kinuko@chromium.org>
Date: Mon, 9 Apr 2012 17:35:51 +0900
Message-ID: <CAMWgRNZyCSRJ4GHKm=o=u27L9bGsAv9=uC2sZ4iEhh5J3TSAiQ@mail.gmail.com>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:07 GMT