ScriptInterpreter cache for domobjects (dangerous change?)

Maciej Stachowiak mjs@apple.com
Fri, 10 Jan 2003 13:53:47 -0800


On Friday, January 10, 2003, at 01:43  AM, David Faure wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Friday 10 January 2003 00:47, David Faure wrote:
>> Now the whole domObjectPerDocument stuff also makes sense to me :)
>
> I just had a thought about this:
> why not store the (KJS::DOMNode->Dom::Node) dict in the 
> KJS::DOMDocument,
> instead of storing a dict of dicts in the more global 
> scriptinterpreter?
>
> This sounds more object-oriented than the "dict of dicts" to me, and 
> possibly
> faster too, at least in the cases where we already have to find out the
> KJS::DOMDocument anyway. (In other cases it's equivalent, 2 dict 
> lookups
> in both cases).
>
> What do you think?

Well, there is also a DOM object cache that is *not* per document, 
however, for strictly temporary objects like events that we don't need 
to be kept alive for the duration of the document.

Other than that, the plan sounds fine to me. It's pretty hard to get at 
a dom node from JavaScript without ever creating the KJS DOMDocument 
wrapper.

  - Maciej