Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Ensure innerHTML of src/dest clone nodes is correctly set. Fixes #10324
Signed-off-by: Rick Waldron waldron.rick@gmail.com <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Mar 23, 2012
1 parent 379a137 commit 2795a83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/manipulation.js
Expand Up @@ -435,6 +435,13 @@ function cloneFixAttributes( src, dest ) {
if ( nodeName === "object" ) {
dest.outerHTML = src.outerHTML;

// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
// If the src has innerHTML and the destination does not,
// copy the src.innerHTML into the dest.innerHTML. #10324
if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
dest.innerHTML = src.innerHTML;
}
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
Expand Down
1 change: 1 addition & 0 deletions test/index.html
Expand Up @@ -135,6 +135,7 @@ <h2 id="qunit-userAgent"></h2>
<param name="p1" value="x1" />
<param name="p2" value="x2" />
</object>
<object id="object2"><param name="test" value="test"></param></object>

<span id="台北Táiběi"></span>
<span id="台北" lang="中文"></span>
Expand Down

0 comments on commit 2795a83

Please sign in to comment.