aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorArne de Bree <arne@bukkie.nl>2012-02-09 20:48:21 -0500
committerDave Methvin <dave.methvin@gmail.com>2012-02-09 20:48:21 -0500
commitbf7a4df22abcea10cf8f97eb31b5fa989fb4daf5 (patch)
tree19e51a5073fc4015a717ecd80994d94e60cb65a2 /src/manipulation.js
parent96bb57d4ef49a0ab8f753108cc016fa215e237f4 (diff)
downloadjquery-bf7a4df22abcea10cf8f97eb31b5fa989fb4daf5.tar.gz
jquery-bf7a4df22abcea10cf8f97eb31b5fa989fb4daf5.zip
Fix #11291. Always clone XML docs with a genuine .cloneNode().
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 52a869dae..b295f4b7e 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -24,7 +24,7 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca
rhtml = /<|&#?\w+;/,
rnoInnerhtml = /<(?:script|style)/i,
rnocache = /<(?:script|object|embed|option|style)/i,
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
@@ -461,7 +461,7 @@ function cloneFixAttributes( src, dest ) {
// Event data gets referenced instead of copied if the expando
// gets copied too
dest.removeAttribute( jQuery.expando );
-
+
// Clear flags for bubbling special change/submit events, they must
// be reattached when the newly cloned events are first activated
dest.removeAttribute( "_submit_attached" );
@@ -590,7 +590,7 @@ jQuery.extend({
destElements,
i,
// IE<=8 does not properly clone detached, unknown element nodes
- clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
+ clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
elem.cloneNode( true ) :
shimCloneNode( elem );