[webkit-dev] ExecState::thisObject()

Maciej Stachowiak mjs at apple.com
Fri Jul 10 18:29:05 PDT 2009


(Trimming Cc's since the relevant people are on webkit-dev anyway.)

On Jul 10, 2009, at 6:10 PM, Adam Barth wrote:

> On Fri, Jul 10, 2009 at 6:04 PM, Maciej Stachowiak<mjs at apple.com>  
> wrote:
>>
>> Is it definitely right for document.body to make a wrapper using  
>> prototypes
>> from the document's host window, rather than from the accessing  
>> function's
>> window? What do other browsers do?
>
> That's correct.  Other browser's get this case right.  Here are a
> couple test cases you might find interesting:
>
> http://webblaze.org/abarth/tests/protoconfused/test1.html
> http://webblaze.org/abarth/tests/protoconfused/test2.html
>
> The question is how to compute the correct wrapper context in all
> cases.  There are a bunch of approaches that cover 80% of the cases.
> The trick is finding an approach that works for 100% of the causes.

Well, for DOM Nodes you can almost always chase backpointers all the  
way up to the Document and from there to the Window, but this could be  
inefficient. And there's objects in the DOM that are not Nodes at all,  
and can't readily reach a Node. I will ask Sam and Geoff for their  
thoughts in person if they don't chime in on the list.

  - Maciej



More information about the webkit-dev mailing list