https://github.com/angular/angular
Revision 5626b34264d8893fece74d30db4920a685f3b17f authored by Andrew Scott on 20 January 2022, 20:57:18 UTC, committed by Andrew Kushnir on 21 January 2022, 19:19:31 UTC
`Renderer2` APIs expect to be called with the namespace name rather than
the namespace URI. Rather than passing around the URI and having to
account for different calling contexts, this change consistently uses
the namespace short names.

Importantly, the URI was only used in `component_ref.ts` `create`
(because `getNamespace returned the URIs`) and `createElementNode` in
`node_manipulation.ts` (because `getNamespaceUri` also used the URIs).
In contrast, attributes would use the _short names instead of URIs_
(see `setUpAttributes` in `attrs_utils.ts`). These names are pulled
directly from the attribute, i.e. `xhtml:href` and not converted to URI.
This dichotomy is confusing and unnecessary. The change here aligns the two
approaches in order to provide consistently throughout the system.

This relates to #44766 because the `createElementNode` was calling the
`AnimationRenderer.createElement` which delegates to the
`ServerRenderer`, which in turn was only set up to expect short names.
As a result, the `NAMESPACE_URIS` lookup failed and `Domino` created
the `svg` as a regular `Element` which does not have a `styles`
property.

resolves #44766

PR Close #44766
1 parent 1671212
History
Tip revision: 5626b34264d8893fece74d30db4920a685f3b17f authored by Andrew Scott on 20 January 2022, 20:57:18 UTC
fix(core): consistently use namespace short name rather than URI (#44766)
Tip revision: 5626b34
File Mode Size
.circleci
.devcontainer
.github
.husky
.ng-dev
.vscode
.yarn
aio
docs
goldens
integration
modules
packages
scripts
third_party
tools
.bazelignore -rw-r--r-- 2.8 KB
.bazelrc -rw-r--r-- 6.7 KB
.bazelversion -rw-r--r-- 6 bytes
.clang-format -rw-r--r-- 73 bytes
.editorconfig -rw-r--r-- 245 bytes
.gitattributes -rw-r--r-- 240 bytes
.gitignore -rw-r--r-- 797 bytes
.gitmessage -rw-r--r-- 7.2 KB
.mailmap -rw-r--r-- 51 bytes
.npmrc -rw-r--r-- 21 bytes
.nvmrc -rw-r--r-- 8 bytes
.prettierrc -rw-r--r-- 157 bytes
.pullapprove.yml -rw-r--r-- 47.7 KB
.yarnrc -rw-r--r-- 130 bytes
BUILD.bazel -rw-r--r-- 2.0 KB
CHANGELOG.md -rw-r--r-- 983.5 KB
CODE_OF_CONDUCT.md -rw-r--r-- 1.1 KB
CONTRIBUTING.md -rw-r--r-- 15.8 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 4.7 KB
WORKSPACE -rw-r--r-- 2.8 KB
browser-providers.conf.js -rw-r--r-- 1.8 KB
gulpfile.js -rw-r--r-- 631 bytes
karma-js.conf.js -rw-r--r-- 6.0 KB
package.json -rw-r--r-- 8.4 KB
renovate.json -rw-r--r-- 2.5 KB
test-events.js -rw-r--r-- 259 bytes
tsconfig-tslint.json -rw-r--r-- 149 bytes
tslint.json -rw-r--r-- 4.9 KB
yarn.lock -rw-r--r-- 649.0 KB
yarn.lock.readme.md -rw-r--r-- 1.3 KB

README.md

back to top