[webidl] XMLHttpRequest interface object

For environments where the global object is represented by the Window object XMLHttpRequest needs to be associated with a Document object for determining the origin and base URL. The problem is that the XMLHttpRequest interface object can be copied around, e.g.

  var x = frames[0].XMLHttpRequest

in that scenario x needs to be associated with Document object associated with frames[0]. (If frames[0] is later navigated the Document object would change, so it is important that this happens at this point.) To be clear, assuming a and b are distinct global objects, in

  a.x = a.XMLHttpRequest
  b.x = a.x

the XMLHttpRequest interface object in b.x has a pointer to the Document object associated with a. When the XMLHttpRequest constructor is invoked this pointer needs to be somehow copied to the constructed object.

What I need is some terminology in Web IDL to make this possible or a better solution to the problem.

(Most other APIs use the Document object associated with the script that is currently running for the base URL and origin and therefore do not have this complication.)


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Thursday, 30 April 2009 14:02:26 UTC