fix(render): create svg elements with the right namespace
Temporary fix for #4506 Closes #4949
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}));
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user