mirror of
https://github.com/jquery/jquery.git
synced 2026-02-04 08:54:55 -05:00
Manipulation: Restrict the tbody search to child nodes
For performance, use a querySelectorAll path instead of Javascript iteration. http://codepen.io/anon/pen/vywJjx?editors=1010 Fixes gh-3439 Closes gh-3463
This commit is contained in:
@@ -47,11 +47,12 @@ var
|
||||
rscriptTypeMasked = /^true\/(.*)/,
|
||||
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
|
||||
|
||||
// Prefer a tbody over its parent table for containing new rows
|
||||
function manipulationTarget( elem, content ) {
|
||||
if ( jQuery.nodeName( elem, "table" ) &&
|
||||
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
|
||||
|
||||
return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
|
||||
return jQuery( ">tbody", elem )[ 0 ] || elem;
|
||||
}
|
||||
|
||||
return elem;
|
||||
|
||||
Reference in New Issue
Block a user