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

RE: [FileAPI] Result of calling MultipleReads on FileReader

From: Adrian Bateman <adrianba@microsoft.com>
Date: Fri, 15 Apr 2011 18:57:42 +0000
To: Jonas Sicking <jonas@sicking.cc>
CC: Eric Uhrhane <ericu@google.com>, "arun@mozilla.com" <arun@mozilla.com>, "Web Applications Working Group WG (public-webapps@w3.org)" <public-webapps@w3.org>, Arun Ranganathan <aranganathan@mozilla.com>
Message-ID: <104E6B5B6535E849970CDFBB1C5216EB3D33A0AB@TK5EX14MBXC136.redmond.corp.microsoft.com>
On Tuesday, April 12, 2011 12:08 PM, Jonas Sicking wrote:
> FileReader is extremely similar to XMLHttpRequest. The main difference
> is in how you initiate the request (.open/.send vs. .readAsX). This
> similarity is even getting stronger now that XHR gets .result.
> 
> So I think there are good reasons to sticking to XMLHttpRequest here too.
> 
> Note that no "error" events are fired by XMLHttpRequest. Just an
> "abort" event. So "error" is still reserved for actual reading errors
> whereas "abort" will fire for script-initiated aborts.
> 
> I agree that calling .readAsX multiple times could be an indication of
> developer bugs and as such could throw an exception. However I think
> given the precedence set by XMLHttpRequest it could just as well mean
> that a new resource is now the one that the author is interested in
> reading.

With this in mind, I don't personally have a strong feeling either way
between having to call abort() explicitly or having readAsXXX implicitly
call abort(). I've discussed it with others at Microsoft this week and the
consensus here is that the defensive exception is better and that developers
should have to call abort() if they want to abandon the current operation.
I think we could live with either but right now we're planning for throwing
the exception. We'd like to make a decision one way or the other pretty soon.

Cheers,

Adrian.
Received on Friday, 15 April 2011 18:58:12 GMT

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