From 4ef2e1bed1e61040bb4a642801dd3d1d30d692b7 Mon Sep 17 00:00:00 2001 From: Kevin Thomas Date: Sun, 3 Nov 2019 01:41:44 +0530 Subject: [PATCH] Fix #6909: Add a polyfill for SVGElement.prototype.outerHTML (#7886) * Add SVGElement.prototype.outerHTML polyfill for IE * add comment * fix indentation issues --- core/templates/dev/head/App.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/templates/dev/head/App.ts b/core/templates/dev/head/App.ts index 2d4dbcfb6f08..a5a78c017a38 100644 --- a/core/templates/dev/head/App.ts +++ b/core/templates/dev/head/App.ts @@ -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 + }); +}