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

Re: XMLHttpRequest test suite suggestion

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Wed, 27 Sep 2006 20:14:04 +0200
To: "Anne van Kesteren" <annevk@opera.com>
Cc: "Web APIs WG (public)" <public-webapi@w3.org>
Message-ID: <mjclh25cnccu3dbn8rn3o08e2hehtna4m3@hive.bjoern.hoehrmann.de>

* Anne van Kesteren wrote:
>I think you saw that we changed this to be more compatible with Internet  
>Explorer. Basically, from the window you contruct the object in you take  
>the window.document.baseURI property and somehow store that on the object  
>to resolve URIs against.

The specification should say:

  * the constructor does not implement the internal [[Call]] property

  * the internal [[Construct]] method must determine and memorize the
    /XHR base resource identifier reference/, the value of the baseURI
    property of the document property of the global object associated
    with the caller of the method

  * the base resource identifier reference of the resource identifier
    reference specified by the url parameter of the open method is the
    XHR base resource identifier reference.

The first item addresses the problems Boris brought up in this thread,
if there is no [[Call]] you cannot do any of the following. If that is
not desired, the specification needs to define what [[Call]] is first.

  var x = XMLHttpRequest();
  var x = XMLHttpRequest.apply(...);
  var x = XMLHttpRequest.call(...);

The second item eases the task of adding the third, and the third de-
fines the base uri of the url parameter and by implication how to re-
solve relative resource identifier references, with the following ca-
veats:

  * I assume that window.document.baseURI is copied by value in the
    [[Construct]] method, that is, if it changes e.g. because you
    changed <base href=""> in some HTML document, navigated away from
    the current document, etc., the XHR base uri does not change; the
    text should state this explicitly.

  * document.baseURI can be null, with the implication that in that
    case, open() with a relative resource identifier cannot succeed;
    that would need to be pointed out somewhere.

  * document.baseURI and/or the result of applying the rel2abs algo-
    rithm in RFC 3986 may be "malformed" under some definition of the
    term. This has implications for "If the url parameter doesn't match
    the syntax defined in section 3.2.2 of [RFC2616] a SYNTAX_ERR must
    be raised" though since no relative reference matches that syntax,
    I am unsure which...
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Wednesday, 27 September 2006 18:14:18 GMT

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