W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

WebIDL and prototype chains

From: Adam Barth <w3c@adambarth.com>
Date: Thu, 16 Jul 2009 10:45:55 -0700
Message-ID: <7789133a0907161045m61397e0csf0c05ebc20f5f4f6@mail.gmail.com>
To: public-webapps <public-webapps@w3.org>
Cc: Maciej Stachowiak <mjs@apple.com>
When a browser creates an instance of a DOM object defined by an
WebIDL interface, the browser must choose where to connect it's
prototype chain.  For example, consider this case (where frames[0] is
a same-origin child frame):

var doc = frames[0].document;

1) To which global object's prototypes ought |doc| connect to, the
parent frame running the script or the child frame from which we
obtained the document?

2) Where is this behavior specified?  If the behavior is currently not
specified, which spec ought to contain the requirements?

My best guess is that the prototype chain ought to connect to the
child's prototype (because the document "is owned by" the child frame)
and that the WebIDL spec ought to include this requirement (because
WebIDL explains how to reify abstract DOM interfaces in ECMAScript).

Thoughts?

Adam
Received on Thursday, 16 July 2009 17:46:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:32 GMT