[Webkit-unassigned] [Bug 29703] Add a function to element to check whether it matches a CSS selector

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 5 08:34:07 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29703


Diego Perini <diego.perini at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |diego.perini at gmail.com




--- Comment #4 from Diego Perini <diego.perini at gmail.com>  2009-10-05 08:34:07 PDT ---

I believe there is a performance problem with the webkitMatchesSelector()
method as you are currently implementing. Proof is that my javascript
implementation is about 10/20% faster than native C++ implementation.

The method I use is to parse and compile the passed CSS selector strings in
ad-hoc javascript functions that can be reused for the rest of the page
lifetime, it is a pure bottom-up matcher, very fast.

The speed improvements will be really high for this method, I would like to
underline the fact that this new methods could be called thousands of time
during page interactions controlled by event delegation, so it seems important
to have the fastest outcome in speed from these methods.

Here is the test showing the described slowness:

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

Can be tested only with r48723 and above or a nightly Firefox.

I used r49078 in my tests.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list