New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(compiler): incorrectly inferring namespace for HTML nodes inside SVG #38477
Conversation
da711af
to
80eb167
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix @crisbeto, I just came across this PR and left a couple comments.
80eb167
to
00489d2
Compare
The HTML parser gets an element's namespace either from the tag name (e.g. `<svg:rect>`) or from its parent element `<svg><rect></svg>`) which breaks down when an element is inside of an SVG `foreignElement`, because foreign elements allow nodes from a different namespace to be inserted into an SVG. These changes add another flag to the tag definitions which tells child nodes whether to try to inherit their namespaces from their parents. It also adds a definition for `foreignObject` with the new flag, allowing elements placed inside it to infer their namespaces instead. Fixes angular#37218.
00489d2
to
879be69
Compare
…SVG (#38477) The HTML parser gets an element's namespace either from the tag name (e.g. `<svg:rect>`) or from its parent element `<svg><rect></svg>`) which breaks down when an element is inside of an SVG `foreignElement`, because foreign elements allow nodes from a different namespace to be inserted into an SVG. These changes add another flag to the tag definitions which tells child nodes whether to try to inherit their namespaces from their parents. It also adds a definition for `foreignObject` with the new flag, allowing elements placed inside it to infer their namespaces instead. Fixes #37218. PR Close #38477
…SVG (#38477) The HTML parser gets an element's namespace either from the tag name (e.g. `<svg:rect>`) or from its parent element `<svg><rect></svg>`) which breaks down when an element is inside of an SVG `foreignElement`, because foreign elements allow nodes from a different namespace to be inserted into an SVG. These changes add another flag to the tag definitions which tells child nodes whether to try to inherit their namespaces from their parents. It also adds a definition for `foreignObject` with the new flag, allowing elements placed inside it to infer their namespaces instead. Fixes #37218. PR Close #38477
…SVG (angular#38477) The HTML parser gets an element's namespace either from the tag name (e.g. `<svg:rect>`) or from its parent element `<svg><rect></svg>`) which breaks down when an element is inside of an SVG `foreignElement`, because foreign elements allow nodes from a different namespace to be inserted into an SVG. These changes add another flag to the tag definitions which tells child nodes whether to try to inherit their namespaces from their parents. It also adds a definition for `foreignObject` with the new flag, allowing elements placed inside it to infer their namespaces instead. Fixes angular#37218. PR Close angular#38477
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The HTML parser gets an element's namespace either from the tag name (e.g.
<svg:rect>
) or from its parent element<svg><rect></svg>
) which breaks down when an element is inside of an SVGforeignElement
, because foreign elements allow nodes from a different namespace to be inserted into an SVG.These changes add another flag to the tag definitions which tells child nodes whether to try to inherit their namespaces from their parents. It also adds a definition for
foreignObject
with the new flag, allowing elements placed inside it to infer their namespaces instead.Fixes #37218.