fix(render): create svg elements with the right namespace

Temporary fix for #4506
Closes #4949
This commit is contained in:
Tobias Bosch
2015-10-27 13:16:27 -07:00
parent 27dbd2ded4
commit ac52bfd80f
7 changed files with 147 additions and 5 deletions
@@ -1741,6 +1741,29 @@ export function main() {
});
}));
});
if (DOM.supportsDOMEvents()) {
describe('svg', () => {
it('should support svg elements',
inject([TestComponentBuilder, AsyncTestCompleter],
(tcb: TestComponentBuilder, async) => {
tcb.overrideView(MyComp, new ViewMetadata({template: '<svg><g></g></svg>'}))
.createAsync(MyComp)
.then((rootTC) => {
var el = rootTC.debugElement.nativeElement;
var svg = DOM.childNodes(el)[0];
var g = DOM.childNodes(svg)[0];
expect(DOM.getProperty(<Element>svg, 'namespaceURI'))
.toEqual('http://www.w3.org/2000/svg');
expect(DOM.getProperty(<Element>g, 'namespaceURI'))
.toEqual('http://www.w3.org/2000/svg');
async.done();
});
}));
});
}
});
}