fix(compiler): simplify handling of colon host with a selector list#68668
Open
mattrbeck wants to merge 1 commit into
Open
fix(compiler): simplify handling of colon host with a selector list#68668mattrbeck wants to merge 1 commit into
mattrbeck wants to merge 1 commit into
Conversation
Update `_convertColonHost` to extract and use only the first argument from a `:host(...)` selector list, ignoring subsequent arguments instead of splitting and duplicating the selector list. Also remove the obsolete test cases from `host_and_host_context_spec.ts`.
3ec47f5 to
417dea2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update
_convertColonHostto extract and use only the first argument from a:host(...)selector list, ignoring subsequent arguments instead of splitting and duplicating the selector list. Also remove the obsolete test cases fromhost_and_host_context_spec.ts.Support for
:host(.a, .b)has existed since d67f029 when the webcomponent polyfill was first designed, before the Shadow DOM spec was finalized. Selector lists in:host()never landed in the final spec, and it's a relic that Angular supports it today.It's my belief that Angular should not have a special syntax here. I also believe that it's trivial for users of this syntax use
:host(.a), :host(.b)or even:host(:is(.a, .b))instead. This change updates the compiler to simply ignore all additional selectors in the:host().