aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector.js
Commit message (Collapse)AuthorAgeFilesLines
* Docs: Replace `#NUMBER` Trac issue references with `trac-NUMBER`Michał Gołębiowski-Owczarek2022-01-041-4/+7
| | | | | | | | | | | | | The GitHub UI treats `#NUMBER` as referring to its own issues which is confusing when in jQuery source it's usually referring to the old deprecated Trac instance at https://bugs.jquery.com. This change replaces all such Trac references with `trac-NUMBER`. A few of the references came with the Sizzle integration and referred to the Sizzle GitHub bug tracker. Those have been replaced with full links instead. A new entry describing issue reference conventions has been added to README. Closes gh-4993
* CSS: Trim whitespace surrounding CSS Custom Properties valuesfecore12021-09-231-2/+2
| | | | | | | | The spec has recently changed and CSS Custom Properties values are trimmed now. This change makes jQuery polyfill that new behavior for all browsers. Ref w3c/csswg-drafts#774 Fixes gh-4926 Closes gh-4930
* Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)Michał Gołębiowski-Owczarek2020-09-221-20/+17
| | | | | | | | | | | | Drop support for Edge Legacy: the non-Chromium, EdgeHTML-based Microsoft Edge version. Also, restrict some workarounds that were applied unconditionally in all browsers to run only in IE now. This slightly increases the size but reduces the performance burden on modern browsers that don't need the workarounds. Also, clean up some comments & remove some obsolete workarounds. Fixes gh-4568 Closes gh-4792
* Build: Correct code indentations based on jQuery Style GuideWonseop Kim2020-05-051-2/+4
| | | | | | | | 1. Correct code indentations based on jQuery Style Guide (contribute.jquery.org/style-guide/js/#spacing). 2. Add rules to "src/.eslintrc.json" to enable "enforcing consistent indentation", with minimal changes to the current code. Closes gh-4672
* Selector: Make empty attribute selectors work in IE againMichał Gołębiowski-Owczarek2019-11-181-3/+1
| | | | | | | | | | qSA in IE 11/Edge often (but not always) don't find elements with an empty name attribute selector (`[name=""]`). Detect that & fall back to Sizzle traversal. Interestingly, IE 10 & older don't seem to have the issue. Fixes gh-4435 Closes gh-4510
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-181-21/+14
| | | | | | | | | | | | | | | | | | | | | | Migrate all source AMD modules to ECMAScript modules. The final bundle is compiled by a custom build process that uses Rollup under the hood. Test files themselves are still loaded via RequireJS as that has to work in IE 11. Tests can now be run in "Load as modules" mode which replaces the previous "Load with AMD" option. That option of running tests doesn't work in IE and Edge as it requires support for dynamic imports. Some of the changes required by the migration: * check `typeof` of `noGlobal` instead of using the variable directly as it's not available when modules are used * change the nonce module to be an object as ECMASscript module exports are immutable * remove some unused exports * import `./core/parseHTML.js` directly in `jquery.js` so that it's not being cut out when the `ajax` module is excluded in a custom compilation Closes gh-4541
* Docs: Update most URLs to HTTPSMichał Gołębiowski-Owczarek2019-10-211-7/+7
| | | Closes gh-4511
* Selector: Make selectors with leading combinators use qSA againMichał Gołębiowski-Owczarek2019-10-141-1/+4
| | | | | | | | | | | | | | An optimization added in jquery/sizzle#431 skips the temporary IDs for selectors not using child or descendant combinators. For sibling combinators, though, this pushes a selector with a leading combinator to qSA directly which crashes and falls back to a slower Sizzle route. This commit makes selectors with leading combinators not skip the selector rewriting. Note that after jquery/jquery#4454 & jquery/sizzle#453, all modern browsers other than Edge leverage the :scope pseudo-class, avoiding temporary id attributes. Closes gh-4509 Ref jquery/sizzle#431
* Manipulation:Selector: Use the nodeName util where possible to save sizeMichał Gołębiowski-Owczarek2019-10-081-18/+17
| | | | | Saves 20 bytes. Closes gh-4504
* Selector: Use shallow document comparisons to avoid IE/Edge crashesMichał Gołębiowski-Owczarek2019-09-251-13/+24
| | | | | | | | | IE/Edge sometimes crash when comparing documents between frames using the strict equality operator (`===` & `!==`). Funnily enough, shallow comparisons (`==` & `!=`) work without crashing. Fixes gh-4441 Closes gh-4471
* Core: Remove private copies of push, sort & splice from the jQuery prototypeMichał Gołębiowski-Owczarek2019-09-241-3/+3
| | | Closes gh-4473
* Selector: reduce size, simplify setDocumentMichał Gołębiowski-Owczarek2019-08-261-128/+82
| | | | | | | | | | | With new selector code doing less convoluted support tests, it was possible to extract a lot of logic out of setDocument & also reduce size. This commit also backports jquery/sizzle#439 that was reverted by mistake during a switch from JSHint + JSCS to ESLint. Closes gh-4462 Ref jquery/sizzle#442 Ref jquery/sizzle#439
* Selector: Leverage the :scope pseudo-class where possibleMichał Gołębiowski-Owczarek2019-08-191-11/+18
| | | | | | | | | | | | | | | | | | | The `:scope` pseudo-class[1] has surprisingly good browser support: Chrome, Firefox & Safari have supported if for a long time; only IE & Edge lack support. This commit leverages this pseudo-class to get rid of the ID hack in most cases. Adding a temporary ID may cause layout thrashing which was reported a few times in [the past. We can't completely eliminate the ID hack in modern browses as sibling selectors require us to change context to the parent and then `:scope` stops applying to what we'd like. But it'd still improve performance in the vast majority of cases. [1] https://developer.mozilla.org/en-US/docs/Web/CSS/:scope Fixes gh-4453 Closes gh-4454 Ref gh-4332 Ref jquery/sizzle#405
* Selector: Bring back querySelectorAll shortcut usageMichał Gołębiowski-Owczarek2019-08-091-2/+1
| | | | | | | Due to a faulty IE 8 workaround removal, the fast path qSA mode was skipped when jQuery's find was called on an element node - i.e. in most cases. 😱 Ref gh-4395 Closes gh-4452
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-291-2/+1672
| | | | | | | | | | | | | | | | | | 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
* Build: ESLint detailsOleg Gaidarenko2016-06-111-1/+3
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-1/+1
| | | | Fixes gh-2056
* Core: Follow the AMD specification for defineAlexander O'Mara2015-04-131-1/+1
| | | | | | AMD specification requires the factory argument be defined. Close gh-2179
* No ticket. Restore checking individual src/**/*.js files by jsHint.Michał Gołębiowski2013-09-061-1/+1
|
* AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163.Timmy Willison2013-08-151-0/+1
|
* Pull in the Sizzle library dynamically using a submodule and make it part of ↵John Resig2009-10-261-1007/+0
| | | | the jQuery build process.
* Moved a bunch of methods out of the jQuery-specific Sizzle code into ↵John Resig2009-10-261-61/+0
| | | | more-appropriate files, in jQuery itself.
* A follow-up to [6578] (which stopped adding expandos to elements that didn't ↵John Resig2009-09-251-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID). $("<div/>").after("<span/>") => [ div, span ] (calling after on a disconnected DOM node adds the nodes to the end of the jQuery set) $("<div/>").before("<span/>") => [ span, div ] (calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set) $("div").add("span") => [ div, span, span, div, span ] (results now come out in document order) $("div").find("code").andSelf(); => [ div, code, code ] (results now come out in document order) Same goes for .parents(), .nextAll(), .prevAll(), and .siblings(). Exception: .parents() will still return the results in reverse document order. jQuery.data(elem) => { object of data } (no longer returns the unique ID assigned to the node)
* Missing a var on a for loop, caused a variable to be leaked.John Resig2009-09-151-1/+1
|
* Missing a var on a for loop, caused a variable to be leaked.John Resig2009-09-151-1/+1
|
* fixed global variables introduced in for loop with missing var-keyword ↵Jörn Zaefferer2009-09-151-1/+1
| | | | (detected via QUnit's no ?noglobals)
* Make sure that at least one argument is provided to .slice(), in accordance ↵John Resig2009-07-231-2/+2
| | | | with the spec. Fixes jQuery bug #4942.
* Standardize on using .nodeName in place of .tagName. Fixes jQuery bug #4923.John Resig2009-07-191-1/+1
|
* Standardizing on .test() and .exec() - moving away from using .match() for ↵John Resig2009-07-191-3/+3
| | | | RegExp. Fixes jQuery bug #4113.
* reverting sizzle updates from previous commit, appears i had an outdated versionBrandon Aaron2009-06-231-3/+3
|
* fix for #4512 and minor sizzle updatesBrandon Aaron2009-06-231-14/+10
|
* Removed some cases of strict errors.John Resig2009-05-201-3/+3
|
* fix :hidden and :visible selectors. fixes #4512Brandon Aaron2009-05-181-2/+12
|
* fix :hidden selector that was accidentally reverted in previous commit, also ↵Brandon Aaron2009-05-041-1/+1
| | | | fixed tests for :hidden selector in IE6
* fix memory leak in IEBrandon Aaron2009-05-041-16/+24
|
* remove trailing spacesBrandon Aaron2009-03-231-14/+14
|
* fix for #4374, gap in :hidden, :visible logicBrandon Aaron2009-03-181-1/+1
|
* Backed out commit [6260], was causing too many problems. We'll have to bite ↵John Resig2009-03-171-12/+9
| | | | the bullet and assume that the incoming result set has array methods. Un-fixes jQuery bug #4250.
* Moved to a generic solution for copying methods over for ↵John Resig2009-02-271-4/+3
| | | | querySelectorAll-using browsers.
* No longer use arguments.callee or RegExp (use new RegExp, instead) for ES ↵John Resig2009-02-261-1/+1
| | | | 3.1 and Caja compatibility. Fixes jQuery bug #4251.
* As it turns out, the context was being started at a higher root than needed ↵John Resig2009-02-261-1/+1
| | | | - fixing this speeds up > selectors.
* Removed the need for the results set to have array methods. Resolves jQuery ↵John Resig2009-02-251-7/+10
| | | | bug #4250.
* Simplified the isXML function, no need to use recursion.John Resig2009-02-251-1/+1
|
* Expose the sort/unique code from Sizzle as Sizzle.uniqueSort().John Resig2009-02-251-10/+13
|
* Landed some improvements for improving the performance of ID-rooted queries ↵John Resig2009-02-251-23/+36
| | | | (e.g. '#foo p'). Fixes jQuery bug #4236.
* Tagged the Sizzle 1.0 release.John Resig2009-02-201-3/+2
|
* Switch to using createRange for element comparision instead of Array indexOf ↵John Resig2009-02-171-7/+9
| | | | checks - thanks for the tip, Ioseb.
* Brought back the compareDocumentPosition code. While it is redundant in ↵John Resig2009-02-171-2/+10
| | | | Firefox it's much faster than using indexOf.
* Added support for class selectors and class attribute selectors on XML ↵John Resig2009-02-161-8/+16
| | | | documents. Fixes jQuery bug #4167.
* Fixed an issue with :nth-child selectors embedded in :not() filters. Fixes ↵John Resig2009-02-161-20/+20
| | | | jQuery bug #4156.