Skip to content

fix(compiler): remove dedicated support for legacy shadow DOM selectors#68667

Open
mattrbeck wants to merge 1 commit into
angular:mainfrom
mattrbeck:refactor/remove-legacy-shadow-selectors
Open

fix(compiler): remove dedicated support for legacy shadow DOM selectors#68667
mattrbeck wants to merge 1 commit into
angular:mainfrom
mattrbeck:refactor/remove-legacy-shadow-selectors

Conversation

@mattrbeck
Copy link
Copy Markdown
Member

Remove _shadowDOMSelectorsRe and _convertShadowDOMSelectors from shadow_css.ts so that ::shadow, ::content, /shadow-deep/, and /shadow/ are no longer treated specially or stripped from user CSS. Instead, they are naturally scoped like standard selectors. Also remove the legacy failing test from shadow_css_spec.ts.

Support for these selectors and combinators has existed since 2015, introduced in d67f029 before the Shadow DOM spec was even finalized. They were not specifically called out as features, but simply part of a port from the web component prototype. In fact, Angular today just removes them from the source. It does nothing to implement them even by their prototype specification.

This change simply updates Angular to treat these legacy selectors that never landed in the spec as if they're any other selector.

@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label May 11, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 11, 2026
Remove `_shadowDOMSelectorsRe` and `_convertShadowDOMSelectors` from `shadow_css.ts` so that `::shadow`, `::content`, `/shadow-deep/`, and `/shadow/` are no longer treated specially or stripped from user CSS. Instead, they are naturally scoped like standard selectors. Also remove the legacy failing test from `shadow_css_spec.ts`.
@mattrbeck mattrbeck force-pushed the refactor/remove-legacy-shadow-selectors branch from 9ee8c8c to d056668 Compare May 11, 2026 02:10
@mattrbeck mattrbeck changed the title refactor(compiler): remove dedicated support for legacy shadow DOM selectors fix(compiler): remove dedicated support for legacy shadow DOM selectors May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: compiler Issues related to `ngc`, Angular's template compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants