fix(ivy): incorrectly validating html foreign objects inside svg (#34178)

Fixes ngtsc incorrectly logging an unknown element diagnostic for HTML elements that are inside an SVG `foreignObject` with the `xhtml` namespace.

Fixes #34171.

PR Close #34178
This commit is contained in:
crisbeto
2019-12-02 20:18:31 +01:00
committed by Miško Hevery
parent 539d8f09e0
commit e6909bda89
3 changed files with 85 additions and 5 deletions

View File

@ -311,5 +311,30 @@ describe('NgModule', () => {
}).not.toThrow();
});
it('should not throw for HTML elements inside an SVG foreignObject', () => {
@Component({
template: `
<svg>
<svg:foreignObject>
<xhtml:div>Hello</xhtml:div>
</svg:foreignObject>
</svg>
`,
})
class MyComp {
}
@NgModule({declarations: [MyComp]})
class MyModule {
}
TestBed.configureTestingModule({imports: [MyModule]});
expect(() => {
const fixture = TestBed.createComponent(MyComp);
fixture.detectChanges();
}).not.toThrow();
});
});
});