aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector-native.js
Commit message (Collapse)AuthorAgeFilesLines
* Selector: Make `selector.js` module depend on `attributes/attr.js`Michał Gołębiowski-Owczarek2024-01-121-2/+0
| | | | | | | | | This fixes custom builds using the `--include` switch that don't include the `attributes` module. Fixes gh-5379 Closes gh-5384 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Core: Use named exports in `src/`Michał Gołębiowski-Owczarek2023-09-121-14/+16
| | | | | | | | | The `default` export is treated differently across tooling when transpiled to CommonJS - tools differ on whether `module.exports` represents the full module object or just its default export. Switch `src/` modules to named exports for tooling consistency. Fixes gh-5262 Closes gh-5292
* Selector: Re-expose jQuery.find.{tokenize,select,compile,setDocument}Michał Gołębiowski-Owczarek2023-06-121-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Sizzle.tokenize` is an internal Sizzle API, but exposed. As a result, it has historically been available in jQuery via `jQuery.find.tokenize`. That got dropped during Sizzle removal; this change restores the API. Some other APIs so far only exposed on the `3.x` line are also added back: * `jQuery.find.select` * `jQuery.find.compile` * `jQuery.find.setDocument` In addition to that, Sizzle tests have been backported for the following APIs: * `jQuery.find.matchesSelector` * `jQuery.find.matches` * `jQuery.find.compile` * `jQuery.find.select` A new test was also added for `jQuery.find.tokenize` - even Sizzle was missing one. Fixes gh-5259 Closes gh-5263 Ref gh-5260 Ref jquery/sizzle#242 Ref gh-5113 Ref gh-4395 Ref gh-4406
* Selector: Backport jQuery selection context logic to selector-nativeMichał Gołębiowski-Owczarek2023-02-131-18/+77
| | | | | | | | | | | | | | | | | | | | | | 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
* Core:Selector: Move jQuery.contains from the selector to the core moduleMichał Gołębiowski-Owczarek2022-12-121-1/+0
| | | | | | | The `jQuery.contains` method is quite simple in jQuery 4+. On the other side, it's a dependency of the core `isAttached` util which is not ideal; moving it from the `selector` the `core` module resolves the issue. Closes gh-5167
* Selector: Re-introduce selector-native.jsMichał Gołębiowski-Owczarek2022-11-211-0/+88
| | | | | | | | | | | | | | | | | | | | | Re-introduce the `selector-native` similar to the one on the `3.x-stable` branch. One difference is since the `main` branch inlined Sizzle, some selector utils can be shared between the main `selector` module and `selector-native`. The main `selector` module can be disabled in favor of `selector-native` via: grunt custom:-selector Other changes: * Tests: Fix Safari detection - Chrome Headless has a different user agent than Safari and a browser check in selector tests didn't take that into account. * Tests: Run selector-native tests in `npm test` * Selector: Fix querying on document fragments Ref gh-4395 Closes gh-5085
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-291-240/+0
| | | | | | | | | | | | | | | | | | This commit removes Sizzle from jQuery, inlining its code & removing obsolete workarounds where applicable. The selector-native module has been removed. Further work on the selector module may decrease the size enough that it will no longer be necessary. If it turns out it's still useful, we'll reinstate it but the code will look different anyway as we'll want to share as much code as possible with the existing selector module. The Sizzle AUTHORS.txt file has been merged with the jQuery one - people are sorted by their first contributions to either of the two repositories. The commit reduces the gzipped jQuery size by 1460 bytes compared to master. Closes gh-4395
* Selector: Port Sizzle tests to jQueryMichał Gołębiowski-Owczarek2019-06-261-5/+9
| | | | | | | Apart from porting most Sizzle tests to jQuery (mostly to its selector module), this commit fixes selector-native so that a jQuery custom compilation that excludes Sizzle passes all tests as well. Closes gh-4406
* Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJSMichał Gołębiowski-Owczarek2019-04-291-5/+4
| | | | | | | | | | | Also, update support comments format to match format described in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197 with the change from: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-448998379 (open-ended ranges end with `+`). Fixes gh-3950 Fixes gh-4299 Closes gh-4347
* Build: Put all AMD modules in "src/" in strict modeMichał Gołębiowski2016-04-251-0/+2
| | | | Fixes gh-3073
* Selector: add jQuery.escapeSelectorTimmy Willison2016-01-281-3/+27
| | | | | Fixes gh-1761 Close gh-2878
* Selector: pass jQuery unit tests with selector-nativeTimmy Willison2015-11-111-49/+76
| | | | | | | | | - Ignore certain tests that obviously are not supported - Beefed up the sortOrder, uniqueSort, isXMLDoc, and attr functions Fixes gh-1742 Fixes gh-2048 Close gh-2703
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-15/+21
| | | | Fixes gh-2056
* Selector: Define jQuery.uniqueSort in selector-native tooMarek Lewandowski2015-07-141-22/+24
| | | | | Fixes gh-2466 Closes gh-2467
* Effects: Add tests for jQuery.TweenCorey Frang2015-06-261-1/+2
|
* Build: Don't assume the browser environment; smoke test on Node w/ jsdomMichał Gołębiowski2014-12-261-8/+9
| | | | | Fixes gh-1950 Closes gh-1949
* Build: update grunt-jscs-checker and pass with the new rulesTimmy Willison2014-07-171-8/+10
|
* Selector: Use Element.matches in selector-native if availablePhilip Jägenstedt2014-03-201-1/+2
| | | | | | | | | | | Spec: http://dom.spec.whatwg.org/#dom-element-matches Support in Chromium: https://code.google.com/p/chromium/issues/detail?id=326652 Fixes #14902 Closes gh-1524
* AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.Timmy Willison2013-08-151-1/+8
|
* Check nodeType of elements passed to selector-native's find. Fixes #13577.Timmy Willison2013-05-061-1/+11
|
* No ticket: boolean -> bool in selector-nativeTimmy Willison2013-05-061-1/+1
|
* Ref 4ef51690: Update selector-native for new Sizzle dependenciesRichard Gibson2013-04-051-0/+5
|
* Remove unprefixed `matchesSelector`. Stick most common first. Update SizzleTimmy Willison2013-03-231-2/+1
|
* Add warnings and ignore the built Sizzle file.Dave Methvin2013-02-271-0/+25
|
* Fix #13434: native-API selector moduleRichard Gibson2013-02-271-0/+125
What's out: * 6 KB * attribute not equal selector * positional selectors (:first; :eq(n); :odd; etc.) * type selectors (:input; :checkbox; :button; etc.) * state-based selectors (:animated; :visible; :hidden; etc.) * :has(selector) * custom selectors * leading combinators (e.g., $collection.find("> *")) * reliable functionality on XML fragments * requiring all parts of a selector to match elements under context (e.g., $div.find("div > *") now matches children of $div) * matching against non-elements * reliable sorting of disconnected nodes