Re: [css-selectors] :contains()

>Unfortunately, the implementation concerns are still relevant.  It
> seems to be quite difficult to implement efficiently in the face of
> dynamic updates.
As  I mentioned in the Mozilla request performance would heavily lie in the 
 usage of this selector, i.e. in how much content needs to be checked.
In  case of dynamic updates you would just need to check the added/modified 
 parts, which in most cases reduces the number of nodes to check  
dramatically.
A quick test by my own for marking negative numbers via  JavaScript using 
the latest stable releases of Firefox, Chrome and  Opera and reacting to 
'DOMNodeInserted' and 'DOMCharacterDataModified'  didn't remarkably slow 
down the page's performance when inserting or  updating 10.000 elements.
And doing this via JavaScript is slow. So I expect this to be much faster 
when done in native browser code.

> This is perfectly appropriate for use in a static query, like for
> querySelector(), though.  I think we should add this back to
> Selectors, but create a "dynamic" and "static" profile
Good idea. While this of course doesn't cover all cases, it would be at 
least a great enhancement to what we have now.

> with :contains() excluded from the dynamic profile.
Well, at least it would allow further discussion about this while 
developers already have something by using querySelector().

Sebastian        
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

Received on Thursday, 19 April 2012 04:23:40 UTC