Skip to content

Need OuterHTML polyfill for SVGElements on Edge and IE #2406

@Twiknight

Description

@Twiknight

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
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions