Conversation
jdalton
force-pushed
the
fix/has-validation-v2
branch
from
September 17, 2026 17:37
24782fd to
2737fcc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Invalid
:has()arguments can be accepted on empty queries, nested:has()can match, and wildcard namespaces are rejected on v2. Backport v3's eager logical validation and forgiving-branch handling so these selectors follow the same rules across all eight DOM selector APIs. ChangingVERBOSITYalso clears compiled failures so verbose retries throw correctly.This preserves v2's released source layout, ES2015 syntax, and existing matching and cache architecture. It adds 18 focused regression tests and runs both maintenance suites through
npm test.Validation:
mastersource.:has()pages pass, up from 105 passing and seven failing. The same pages pass on v3. The separate:has-slottedpseudo-class is outside this backport.fd983776a7cd19ebcda7a2bcb69c74330ee5d8c9, Chrome for Testing 154.0.8037.0. Parsing pages use the existing DOM selector-validity helper. Every selected subtest runs without result filtering.node --check src/nwsapi.jsand the existing ES2015 parse check pass.