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

Ensure nested functions in selectors used with JavaScript plugins are not truncated #16802

Merged
merged 2 commits into from
Feb 25, 2025

Conversation

philipp-spiess
Copy link
Member

Fixes #16799

This was caused by a wrong condition in the CSS value parser that put child function arguments into the parent function by accident.

Test plan

  • Added a unit test to guard against regressions
  • Validated against the repro:
    Screenshot 2025-02-25 at 16 31 14

@philipp-spiess philipp-spiess requested a review from a team as a code owner February 25, 2025 15:33
@philipp-spiess philipp-spiess force-pushed the fix/selector-parser-bug branch from e1e0a58 to b575a6f Compare February 25, 2025 15:34
@philipp-spiess philipp-spiess force-pushed the fix/selector-parser-bug branch from b575a6f to 9fb7fdd Compare February 25, 2025 15:35
})

it('parses :not(:nth-child(1))', () => {
expect(parse('&:not(:nth-child(1))')).toEqual([
Copy link
Contributor

Choose a reason for hiding this comment

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

This test is structurally identical to the :has(…) test above. Is it necessary?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, good catch. Removed!

@philipp-spiess philipp-spiess merged commit b56f12e into main Feb 25, 2025
5 checks passed
@philipp-spiess philipp-spiess deleted the fix/selector-parser-bug branch February 25, 2025 16:00
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.

Incorrect rendering of :has() and :not() selectors since 4.0.7
2 participants