W3C home > Mailing lists > Public > public-webapi@w3.org > April 2006

Re: ISSUE-58: XMLHttpRequest.abort() should just reset the object

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 05 Apr 2006 13:56:28 -0700
Message-ID: <44342EFC.5040705@sicking.cc>
To: Christophe Jolif <cjolif@ilog.fr>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>

Christophe Jolif wrote:
> 
> Hi everyone,
> 
> There is something I still don't get with abort and XHR state. We saw 
> that we think the state after an abort must be 4 == loaded. Given that, 
> as a listener on the request, how can I know if a request has been 
> aborted or has been loaded? As far as I can see, I can't. And it seems 
> to me like an important missing feature.

If that is indeed true we need to fix it I agree. Is there a sensible 
value we could set .status to for example?

> If I'm not missing something, I really think this 4 state is misleading 
> as it doesn't necessarly mean "loaded" as the current spec is stating. 
> It means either "loaded" or "aborted".
> 
> I understand that we currently try to map to actual implementations and 
> so we can't do much about it however we should try not to forbid future 
> improvements in that area. So we should consider how future improvements 
> could fit with the spec we are writing.

The reason is that there might be content out there that depends on it.

> If we say abort() just reset the object (we don't talk about state 
> change event), then we will have the chance in the future to add a new 
> ABORTED state.
> 
> If we say we go to 4. Then no chance to add that.

Even if we say 'just reset' there is no way to add it later IMHO. I 
don't see this as a problem either way though since we shouldn't design 
the next revision around readystatechange but rather around other 
solutions. readystatechange is a pretty poor design anyway.

> In that case I would strongly argue that 4 description must be changed 
> from LOADED to something like COMPLETED (described as loading happened 
> or object has been aborted). And then we might add one day an 
> isAborted() method or something like that on XHR to make the distinction 
> between the two COMPLETED sub-state.

That might not be a bad idea. Though hopefully .status could be that 
distiction.

/ Jonas
Received on Wednesday, 5 April 2006 20:56:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT