aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2016-01-27 12:19:29 -0500
committerTimmy Willison <timmywillisn@gmail.com>2016-01-27 12:19:41 -0500
commit412c5dfb0d6301dc0b3d7c98325cc9908dd97511 (patch)
treeb626dbfa0449399d9631de3ff93139d7c7265d51 /src
parentcff39574576766b6057c5363e4f38976b1680b92 (diff)
downloadjquery-412c5dfb0d6301dc0b3d7c98325cc9908dd97511.tar.gz
jquery-412c5dfb0d6301dc0b3d7c98325cc9908dd97511.zip
Revert "Manipulation: don't auto-insert tbody"
This reverts commit e984d1c79cc476062818e03df04a366baa13d197. Fixes gh-2861
Diffstat (limited to 'src')
-rw-r--r--src/manipulation.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index b65699bac..afd5091dd 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -38,14 +38,14 @@ var
rscriptTypeMasked = /^true\/(.*)/,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
+// Manipulating tables requires a tbody
function manipulationTarget( elem, content ) {
- if ( jQuery.nodeName( elem, "table" ) &&
- jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
- return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
- }
-
- return elem;
+ elem.getElementsByTagName( "tbody" )[ 0 ] ||
+ elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
+ elem;
}
// Replace/restore the type attribute of script elements for safe DOM manipulation