-
Notifications
You must be signed in to change notification settings - Fork 20.5k
Simplification of manipulationTarget helper
#2021
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
8fb9650 to
3a7d0af
Compare
test/unit/manipulation.js
Outdated
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.
You can either say "when it is present" or just "when present" for the descriptions on these.
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.
Fixed
For the simple and document fragment cases
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.
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.
I guess you missed my comment
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.
Indeed I forgot you put in that much detail!
According to html5 spec, tbody could be ommited but will be auto-inserted if table has td, th, tr tags.
If so should we ensure that with a test? Is it true for Android 2.x for example?
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.
I will complete my previous comment there.
Basically, you can't use innerHTML property on the table element (only on tbody) in IE6-9 (i suppose at one point innerHTML might have been used like that), plus, in IE6-7 it would protect you from the case like this -
$( "<table/>" ).append( "<tr>...</tr>" );No need for that now.
Is it true for Android 2.x for example?
There could be situation when table exist with rows and columns without tbody parent - when you use DOM-manipulation methods. But it doesn't matter, since table should be rendered correctly with or without tbody in modern browsers.
Search for tbody though, still necessary, since if user created table through html serialization (like through innerHTML property or defining it directly in html) will create tbody element even if it was omitted, so in order to correctly and consistently manipulate that table, we still need to search for it.
And yeah, i checked it in Android 2.3... and IE6-7, Opera 9, Firefox 3.6 (just to understand genesis of that code-path). They all follow that logic.
|
How could I ever doubt @markelog, this LTGM. 😺 |
No description provided.