Skip to content
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

fix: initial mapped-selector infer with experimentalSelectorInference #2908

Merged
merged 1 commit into from
Oct 1, 2023

Conversation

idoros
Copy link
Collaborator

@idoros idoros commented Sep 27, 2023

This PR fixes the initial inferred selector for the transform/resolve process for a mapped selector that is created using a @custom-selector with the new experimentalSelectorInference=true (only in flat-mode and not the new structure-mode).

The difference between the old and new inference is that with the old mode the default context was the root of the stylesheet, so any internal custom states/parts were inferred against the root, and that worked fine because only flat structured were allowed, so any custom selector mapping that started with ::part would refer to a part of the root.

With the new experimentalSelectorInference, the selector context defaults to * (universal selector), making ::part unknown. So to handle mapping to ::part, it is assumed that any mapped-selector from a pseudo-element starts with an inferred root, while keeping the context after combinators as *.

this fix will also be backported to version 5.

@idoros idoros added bug Unexpected behavior or exception core Processing and transforming logic labels Sep 27, 2023
@idoros idoros requested a review from barak007 September 27, 2023 10:42
@idoros idoros self-assigned this Sep 27, 2023
@idoros idoros merged commit 08b0ecc into master Oct 1, 2023
12 checks passed
@idoros idoros deleted the ido/fix-pseudo-selector-initial-infer branch October 1, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior or exception core Processing and transforming logic
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants