[FIX] qweb: support of svg in t-raw

Before this commit, t-raw a string containing `<svg>` did not display
the svg element. This was because of missing namespace in vnode's data.

Now, `vdom.addNS` is called to add the svg namespace when necessary.
This commit is contained in:
Michael Mattiello (mcm)
2020-05-25 13:49:21 +02:00
committed by Géry Debongnie
parent 85318b3ae6
commit 9fd8315c53
2 changed files with 13 additions and 2 deletions
+7
View File
@@ -1105,4 +1105,11 @@ describe("html to vdom", function () {
elm = patch(vnode0, nodeList[0]).elm;
expect(elm.outerHTML).toEqual(`<span a="1" b="2">abc<div>1</div></span>`);
});
test("svg", function () {
const nodeList = htmlToVDOM(`<svg></svg>`);
expect(nodeList).toHaveLength(1);
elm = patch(vnode0, nodeList[0]).elm;
expect(elm).toBeInstanceOf(SVGSVGElement);
});
});