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

[webidl] XMLHttpRequest interface object

From: Anne van Kesteren <annevk@opera.com>
Date: Thu, 30 Apr 2009 16:01:45 +0200
To: "WebApps WG" <public-webapps@w3.org>
Message-ID: <op.us7c87la64w2qv@annevk-t60>
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 GMT

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