mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
To test whether an element in the event bubbling chain matches a selector, we now modify the selector to include an ID for the element in question (which we assign if it doesn't have one), so we search for one node rather than listing and checking all nodes that match the selector! This makes a huge speed difference in the jsparse demo, which binds a global handler over a big DOM tree. The new domutils are matchesSelector(element, contextNode, selector) and matchesSelectorClipped(element, contextNode, selector, clipStart, clipEnd). Note: Eventually make the args more like this W3C working draft: http://www.w3.org/TR/selectors-api2/#matches