From 51725cff5e2b026088c3afac4c10cbe1e1be3aa7 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 4 Nov 2016 20:51:17 -0400 Subject: [PATCH] fix SVG foreignObject (fix #4122) --- src/core/vdom/create-element.js | 3 ++- src/platforms/web/util/element.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/vdom/create-element.js b/src/core/vdom/create-element.js index f6d47a26..a3157f31 100644 --- a/src/core/vdom/create-element.js +++ b/src/core/vdom/create-element.js @@ -55,8 +55,9 @@ function _createElement ( // unknown or unlisted namespaced elements // check at runtime because it may get assigned a namespace when its // parent normalizes children + const childNs = tag === 'foreignObject' ? 'xhtml' : ns return new VNode( - tag, data, normalizeChildren(children, ns), + tag, data, normalizeChildren(children, childNs), undefined, undefined, ns, context ) } diff --git a/src/platforms/web/util/element.js b/src/platforms/web/util/element.js index cb6e622c..618ee98f 100644 --- a/src/platforms/web/util/element.js +++ b/src/platforms/web/util/element.js @@ -5,7 +5,8 @@ import { makeMap } from 'shared/util' export const namespaceMap = { svg: 'http://www.w3.org/2000/svg', - math: 'http://www.w3.org/1998/Math/MathML' + math: 'http://www.w3.org/1998/Math/MathML', + xhtml: 'http://www.w3.org/1999/xhtm' } export const isHTMLTag = makeMap(