[webkit-dev] Question about Constructors in WebKit JS Bindings
atwilson at google.com
Tue Jun 23 15:25:50 PDT 2009
Following up after an IRC chat with Ian - for Workers it is his intention to
always grab the context from the currently executing script, not from the
window the constructor originated from.
So for Workers, using the more succinct implementation is actually correct -
in his words "all Worker constructors are created equal".
On Tue, Jun 23, 2009 at 2:20 PM, Drew Wilson <atwilson at google.com> wrote:
> On Tue, Jun 23, 2009 at 11:49 AM, Adam Barth <abarth at webkit.org> wrote:
>> > I am not even sure all of these should have the same behavior,
>> > however. For instance, as I read the Web Workers spec, the lexical
>> > object may be correct thing to use for the Worker constructor.
>> I looked at the spec briefly. What leads you to think that? It's
>> probably a bug in the spec.
> Section 4.5 of the web workers spec reads:
> 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.
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev