-
Notifications
You must be signed in to change notification settings - Fork 26.1k
fix(compiler): transform pseudo selectors correctly for the encapsulated view #57796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c341504
to
d7d92a7
Compare
Running a TGP since encapsulation changes tend to be break-ey. |
Thank you @crisbeto ! I patched my change with more tests and support for more complex selectors. The internal presubmit test, which failed previously, passed with new changes. |
I re-ran the TGP with the latest code, but there are still some breakages. |
920eb91
to
d146513
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…ted view (angular#57796) fix scoping and transforming logic of the `shimCssText` for the components with encapsulated view: - add support for pseudo selector functions - apply content scoping for inner selectors of `:is()` and `:where()` - allow multiple comma separated selectors inside pseudo selectors Fixes angular#45686 PR Close angular#57796
allow css combinators within pseudo selector functions, parsing those correctly. Similarly to previous version, don't break selectors into part if combinators are within parenthesis, for example `:where(.one > .two)` PR Close angular#57796
fix spelling in the comment PR Close angular#57796
…ar#57796) add support for nested and deeply nested (up to three levels) selectors, parse multiple :host selectors, scope selectors within pseudo functions PR Close angular#57796
…r#57796) keep attributes used to scope :host selectors PR Close angular#57796
…angular#57796) fix regexp which is used to test for host inside pseudo selectors PR Close angular#57796
…crease specificity (angular#57796) parse constructions like `:where(:host-context(.foo))` correctly revert logic which lead to decreased specificity if `:where` was applied to another selector, for example `div` is transformed to `div[contenta]` with specificity of (0,1,1) so `div:where(.foo)` should not decrease it leading to `div[contenta]:where(.foo)` with the same specificity (0,1,1) instead of `div:where(.foo[contenta])` with specificity equal to (0,0,1) PR Close angular#57796
fix scoping and transforming logic of the
shimCssText
for the components with encapsulated view::is()
and:where()
Fixes #45686
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Pseudo selector functions aren't parsed/transformed correctly at the moment
The provided examples inside the issue are added as unit tests as well as other test cases.
Issue Number: #45686
What is the new behavior?
Specified in unit tests.
:where(.one, .two)
stays as a single selector for scoping, previously it was split into two parts:where(.one
and.two)
.:where(.one > .two)
isn't split:is()
and:where()
are being scoped internally, that is especially important for:where()
since this selectors doesn't increase specificity, allowing overloading theme specific values not risking order related issues.Does this PR introduce a breaking change?
Other information