On Wednesday 2010-01-06 19:51 -0500, Boris Zbarsky wrote:
> On 1/6/10 6:03 PM, L. David Baron wrote:
> >Maybe we could cache (somewhere?) the indices for the two elements
> >that needed them most recently?  That would let us do prev-sibling
> >optimizations and node-matches-multiple-selectors optimizations.
> 
> Most simply, the document could have a two-element cache.  Each
> element would have a pointer to an nsIContent and its indices.  When
> an nsIContent is destroyed or changes ownerDocument, it would check
> the cache and if one of the cached pointers is to itself it would
> clear the cache.
> 
> We'd probably also need to clear the cache any time there's a DOM
> mutation or something.
> 
> Seem ok?

Sounds fine to me, if that's easy to implement.

(I'd note that this would allow us to maintain all the different
indices that we have now.)

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to