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:
@ -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();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user