You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This restores the parentElement guard before compiling adjacent- and general-sibling relational selectors inside :has(). Without it, matching a compound selector can reach the document root and dereference its null parent.
The new browser regression test covers both sibling forms at the root and a positive compound-selector case.
Validation:
node --check src/nwsapi.js
direct patched-source checks: root adjacent false, root general sibling false, compound sibling true
test/has-sibling-root.html under JSDOM: data-result=pass, no script errors
Ant Design #59151 exact head: released 2.2.25 fails 6/55 affected Tooltip tests; this local package passes 55/55 with 5 snapshots
git diff --check
The repository's current ESLint configuration reports 185 pre-existing errors across src/nwsapi.js when run with ES6 parsing; this patch does not introduce a new lint rule or broad cleanup.
AI assistance disclosure: Codex was used to trace and minimize the regression, prepare the focused patch and regression test, and draft this description. I reviewed the diff and reproduced all validation locally.
The core root-sibling fix was incorporated into master in faa8468, which credits #169. Thank you!
I verified the adopted source and the published nwsapi@2.2.27 package today. Both pass ten direct root/detached-root/compound-selector checks; the original source and published 2.2.25 fail five of those checks. On Ant Design #59151 head 713b71aff63ccae4a0d9b797fe5504971288cad1, using the same dependencies and overriding only NWSAPI in the test process, 2.2.25 fails four of 52 Tooltip tests while published 2.2.27 passes all 52 with five snapshots (Node 24.15.0).
Closing this superseded PR because the runtime fix is already adopted and released. The standalone HTML fixture in this branch was not part of the maintainer's commit. This is manual incorporation, not a GitHub PR merge.
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
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.
Fixes #168.
This restores the
parentElementguard before compiling adjacent- and general-sibling relational selectors inside:has(). Without it, matching a compound selector can reach the document root and dereference its null parent.The new browser regression test covers both sibling forms at the root and a positive compound-selector case.
Validation:
node --check src/nwsapi.jsfalse, root general siblingfalse, compound siblingtruetest/has-sibling-root.htmlunder JSDOM:data-result=pass, no script errorsgit diff --checkThe repository's current ESLint configuration reports 185 pre-existing errors across
src/nwsapi.jswhen run with ES6 parsing; this patch does not introduce a new lint rule or broad cleanup.AI assistance disclosure: Codex was used to trace and minimize the regression, prepare the focused patch and regression test, and draft this description. I reviewed the diff and reproduced all validation locally.