Skip to content

fix: infinite loop when :hover is contained in :has or nested :not selector #37

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dtdesign
Copy link

@dtdesign dtdesign commented Apr 7, 2025

The previous fix for :not() in 3433c7d was incomplete because it only considered :hover as a standalone selector but missed the ability to combine it with other selectors like :not(.some-class:hover), yielding an infinite loop once again.

The same problem exists for :has() and since it follows the same semantics, I went ahead and unified the approach for both pseudo selectors. For complex selectors the :not() or :has() is not the immediate parent, requiring a recursive lookup to identify any such selectors.

Fixes #35

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.

Infinite loop when using :hover inside :has() condition
1 participant