Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need OuterHTML polyfill for SVGElements on Edge and IE #2406

Closed
Twiknight opened this issue Feb 27, 2016 · 0 comments
Closed

Need OuterHTML polyfill for SVGElements on Edge and IE #2406

Twiknight opened this issue Feb 27, 2016 · 0 comments

Comments

@Twiknight
Copy link

FragmentFactory would break when working with svg Elements when it tries to cache an element on IE or MS-Edge due to lack of SVGElement.outerHTML support.

code: https://github.com/vuejs/vue/blob/dev/src/fragment/factory.js Line:32

As MS has already stopped adding feature to any version of IE, a possible solution might be a polyfill.

sample code (borrowed from http://stackoverflow.com/questions/12592417/outerhtml-of-an-svg-element/20559830#20559830):

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
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant