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

Re: WebIDL and prototype chains

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 16 Jul 2009 14:58:13 -0700
Message-ID: <63df84f0907161458u156a5d5av973c54cd87ac7@mail.gmail.com>
To: Adam Barth <w3c@adambarth.com>
Cc: public-webapps <public-webapps@w3.org>, Maciej Stachowiak <mjs@apple.com>
On Thu, Jul 16, 2009 at 2:44 PM, Jonas Sicking<jonas@sicking.cc> wrote:
> On Thu, Jul 16, 2009 at 1:52 PM, Adam Barth<w3c@adambarth.com> wrote:
>> On Thu, Jul 16, 2009 at 1:13 PM, Jonas Sicking<jonas@sicking.cc> wrote:
>>> On Thu, Jul 16, 2009 at 10:45 AM, Adam Barth<w3c@adambarth.com> wrote:
>>>> 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?
>>>>
>>>> My best guess is that the prototype chain ought to connect to the
>>>> child's prototype
>>>
>>> Absolutely. |doc| will simply be pointing to the same object that
>>> frames[0].document does. So the prototype chain must be the same for
>>> both. And it's clear that when code inside frames[0] accesses that
>>> frames document it should have a protochain based on the globals in
>>> that frame.
>>
>> Firefox is much more consistent in this regard than Safari or Chrome:
>>
>> http://webblaze.org/abarth/tests/protoconfused/test1.html
>>
>> However, Firefox does not appear to attach function prototypes
>> correctly.  Maybe I should file a bug.  :)
>
> A bug would be great, yes :)

There's currently a bug in 3.5 which is why functions are failing. It
is fixed in the upcoming 3.5.1 release.

The only other non-"PASS" thing I see in firefox is .content, which
basically is the same as .top and so is working as expected. This is a
leftover from some old code which we should just remove.

So no bug necessary :)

/ Jonas
Received on Thursday, 16 July 2009 21:59:13 GMT

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