Comment #11 on issue 1123 by diego.perini: Allow Function in valija?
http://code.google.com/p/google-caja/issues/detail?id=1123

erights,
my NWMatcher selector engine is quite old, it was firstly written in 2007 to help in the implementation of fast event delegation/traversing, it is basically a pure
javascript bottom-up matcher, current development is here:

   http://github.com/dperini/nwmatcher/

I prefer to compare them from a standard CSS3 specifications point of view rather than on speed. In NWMatcher there is a match( element, selector ) method that is used to match a single element vs. a selector string expression. This is very useful for
event delegation and for traversing the DOM (up/down/next/previous).

Here you can find a test example that show the speed of the match() method compared
to other libraries and to native browsers methods:

   http://dl.getdropbox.com/u/598365/matchspeed/matchspeed-custom.html

Newer Firefox and Safari nightly snapshots already contains methods equivalent to my
own match() methods:

  webkitMatchesSelector( element, selector );
  mozMatchesSelector( element, selector);

so we finally have a way to test the results vs. some native implementations.

I filed a bug with browsers vendors (Webkit) to let them know there is some
under-optimization in their current implementations.

Selector strings are converted to ad-hoc javascript resolver functions using the "new
Function()" constructor and save for reuse for the entire page lifetime.

This makes things quite speedy, unfortunately this does not allow the code to be run
in Caja/Valija environments, that was the main point here.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply via email to