Skip to content

Commit

Permalink
Fix oppia#6909: Add a polyfill for SVGElement.prototype.outerHTML (op…
Browse files Browse the repository at this point in the history
…pia#7886)

* Add SVGElement.prototype.outerHTML polyfill for IE

* add comment

* fix indentation issues
  • Loading branch information
Kevin Thomas authored and nithusha21 committed Nov 2, 2019
1 parent c60361e commit 4ef2e1b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/templates/dev/head/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,19 @@ if (!Array.prototype.fill) {
}
});
}


// Add SVGElement.prototype.outerHTML polyfill for IE
if (!('outerHTML' in SVGElement.prototype)) {
Object.defineProperty(SVGElement.prototype, 'outerHTML', {
get: function() {
var $node, $temp;
$temp = document.createElement('div');
$node = this.cloneNode(true);
$temp.appendChild($node);
return $temp.innerHTML;
},
enumerable: false,
configurable: true
});
}

0 comments on commit 4ef2e1b

Please sign in to comment.