Commit 039222f8 authored by Elijah Manor's avatar Elijah Manor

Fix IE10 bug when cloning an object element without a parentNode

parent 09fc2c50
...@@ -440,7 +440,13 @@ function cloneFixAttributes( src, dest ) { ...@@ -440,7 +440,13 @@ function cloneFixAttributes( src, dest ) {
// the proprietary classid attribute value (rather than the type // the proprietary classid attribute value (rather than the type
// attribute) to identify the type of content to display // attribute) to identify the type of content to display
if ( nodeName === "object" ) { if ( nodeName === "object" ) {
// 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; dest.outerHTML = src.outerHTML;
}
// This path appears unavoidable for IE9. When cloning an object // This path appears unavoidable for IE9. When cloning an object
// element in IE9, the outerHTML strategy above is not sufficient. // element in IE9, the outerHTML strategy above is not sufficient.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment