Re: [fileapi] timing of readyState changes vs. events

On Fri, 02 Mar 2012 23:31:38 +0100, Eric U <> wrote:
> On Thu, Mar 1, 2012 at 11:09 PM, Anne van Kesteren <>  
> wrote:
>> Uhm. What you need to do is queue a task that changes the state and  
>> fires the event. You cannot just fire an event from asynchronous  
>> operations.
> Pardon my ignorance, but why not?  Is it because you have to define
> which task queue gets the operation?

Yeah, otherwise it would be undefined when the operation occurs relative  
to other asynchronous tasks, such as timeouts, events, and fetching.

> So would that mean that e.g. the current spec for readAsDataURL would
> have to queue steps 6 and 8-10?

Yeah. Actually, I think you want to queue a single task when the read is  
completed and then do 7, 8, 6, 9, 10 within that task (in that order, the  
current order seems wrong).

Anne van Kesteren

Received on Saturday, 3 March 2012 10:10:43 UTC