W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [XHR] Associating XHR instances with documents - clarify spec statement in 4.6.1

From: Anne van Kesteren <annevk@annevk.nl>
Date: Thu, 22 Nov 2012 13:57:37 +0100
Message-ID: <CADnb78hhhQehnJaSer53yLJJNp=6yGMCFbfOng90RGjvqg-HAw@mail.gmail.com>
To: Hallvord Reiar Michaelsen Steen <hallvord@opera.com>
Cc: public-webapps@w3.org, Julian Aubourg <j@ubourg.net>, Jungkee Song <jungkee.song@samsung.com>
On Thu, Nov 22, 2012 at 12:34 PM, Hallvord Reiar Michaelsen Steen
<hallvord@opera.com> wrote:
> This is quite convoluted, but precise. The last "object" could perhaps be "instance" to make it clearer? However, my proposal is to move this text to the constructor section (4.2 Constructors), for example as a new 3rd step in the first numbered list, and simplify it to read:
> "Let document be the document associated with the global object of the XMLHttpRequest interface object."

You'd also need to check the JavaScript global environment.

> Anne responded:
>> You cannot just move it to the constructor without introducing some
>> other XHR-wide variable.
> Sorry Anne, you could probably edit the XHR spec asleep...

What I mean is that <var>-variables are scoped to the algorithm they
are used in. So you need to re-introduce <dfn
title=concept-XMLHttpRequest-document>document</dfn> or some such.

>>> I also believe the implementation difference can not be observed from JS.
>> Not if you make the same requirements, no...
> I believe both the old text and the proposal would end up with *document* referencing the same document, even in corner cases. If I'm missing something please explain, thanks.

My comment meant to indicate that if you move requirements around you
will not have a difference. However, if you remove requirements as
done in http://dvcs.w3.org/hg/xhr/rev/fe301b5c5917 (later reverted)
you will.

> (Just for the record, the corner cases we need to consider here include stuff like
> var xhr=new iframe.contentWindow.XMLHttpRequest()

This is not a corner case in actual content. If it was we would made
it work the same way it does in Workers.

Received on Thursday, 22 November 2012 12:58:05 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:50 UTC