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

2012-11-22 Thread Hallvord Reiar Michaelsen Steen

  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.



Thanks for responding. How?
 
 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-documentdocument/dfn or some such.



Ah, OK. We already have an instance property named referrer source, which is 
a somewhat obscure name but does reference the document. Can we just re-name 
referrer source = associated document or something, and set it in 
constructor, then use it for the not fully active check etc in open() ?


(Naming it referrer source re-uses terminology from CORS or Workers? I 
believe it will always refer to a document - in web worker mode the document 
associated with the script - and we can say use associated document as 
*override referrer source* when referencing CORS algorithm. IMO this is easier 
to understand in the context of this spec.)


  (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.



The precise definition of corner case is a hair I have no intention of 
helping you split :-)


-- 
Hallvord R. M. Steen
Core tester, Opera Software








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

2012-11-22 Thread Anne van Kesteren
On Thu, Nov 22, 2012 at 2:14 PM, Hallvord Reiar Michaelsen Steen
hallv...@opera.com wrote:
 You'd also need to check the JavaScript global environment.

 Thanks for responding. How?

Just like the spec does now?


 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-documentdocument/dfn or some such.

 Ah, OK. We already have an instance property named referrer source, which 
 is a somewhat obscure name but does reference the document. Can we just 
 re-name referrer source = associated document or something, and set it 
 in constructor, then use it for the not fully active check etc in open() ?

No, see below.


 (Naming it referrer source re-uses terminology from CORS or Workers? I 
 believe it will always refer to a document - in web worker mode the 
 document associated with the script - and we can say use associated document 
 as *override referrer source* when referencing CORS algorithm. IMO this is 
 easier to understand in the context of this spec.)

Referrer source is from HTML and can be a URL. I prefer to keep that
name consistent throughout all specifications.


-- 
http://annevankesteren.nl/



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

2012-11-22 Thread Anne van Kesteren
On Thu, Nov 22, 2012 at 2:25 PM, Anne van Kesteren ann...@annevk.nl wrote:
 [...]

It seemed easier to just make the change:

https://github.com/whatwg/xhr/commit/67244d007243de427ffe8367ed0a7c49d40be199


-- 
http://annevankesteren.nl/