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

Selector: Fix scoping logic of selector-native #5185

Closed
mgol opened this issue Dec 22, 2022 · 1 comment · Fixed by #5186
Closed

Selector: Fix scoping logic of selector-native #5185

mgol opened this issue Dec 22, 2022 · 1 comment · Fixed by #5186

Comments

@mgol
Copy link
Member

mgol commented Dec 22, 2022

Description

As discussed in #5085 (comment), it would be worthwhile to try to fix the long-standing selector-native issue of not requiring all selector parts to match element under context, e.g. so that:

$div.find("div > *")

no longer matches children of $div.

My preliminary research indicates resolving this issue would cost about 1000 bytes minified gzipped; it'd still be 3300 bytes minified gzipped smaller than the full build compared to 4300 bytes minified gzipped without this change.

Link to test case

No test case since we don't upload selector-native versions anywhere. But the example from the description is pretty straightforward.

@mgol mgol added this to the 4.0.0 milestone Dec 22, 2022
@mgol mgol self-assigned this Dec 22, 2022
mgol added a commit to mgol/jquery that referenced this issue Dec 22, 2022
This makes:
```js
$div.find("div > *")
```
no longer matching children of `$div`.

Also, leading combinators now work, e.g.:
```js
$div.find( "> *" );
```
returns children of `$div`.

As a result of that, a number of tests are no longer skipped in the
`selector-native` mode.

Fixes jquerygh-5185
Ref jquerygh-5085
@mgol
Copy link
Member Author

mgol commented Dec 22, 2022

PR: #5186

mgol added a commit to mgol/jquery that referenced this issue Feb 11, 2023
This makes:
```js
$div.find("div > *")
```
no longer matching children of `$div`.

Also, leading combinators now work, e.g.:
```js
$div.find( "> *" );
```
returns children of `$div`.

As a result of that, a number of tests are no longer skipped in the
`selector-native` mode.

Fixes jquerygh-5185
Ref jquerygh-5085
mgol added a commit that referenced this issue Feb 13, 2023
This makes:
```js
$div.find("div > *")
```
no longer matching children of `$div`.

Also, leading combinators now work, e.g.:
```js
$div.find( "> *" );
```
returns children of `$div`.

As a result of that, a number of tests are no longer skipped in the
`selector-native` mode.

Also, rename `rcombinators` to `rleadingCombinator`.

Fixes gh-5185
Closes gh-5186
Ref gh-5085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant