Skip to content

fix(compiler): remove deprecated shadow CSS encapsulation polyfills#68666

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

fix(compiler): remove deprecated shadow CSS encapsulation polyfills#68666
mattrbeck wants to merge 1 commit into
angular:mainfrom
mattrbeck:refactor/remove-shadow-css-polyfills

Conversation

@mattrbeck
Copy link
Copy Markdown
Member

@mattrbeck mattrbeck commented May 11, 2026

Completely remove support for polyfill-next-selector, polyfill-unscoped-rule, and polyfill-rule from shadow_css.ts, along with their associated methods and regular expressions. Also delete polyfills_spec.ts entirely.

Support for these polyfills 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 polyfill.

The spec has been published for over 10 years now. These polyfills are no longer required.

Note: polyfill-rule { content: ':host-context(.foo)' } now becomes polyfill-rule[contenta] { content: '.foo-shadowcsshost-no-combinator' ... } due to the nature of our regex-based parsing. This is true for other strings containing :host-context() today anyway, though. Just one more reason it'd be nice to have a real parser. Fixing that is out of scope in this PR.

@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
Completely remove support for `polyfill-next-selector`, `polyfill-unscoped-rule`, and `polyfill-rule` from `shadow_css.ts`, along with their associated methods and regular expressions. Also delete `polyfills_spec.ts` entirely.
@mattrbeck mattrbeck force-pushed the refactor/remove-shadow-css-polyfills branch from 4d4488d to d8c5bf8 Compare May 11, 2026 02:10
@mattrbeck mattrbeck changed the title refactor(compiler): remove deprecated shadow CSS encapsulation polyfills fix(compiler): remove deprecated shadow CSS encapsulation polyfills 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.

2 participants