-Manish Goregaokar

On Wed, Mar 16, 2016 at 1:37 AM, Manish Goregaokar <manishea...@gmail.com>
wrote:

>
> On Tue, Mar 15, 2016 at 3:13 PM, Zhen Zhang <izgz...@gmail.com> wrote:
>
>>
>> 1. About FileList API, It is said to be *at risk* to be replaced by
>> Array. <https://w3c.github.io/FileAPI/#filelist-section> Do we have to
>> take this into consideration?
>
>
> We still need to implement it, since the `files` attribute for form inputs
> is quite useful and the spec hasn't yet changed to make it an array. So no,
> not really, though if you'd like to not implement this and spend more time
> working on something else that's totally fine.
>
>
>> 2. Although I read nearly everything I can get from input element, form
>> element, Blob interface …, but I am still having a hard time trying to
>> understand *when a file on disk got read into the memory and used to
>> construct a Blob object*.
>>
>
> See https://w3c.github.io/FileAPI/#blob, especially the first three
> lines, as well as the first two lines and the blue box here
> <https://w3c.github.io/FileAPI/#file>. Basically, Blobs/Files can be
> in-memory blobs (our current Blob implementation handles this), but they
> can also refer to on-disk blobs which have not been read into memory. So,
> if a blob is to be constructed from on-disk data, the disk data is not read
> into memory at all, instead the blob will just contain an open file
> descriptor and a byte range, or something similar. If the file changes in
> the meantime, errors might be thrown
> <https://w3c.github.io/FileAPI/#ErrorAndException> (though I don't think
> this happens in practice except for permissions errors).
>
> You can test this by creating a simple HTML page with a file upload, and
> verifying that if the file changes in the filesystem, reading the File
> object (accessed via input_element.files[0], read via URL.createBlobURI)
> before and after the change will give different results even if the file
> object was not touched on the javascript side.
>
> (interestingly, blobs referring to on-disk data pin their `size` and
> `lastModified` fields to the values on creation, and this isn't updated at
> all even though an access of the data will get you up to date data)
>
>
>> 3. Drag & Drop <http://www.sitepoint.com/html5-file-drag-and-drop/> of
>> selecting files from file system — This looks related, but I don’t know if
>> we should pay more attention to it.
>>
>
> It's possible to do. However, this first needs regular dragdrop event
> support, which might not be as easy to implement. It additionally will need
> handling of file dragdrop in Glutin. This might take up a lot more time
> than we want it to.
>
>
>> 4. What is the idea behind using GenerationId
>> <https://doc.servo.org/script/dom/htmlformelement/struct.GenerationId.html>?
>> I am a bit confused because there is little doc about it.
>>
>
> It takes part in planned navigation
> <https://html.spec.whatwg.org/multipage/#planned-navigation>.  This
> basically handles cases where a form submit button is clicked once, but
> before the page navigates you quickly change one of the inputs and submit
> again. Each submission event is queued as part of "planned navigation", but
> the first submission event will have an outdated generation id (which is
> bumped every time the form is submitted), and only the second navigation
> event will happen.
>
> Thanks,
> -Manish Goregaokar
>
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to