On Fri, 10 Dec 2010 03:24:38 +0100, Web Applications Working Group Issue
Tracker <[email protected]> wrote:
ISSUE-173 (ericu): terminal FileWriter progress events should be queued
[File API: Writer]
http://www.w3.org/2008/webapps/track/issues/173
Raised by: Eric Uhrhane
On product: File API: Writer
When a FileWriter successfully completes a write, currently it:
* dispatches a write event
* sets readyState to DONE
* dispatches a writeend event
If you want to start a new write, you can't do it in onwrite, since
readyState is still WRITING. Those events should be queued for
asynchronous delivery, so that readyState is DONE by the time they get
handled. If you set up a new write in onwrite, you'll still run the
risk of getting confused by the subsequent writeend from the previous
write, but that's detectable.
I'll have to look and see what other events should be marked as queued.
Why not queue a task that changes readyState and then dispatches write
followed by writeend, "synchronously" from the task. That is how a number
of things work in XMLHttpRequest.
--
Anne van Kesteren
http://annevankesteren.nl/