W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2010

Ordering of error/load and loadend events for FileReader

From: Jian Li <jianli@chromium.org>
Date: Thu, 8 Apr 2010 17:51:53 -0700
Message-ID: <z2oa95818c31004081751naa803fccm71e2f84fef8f183c@mail.gmail.com>
To: Web Applications Working Group WG <public-webapps@w3.org>
The spec says that loadend event should be dispatched before error event
when an error occurs during file read:

2. If an error occurs during file read, set readyState to DONE and set
result to null. Proceed to the error steps below.
    1. Dispatch a progress event called loadend.
    2. Dispatch a progress event called error. Set the error attribute; on
getting, the error attribute MUST be a a FileError object with a valid error
code that indicates the kind of file error that has occurred.
    3. Terminate this overall set of steps.


However, it is said that loadend event should be dispatched after load event
when the file data has been completely read.

When this specification says to make progress notifications for a read
method, the following steps MUST be followed:
1. While the read method is processing, queue a task to dispatch a progress
event called progress about every 50ms or for every byte read into memory,
whichever is least frequent.
2. When the data from the file or fileBlob has been completely read into
memory, queue a task to dispatch a progress event called load
3. When the data from the file or fileBlob has been completely read into
memory, queue a task to dispatch a progress event called loadend


The ordering of error/load and loadend event seem to be inconsistent. Could
we move the dispatch of loadend event after error event?
Received on Friday, 9 April 2010 00:52:24 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:38 GMT