RE: <Further LC Followup from IE> RE: Potential bugs identified in XHR LC Test Suite

The issue of return "null or an exception" is simply a compromise here. IE would throw an exception for state violations. Accessing responseXML before open() is a state violation so it would trigger exception. Other browsers may return null in such situation.  In order to accommodate all browsers, the spec would have to be rewritten in some way.

We would certainly love to have the spec change to "MUST throw INVALID_STATE_ERR exception", which is consistent with other INVALID_STATE_ERR cases.  For instance, the spec says if send() is called before OPENED, it should trigger  INVALID_STATE_ERR exception. Another example is that user agent must raise INVALID_STATE_ERR if "status" is not available. responseText and responseXML are the outlier in the spec.


Thanks!
Zhenbin


-----Original Message-----
From: Jonas Sicking [mailto:jonas@sicking.cc]
Sent: Thursday, June 12, 2008 11:20 AM
To: Sunava Dutta
Cc: Web API public; IE8 Core AJAX SWAT Team; public-webapps@w3.org
Subject: Re: <Further LC Followup from IE> RE: Potential bugs identified in XHR LC Test Suite

> _http://tc.labs.opera.com/apis/XMLHttpRequest/responseXML/001.htm_
>
> The test is expecting us to return NULL in case open() has not been
> called.  We throw an exception in IE.   I'd pre fer if the spec says
> *"*MUST return null OR an exception*"* otherwise I fear sites today will
> be broken.

How would that help sites that expect an exception, since it would still
be conforming for the UA to return null? If anything, your proposal
seems to make it harder for sites to code against the spec.

/ Jonas

Received on Monday, 16 June 2008 20:12:56 UTC