enhancing "closest" delegation

enhancing "closest" delegation


I propose adding a second argument to the "closest" method that will
act as the end point for searching up the document tree. It can behave
just like the "context" argument in the jQuery mother function. It
will optimize the performance of a common pattern I have seen in my
own code since the addition o this method.
$("table").bind("click",function( event ){
var $td = $( event.target ).closest("td", this );
});
Because I bound the handler to "table" I do not want to search an
higher than that element for selector matches. Furthermore, if there
was a selector match outside of the containing element, it could
potentially and accidentally be matched.
http://dev.jquery.com/ticket/4945
Any thoughts?