Skip to content

<style> text serialization under SVG in Angular SSR #69900

Description

@SkyZeroZx

Which @angular/* package(s) are the source of the bug?

platform-server/domino

Is this a regression?

No

Description

When Angular SSR renders text into an HTML <style> element that is projected or dynamically moved under an <svg> element, the value can be serialized without preserving its original DOM namespace and text-node semantics.

For example, this can occur when an Angular component creates an HTMLStyleElement and a graph or diagram component renders that component inside SVG using ng-content, NgTemplateOutlet, or ViewContainerRef.createComponent().

If the value contains </style>, the browser can close the serialized style element while parsing the SSR response and interpret the remaining content as markup.

Please provide a link to a minimal reproduction of the bug

https://issuetracker.google.com/u/1/issues/537033759

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: serverIssues related to server-side renderinggemini-triagedLabel noting that an issue has been triaged by gemini

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions