[v13.2.0] Renderer2 createElement method ignores namespace.
See original GitHub issueWhich @angular/* package(s) are the source of the bug?
core, platform-browser
Is this a regression?
Yes
Description
In v13.2.0, Renderer2 creates an element without namespace even if namespace has been specified. It doesn’t failed with error, however further usage of such element becomes unpredictable. For example, the following code tries to create an svg and set position style:
const svg = this._renderer.createElement('svg', 'http://www.w3.org/2000/svg');
this._renderer.appendChild(hostElement, svg);
this._renderer.setStyle(svg, 'position', 'fixed');
The error occurs in the last line, since svg element has been created incorrectly.
After quick investigation, I found that the following line has been changed: https://github.com/angular/angular/blob/13.2.0/packages/platform-browser/src/dom/dom_renderer.ts#L148 This change was introduced in v13.2.0, it works fine in v13.1.3
As I understood, NAMESPACE_URIS
contains namespace shortcuts, but what about specifying “full” namespace or any other namespace that is not in NAMESPACE_URIS
?
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
ERROR TypeError: Cannot set properties of undefined (setting 'width')
at DefaultDomRenderer2.setStyle (platform-browser.mjs:618:13)
at AnimationRenderer.setStyle (animations.mjs:282:23)
Please provide the environment you discovered this bug in (run ng version
)
Angular CLI: 13.2.0
Node: 16.13.1
Package Manager: npm 8.1.2
OS: win32 x64
Angular: 13.2.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... elements, forms, language-service, localize, material
... material-moment-adapter, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1302.0
@angular-devkit/build-angular 13.2.0
@angular-devkit/core 13.2.0
@angular-devkit/schematics 13.2.0
@schematics/angular 13.2.0
ng-packagr 13.2.0
rxjs 6.6.7
typescript 4.5.5
Anything else?
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
This issue is resolved by #44914 and the change will be available in v13.2.1 release.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.