Skip to content

Commit

Permalink
Fix IE10 bug when cloning an object element without a parentNode
Browse files Browse the repository at this point in the history
  • Loading branch information
elijahmanor committed Jul 23, 2012
1 parent 09fc2c5 commit 039222f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/manipulation.js
Expand Up @@ -440,7 +440,13 @@ function cloneFixAttributes( src, dest ) {
// the proprietary classid attribute value (rather than the type
// attribute) to identify the type of content to display
if ( nodeName === "object" ) {
dest.outerHTML = src.outerHTML;
// The official HTML5 specs read that a NO_MODIFICATION_ALLOWED_ERR
// needs to be thrown if the parent is a Document
// http://html5.org/specs/dom-parsing.html#dom-element-outerhtml
// IE10 throws NoModificationAllowedError if parent node is null
if ( dest.parentNode ) {
dest.outerHTML = src.outerHTML;
}

// This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient.
Expand Down

0 comments on commit 039222f

Please sign in to comment.