[webkit-dev] Isolated world tests

Oliver Hunt oliver at apple.com
Wed Jul 1 19:08:50 PDT 2009


On Jul 1, 2009, at 6:09 PM, Adam Barth wrote:

> On Wed, Jul 1, 2009 at 5:06 PM, Oliver Hunt<oliver at apple.com> wrote:
>> Extensions are not a feature of webkit, they are a feature of the  
>> browser,
>> so it seems strange that tests for them would exist in the webkit
>> repository.
>
> I should explain the feature in more detail.  The way things currently
> work is that DOM objects are in one-to-one coorespondence with
> JavaScript object wrappers.  With this new feature, there is a
> one-to-many coorespondence: each DOM object has a separate wrapper for
> each "world."  That way, when the page looks at a DOM object, it sees
> one view, but when the extension's script looks at the same DOM
> object, it see a different view.  This protects the extension's script
> from the page by preventing the page from doing sneaky things like
> redefining appendChild.
>
> The implementation of this feature exists in the WebCore bindings
> layer because the bindings layer has to understand that DOM objects
> might have multiple wrappers and the bindings layer has to select the
> right wrapper at the right time.  The goal of the tests is to ensure
> that the bindings layer always selects the right wrapper, etc.  The
> tests won't depend on the rest of the extension system in any way.
> For example, none of the extension APIs will be visible to the tests.
Given this apparently needs to exist in WebCore you will need to  
implement this feature for the JSC bindings as well.  This will also  
make it possible for it to be tested in the normal layout tests.

--Oliver



More information about the webkit-dev mailing list