-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Manipulation: Restrict the tbody search to child nodes #3463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@gibson042, thanks for your PR! By analyzing the history of the files in this pull request, we identified @markelog, @timmywil and @rwaldron to be potential reviewers. |
src/manipulation.js
Outdated
| jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { | ||
|
|
||
| return elem.getElementsByTagName( "tbody" )[ 0 ] || elem; | ||
| return jQuery.filter( "tbody", elem.childNodes )[ 0 ] || elem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clever, maybe a comment though? You know I like comments :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, what are you looking for that's not covered by the new function comment? Should I update it to something like "New rows for a table belong in its child tbody when one is present", or move it above this line, or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the code itself looks pretty clear and definitely has the benefit of being more correct. Funny that nobody thought about nested tables for this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only comes up when the target doesn't have a tbody but a descendant does, or when such a descendant is in the thead, both of which I imagine are rare. And the logic itself goes waaaaaay back.
|
@timmywil just FYI (in case you didn't know that): you can now approve pull requests, it seems a bit better then "reaction" :) |
Exercise a code path that uses querySelectorAll instead of Javascript iteration. http://codepen.io/anon/pen/vywJjx?editors=1010
Fixes gh-3439