Skip to content

fix(compiler): prevent namespaced SVG <style> elements from being stripped (19.2.x backport) - #68981

Merged
pkozlowski-opensource merged 1 commit into
angular:19.2.xfrom
alan-agius4:backport-68977-19.2.x
May 28, 2026
Merged

fix(compiler): prevent namespaced SVG <style> elements from being stripped (19.2.x backport)#68981
pkozlowski-opensource merged 1 commit into
angular:19.2.xfrom
alan-agius4:backport-68977-19.2.x

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

Backports f3da61d to 19.2.x to resolve the SVG style stripping issue.

Closes #68977

…ipped

Updates the template preparser to exclude namespaced SVG style tags (':svg:style') from the style elements set.

Previously, ':svg:style' elements were incorrectly classified as PreparsedElementType.STYLE, which caused them to be completely stripped from the final template DOM tree during the Render3 template transform and pushed into standard component stylesheets. By limiting the style element parsing to standard 'style' tags, namespaced SVG style tags remain safely in the template AST as normal DOM elements, preserving local SVG styling.

Closes angular#68977
@pullapprove
pullapprove Bot requested a review from kirjs May 28, 2026 08:43
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label May 28, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 28, 2026
@alan-agius4
alan-agius4 requested review from JeanMeche and removed request for kirjs May 28, 2026 08:44
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: lts This PR is targeting a version currently in long-term support labels May 28, 2026
@pullapprove
pullapprove Bot requested a review from kirjs May 28, 2026 08:44
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 28, 2026
@alan-agius4
alan-agius4 removed the request for review from kirjs May 28, 2026 08:45
@pullapprove
pullapprove Bot requested a review from kirjs May 28, 2026 08:45
@alan-agius4
alan-agius4 removed the request for review from kirjs May 28, 2026 08:45
@alan-agius4

Copy link
Copy Markdown
Contributor Author

Disabled approve as this is a backport

@pkozlowski-opensource
pkozlowski-opensource merged commit 6ea6379 into angular:19.2.x May 28, 2026
25 of 27 checks passed
@pkozlowski-opensource

Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request 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.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Jun 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler PullApprove: disable target: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants