W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: [XHR] Constructor behavior seems to be underdefined

From: Simon Pieters <simonp@opera.com>
Date: Mon, 02 Apr 2012 07:33:27 +0200
To: "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: "Cameron McCormack" <cam@mcc.id.au>, public-webapps@w3.org, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <op.wb4hp1w2idj3kv@simons-macbook-pro.local>
On Mon, 02 Apr 2012 07:20:27 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 4/2/12 12:58 AM, Simon Pieters wrote:
>> I believe some things in the HTML spec uses the entry script, at least
>> for the purpose of choosing origin or base URL. For instance: WebSocket,
>> Worker.
>
> Yes, but what do they use for the origin of the Worker object itself?

"Run a worker for the resulting absolute URL, with the script's browsing  
context of the script that invoked the method as the owner browsing  
context, with the script's document of the script that invoked the method  
as the owner document, with the origin of the entry script as the owner  
origin, and with worker global scope as the global scope."
http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#dom-worker

Well, that's origin for the worker *script*. The Worker *object* doesn't  
have an origin, I think. (SharedWorker also uses entry script.)

> I.e. if you create one and then one of the documents involved has  
> .domain set on it, what happens?

The document's effective script origin changes. The origin doesn't.  
Workers use origin, not effective script origin, so setting  
document.domain should have no effect on workers even if you set it before  
creating the worker.


> As far as I can tell, the HTML spec doesn't actually define this  
> behavior (and for that matter it doesn't seem to define the origin of  
> most objects, unless I'm missing something...)
>
> -Boris

http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin-0  
has rules for specific things.

-- 
Simon Pieters
Opera Software
Received on Monday, 2 April 2012 05:34:23 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC