<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 23, 2009, at 3:37 PM, Drew Wilson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Not sure. There's language in the WebIDL spec around prototype objects of interface objects, but I'm not sure how window.Worker.prototype is intended to relate to new&nbsp;Worker().prototype&nbsp;(if&nbsp;at&nbsp;all),&nbsp;based&nbsp;on&nbsp;my&nbsp;10&nbsp;minutes&nbsp;of&nbsp;scanning&nbsp;specs.<div> <div><br></div></div></blockquote><div><br></div><div>window.Worker.prototype should be the initial value of new Worker().__proto__ (or equivalently, of the internal [[Prototype]] property). This should be taken from the constructor object actually used, I think, but there is no reason to store a global object or document reference to achieve this effect.</div><div><br></div><div>&nbsp;- Maciej</div><br><blockquote type="cite"><div><div>-atw<br><br><div class="gmail_quote">On Tue, Jun 23, 2009 at 3:26 PM, Adam Barth <span dir="ltr">&lt;<a href="mailto:abarth@webkit.org">abarth@webkit.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> 2009/6/23 Drew Wilson &lt;<a href="mailto:atwilson@google.com">atwilson@google.com</a>&gt;:<br> <div><div></div><div class="h5">&gt; On Tue, Jun 23, 2009 at 11:49 AM, Adam Barth &lt;<a href="mailto:abarth@webkit.org">abarth@webkit.org</a>&gt; wrote:<br> &gt;&gt;<br> &gt;&gt; &gt; I am not even sure all of these should have the same behavior,<br> &gt;&gt; &gt; however. For instance, as I read the Web Workers spec, the lexical global<br> &gt;&gt; &gt; object may be correct thing to use for the Worker constructor.<br> &gt;&gt;<br> &gt;&gt; I looked at the spec briefly. &nbsp;What leads you to think that? &nbsp;It's<br> &gt;&gt; probably a bug in the spec.<br> &gt;<br> &gt; Section 4.5 of the web workers spec reads:<br> &gt;&gt;<br> &gt;&gt; Given a script's global scope o when creating or obtaining a worker, the list of relevant Document objects to add depends on the type of o. If o is a WorkerGlobalScope object (i.e. if we are creating a nested worker), then the relevant Documents are the Documents that are in o's own list of the worker's Documents. Otherwise, o is a Window object, and the relevant Document is just the Document that is the active document of the Window object o.<br> &gt;<br> &gt; So it seems to imply that parent document for a worker is derived from the currently executing script's global scope. I'll ping IanH about this - it may not be what he intended.<br> <br> </div></div>There's another question, which is where does the prototype chain of<br> the JS object you get out of the worker constructor point? &nbsp;It might<br> not have anything to do with this Document calculation.<br> <font color="#888888"><br> Adam<br> </font></blockquote></div><br></div></div></blockquote></div><br></body></html>