diff --git a/src/vendor/core/getMarkupWrap.js b/src/vendor/core/getMarkupWrap.js index 91dac43e19..2b21b275e1 100644 --- a/src/vendor/core/getMarkupWrap.js +++ b/src/vendor/core/getMarkupWrap.js @@ -32,23 +32,52 @@ var dummyNode = * * In IE8, certain elements cannot render alone, so wrap all elements ('*'). */ -var shouldWrap = {}; +var shouldWrap = { + // Force wrapping for SVG elements because if they get created inside a
, + // they will be initialized in the wrong namespace (and will not display). + 'circle': true, + 'g': true, + 'line': true, + 'path': true, + 'polyline': true, + 'rect': true, + 'text': true +}; + +var selectWrap = [1, '']; +var tableWrap = [1, '', '
']; +var trWrap = [3, '', '
']; + +var svgWrap = [1, '', '']; + var markupWrap = { + '*': [1, '?
', '
'], + 'area': [1, '', ''], - 'caption': [1, '', '
'], 'col': [2, '', '
'], - 'colgroup': [1, '', '
'], 'legend': [1, '
', '
'], - 'optgroup': [1, ''], - 'option': [1, ''], 'param': [1, '', ''], - 'tbody': [1, '', '
'], - 'td': [3, '', '
'], - 'tfoot': [1, '', '
'], - 'th': [3, '', '
'], - 'thead': [1, '', '
'], 'tr': [2, '', '
'], - '*': [1, '?
', '
'] + + 'optgroup': selectWrap, + 'option': selectWrap, + + 'caption': tableWrap, + 'colgroup': tableWrap, + 'tbody': tableWrap, + 'tfoot': tableWrap, + 'thead': tableWrap, + + 'td': trWrap, + 'th': trWrap, + + 'circle': svgWrap, + 'g': svgWrap, + 'line': svgWrap, + 'path': svgWrap, + 'polyline': svgWrap, + 'rect': svgWrap, + 'text': svgWrap }; /**