diff --git a/modules/@angular/core/test/linker/integration_spec.ts b/modules/@angular/core/test/linker/integration_spec.ts
index d99cccff77..c5cb00ff3e 100644
--- a/modules/@angular/core/test/linker/integration_spec.ts
+++ b/modules/@angular/core/test/linker/integration_spec.ts
@@ -2000,6 +2000,31 @@ function declareTests({useJit}: {useJit: boolean}) {
});
}));
+ it('should support foreignObjects with document fragments',
+ inject(
+ [TestComponentBuilder, AsyncTestCompleter],
+ (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
+ tcb.overrideView(
+ MyComp, new ViewMetadata({
+ template:
+ ''
+ }))
+ .createAsync(MyComp)
+ .then((fixture) => {
+ var el = fixture.debugElement.nativeElement;
+ var svg = getDOM().childNodes(el)[0];
+ var foreignObject = getDOM().childNodes(svg)[0];
+ var p = getDOM().childNodes(foreignObject)[0];
+ expect(getDOM().getProperty(svg, 'namespaceURI'))
+ .toEqual('http://www.w3.org/2000/svg');
+ expect(getDOM().getProperty(foreignObject, 'namespaceURI'))
+ .toEqual('http://www.w3.org/2000/svg');
+ expect(getDOM().getProperty(p, 'namespaceURI'))
+ .toEqual('http://www.w3.org/1999/xhtml');
+
+ async.done();
+ });
+ }));
});
describe('attributes', () => {
diff --git a/modules/@angular/platform-browser/src/dom/dom_renderer.ts b/modules/@angular/platform-browser/src/dom/dom_renderer.ts
index d2c83b0332..68d890ab46 100644
--- a/modules/@angular/platform-browser/src/dom/dom_renderer.ts
+++ b/modules/@angular/platform-browser/src/dom/dom_renderer.ts
@@ -23,7 +23,8 @@ import {camelCaseToDashCase} from './util';
const NAMESPACE_URIS = {
'xlink': 'http://www.w3.org/1999/xlink',
- 'svg': 'http://www.w3.org/2000/svg'
+ 'svg': 'http://www.w3.org/2000/svg',
+ 'xhtml': 'http://www.w3.org/1999/xhtml'
};
const TEMPLATE_COMMENT_TEXT = 'template bindings={}';
var TEMPLATE_BINDINGS_EXP = /^template bindings=(.*)$/g;