Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/test/acceptance/view_container_ref_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ describe('ViewContainerRef', () => {
expect(fixture.nativeElement.querySelector('svg').namespaceURI)
.toEqual('http://www.w3.org/2000/svg');
expect(fixture.nativeElement.querySelector('math').namespaceURI)
.toEqual('http://www.w3.org/1998/MathML/');
.toEqual('http://www.w3.org/1998/Math/MathML');
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/platform-browser/src/dom/dom_renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const NAMESPACE_URIS: {[ns: string]: string} = {
'xlink': 'http://www.w3.org/1999/xlink',
'xml': 'http://www.w3.org/XML/1998/namespace',
'xmlns': 'http://www.w3.org/2000/xmlns/',
'math': 'http://www.w3.org/1998/MathML/',
'math': 'http://www.w3.org/1998/Math/MathML',
};

const COMPONENT_REGEX = /%COMP%/g;
Expand Down
19 changes: 19 additions & 0 deletions packages/platform-browser/test/dom/dom_renderer_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,25 @@ describe('DefaultDomRendererV2', () => {
expect(await styleCount(fixture, '.emulated')).toBe(0);
});
});

describe('should support namespaces', () => {
it('should create SVG elements', () => {
expect(
document.createElementNS(NAMESPACE_URIS['svg'], 'math') instanceof SVGElement,
)
.toBeTrue();
});

it('should create MathML elements', () => {
// MathMLElement is fairly recent and doesn't exist on our Saucelabs test environments
if (typeof MathMLElement !== 'undefined') {
expect(
document.createElementNS(NAMESPACE_URIS['math'], 'math') instanceof MathMLElement,
)
.toBeTrue();
}
});
});
});


Expand Down