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

servo: Add support for parsing :is() and :where() #80

Merged

Conversation

mrobinson
Copy link
Member

@mrobinson mrobinson commented Sep 25, 2024

Stylo supports these and they just need to be turned on. This change
also ensures that forgiving selector mode is turned off when parsing
selectors for the @supports rule.

Signed-off-by: Martin Robinson [email protected]

Copy link
Collaborator

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We've done this in Blitz and it seems to work. My one reservation would be that I believe that "nth-child" and "has" require extra invalidation logic that is not handled by Stylo and needs to be handled externally.

(I am keen to document how that works, probably as an example in the Stylo repo, but I haven't worked it out myself yet)

@Loirooriol
Copy link
Contributor

Yeah have you confirmed that :has() really works? Because I have strong doubts.

@mrobinson
Copy link
Member Author

Yeah have you confirmed that :has() really works? Because I have strong doubts.

It's functional, but there's still work to do with invalidation, as @nicoburns mentioned above.

@Loirooriol
Copy link
Contributor

Should this be closed like servo/servo#33543 ?

@nicoburns
Copy link
Collaborator

I think this should be scoped down. I believe :is() and :where() (and possibly nested selectors?) should "just work" if enabled here, whereas :has(), :nth-child() require complex integration work.

@mrobinson mrobinson force-pushed the parse-is-nth-child-of-has-and-parent branch 3 times, most recently from c2f7754 to 3e44b02 Compare October 30, 2024 09:10
@mrobinson mrobinson changed the title servo: Add support for parsing :is(), :has(), :where(), and nesting selectors servo: Add support for parsing :is() and :where() Oct 30, 2024
@mrobinson mrobinson marked this pull request as ready for review October 30, 2024 11:57
Stylo supports these and they just need to be turned on.

Signed-off-by: Martin Robinson <[email protected]>
@mrobinson mrobinson force-pushed the parse-is-nth-child-of-has-and-parent branch from 3e44b02 to b2e128f Compare November 18, 2024 17:15
@mrobinson mrobinson added this pull request to the merge queue Nov 19, 2024
Merged via the queue into servo:main with commit bedab74 Nov 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants