Skip to content

fix(compiler): fix :host parsing in pseudo-selectors - #58554

Closed
GeorgySerga wants to merge 1 commit into
angular:19.0.xfrom
GeorgySerga:compiler-shadow-css
Closed

GeorgySerga wants to merge 1 commit into
angular:19.0.xfrom
GeorgySerga:compiler-shadow-css

Conversation

@GeorgySerga

Copy link
Copy Markdown
Contributor

fix several use-cases where :host was used in or around pseudo-selectors

  • :host followed by a comma inside pseudo-selectors
  • :host outside of pseudo-selectors when another :host is present within see tests for examples

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Look for added tests. Mainly

  • :has(:host, .foo) isn't parsed correctly (the comma after foo was recognized as a selector;
  • :host:has(.foo.host) isn't scoped correctly (added [content] scoping).
    Issue Number: 18.2.8 breaks multiple selectors in :not on :host #58226
    Fixing issues outlined in this comment, doesn't solve all of the problems mentioned, splitting PR's as fixes seem not relevant.

What is the new behavior?

Different :host combinations around pseudo-selectors are parsed correctly.

Does this PR introduce a breaking change?

  • Yes
  • No (unless a broken selector is fixed now, so styles would apply)

Other information

This PR doesn't resolve the whole issue, but fixes a set of use-cases.

fix several use-cases where `:host` was used in or around pseudo-selectors
- `:host` followed by a comma inside pseudo-selectors
- `:host` outside of pseudo-selectors when another `:host` is present within
see tests for examples
@pullapprove
pullapprove Bot requested a review from JoostK November 7, 2024 21:00
@angular-robot angular-robot Bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Nov 7, 2024
@ngbot ngbot Bot added this to the Backlog milestone Nov 7, 2024
@GeorgySerga

Copy link
Copy Markdown
Contributor Author

Closing, #58557 builds on changes here

@GeorgySerga GeorgySerga closed this Nov 9, 2024
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue 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 Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant