Re: [XHR] Constructor behavior seems to be underdefined

On 3/31/12 2:15 AM, Cameron McCormack wrote:
> Boris Zbarsky:
>> What's the document associated with xhr? Is it w1.document,
>> w2.document, or window.document? The concept "the Window object for
>> which the XMLHttpRequest interface object was created" doesn't seem to
>> be defined anywhere....
>
> I don't have a <dfn> for it, but
> http://dev.w3.org/2006/webapi/WebIDL/#dfn-initial-object says that each
> global environment has a set of interface objects, and in
> http://dev.w3.org/2006/webapi/WebIDL/#es-platform-objects I use the term
> "associated with", but again not wrapped in a <dfn>.

Sure.  And the latter section says:

   It is the responsibility of specifications using Web IDL to state
   which global environment (or, by proxy, which global object) each
   platform object is associated with.

And my point is that the XHR spec doesn't state that.  Stating that the 
return value is associated with the same global environment as the 
constructor that was used to create it would do the trick.

On the other hand, maybe that should just be in WebIDL?  Are there use 
cases for constructors which create platform objects associated with a 
different global than the constructor itself?

-Boris

Received on Saturday, 31 March 2012 11:10:13 UTC