Michał Gołębiowski-Owczarek
47835965bd
Selector: Inline Sizzle into the selector module
...
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
2019-07-29 21:19:21 +02:00
Oleg Gaidarenko
58c6ca9822
Build: ESLint details
...
Use eslint pragmas, fix new errors, etc
Closes gh-3148
2016-06-11 10:41:33 +03:00
Oleg Gaidarenko
10fdad742a
Build: Update jscs and lint files
...
Fixes gh-2056
2015-09-07 20:03:50 +03:00
Alexander O'Mara
892625b3c3
Core: Follow the AMD specification for define
...
AMD specification requires the factory argument be defined.
Close gh-2179
2015-04-13 11:53:26 -04:00
Michał Gołębiowski
1a25f21dc3
No ticket. Restore checking individual src/**/*.js files by jsHint.
2013-09-06 20:31:18 +02:00
Timmy Willison
6318ae6ab9
AMD-ify jQuery sourcegit s! Woo! Fixes #14113 , #14163 .
2013-08-15 14:15:49 -04:00
John Resig
81f65ce339
Pull in the Sizzle library dynamically using a submodule and make it part of the jQuery build process.
2009-10-26 18:23:31 -04:00
John Resig
bbffc99f7c
Moved a bunch of methods out of the jQuery-specific Sizzle code into more-appropriate files, in jQuery itself.
2009-10-26 18:07:57 -04:00
John Resig
67d445a703
A follow-up to [6578] (which stopped adding expandos to elements that didn't 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)
2009-09-25 17:55:20 +00:00
John Resig
24ffc395a7
Missing a var on a for loop, caused a variable to be leaked.
2009-09-15 21:09:46 +00:00
John Resig
e907b8769f
Missing a var on a for loop, caused a variable to be leaked.
2009-09-15 21:01:00 +00:00
Jörn Zaefferer
0b36b26259
fixed global variables introduced in for loop with missing var-keyword (detected via QUnit's no ?noglobals)
2009-09-15 17:39:21 +00:00
John Resig
0a6c5205d2
Make sure that at least one argument is provided to .slice(), in accordance with the spec. Fixes jQuery bug #4942 .
2009-07-23 13:22:55 +00:00
John Resig
48e9a39995
Standardize on using .nodeName in place of .tagName. Fixes jQuery bug #4923 .
2009-07-19 13:32:53 +00:00
John Resig
0d5c3a68a0
Standardizing on .test() and .exec() - moving away from using .match() for RegExp. Fixes jQuery bug #4113 .
2009-07-19 13:21:51 +00:00
Brandon Aaron
bbf3334db1
reverting sizzle updates from previous commit, appears i had an outdated version
2009-06-23 18:14:57 +00:00
Brandon Aaron
de07ebc1a0
fix for #4512 and minor sizzle updates
2009-06-23 18:11:09 +00:00
John Resig
45729831b1
Removed some cases of strict errors.
2009-05-20 21:52:47 +00:00
Brandon Aaron
b97b886fcd
fix :hidden and :visible selectors. fixes #4512
2009-05-18 15:36:36 +00:00
Brandon Aaron
31b573185b
fix :hidden selector that was accidentally reverted in previous commit, also fixed tests for :hidden selector in IE6
2009-05-04 00:19:57 +00:00
Brandon Aaron
d72b8307de
fix memory leak in IE
2009-05-04 00:05:04 +00:00
Brandon Aaron
f8ef75eb91
remove trailing spaces
2009-03-23 01:55:17 +00:00
Brandon Aaron
2c31a1624f
fix for #4374 , gap in :hidden, :visible logic
2009-03-18 17:55:07 +00:00
John Resig
26731d475b
Backed out commit [6260], was causing too many problems. We'll have to bite the bullet and assume that the incoming result set has array methods. Un-fixes jQuery bug #4250 .
2009-03-17 20:39:29 +00:00
John Resig
1c8c3883a9
Moved to a generic solution for copying methods over for querySelectorAll-using browsers.
2009-02-27 15:20:59 +00:00
John Resig
985856b823
No longer use arguments.callee or RegExp (use new RegExp, instead) for ES 3.1 and Caja compatibility. Fixes jQuery bug #4251 .
2009-02-26 18:00:41 +00:00
John Resig
410e13b400
As it turns out, the context was being started at a higher root than needed - fixing this speeds up > selectors.
2009-02-26 01:15:54 +00:00
John Resig
58235cc38e
Removed the need for the results set to have array methods. Resolves jQuery bug #4250 .
2009-02-25 18:41:29 +00:00
John Resig
4bbb70b4eb
Simplified the isXML function, no need to use recursion.
2009-02-25 15:37:09 +00:00
John Resig
1c5db3baba
Expose the sort/unique code from Sizzle as Sizzle.uniqueSort().
2009-02-25 15:19:08 +00:00
John Resig
9c0ddfa2ad
Landed some improvements for improving the performance of ID-rooted queries (e.g. '#foo p'). Fixes jQuery bug #4236 .
2009-02-25 04:08:04 +00:00
John Resig
883450b702
Tagged the Sizzle 1.0 release.
2009-02-20 19:52:38 +00:00
John Resig
d8b3bd700f
Switch to using createRange for element comparision instead of Array indexOf checks - thanks for the tip, Ioseb.
2009-02-17 17:51:50 +00:00
John Resig
4b7e1c906f
Brought back the compareDocumentPosition code. While it is redundant in Firefox it's much faster than using indexOf.
2009-02-17 17:43:05 +00:00
John Resig
048fc4555f
Added support for class selectors and class attribute selectors on XML documents. Fixes jQuery bug #4167 .
2009-02-16 18:23:59 +00:00
John Resig
8533da939d
Fixed an issue with :nth-child selectors embedded in :not() filters. Fixes jQuery bug #4156 .
2009-02-16 17:58:33 +00:00
John Resig
a720bb31ab
Changed the jQuery hidden/visible selectors to be a little more precise.
2009-02-16 15:55:06 +00:00
John Resig
e25c4a132f
Change the behavior of how :visible and :hidden work. :hidden is when an element is display none, a parent element is display none, or the element has a width of 0. :visible is when the element is not display none and all of its ancesotrs are not display none and its width is larger than 0. Fixes jQuery bugs #1349 , #3265 , and #3895 .
2009-02-16 15:52:15 +00:00
John Resig
5586fedf29
Fixed a bug with certain + selectors failing (Fixes jQuery bug #4023 ). Also tweaked the + and > functions a little bit.
2009-02-16 15:36:42 +00:00
John Resig
f0189d6181
Fixed the issue where weird characters were being used in ID selectors. Fixes jQuery bug #3913 .
2009-02-15 22:46:54 +00:00
John Resig
22c9c9b9d3
Make sure that [name=FOO] searches actually have the specified name (IE includes elements that have the ID, as well).
2009-02-15 22:33:19 +00:00
John Resig
20827707a9
Added fixes for two different :not() bugs. One with p:not(p.foo) failing and another with a weird combination of multiple selectors and filters. Fixes jQuery bug #4101 .
2009-02-15 21:13:33 +00:00
John Resig
21dde30348
Provide a graceful failover for [name=foo] queries that are looking for non-input/iframe/form elements. Fixes jQuery bug #4081 .
2009-02-14 22:24:55 +00:00
John Resig
782b4af76e
The compareDocumentPosition check was extraneous - indexOf works in all the other browsers that we need to support.
2009-02-14 22:18:02 +00:00
John Resig
6f4b08cdf9
Added support for sorting in Safari - when querySelectorAll isn't able to be used.
2009-02-14 18:10:45 +00:00
John Resig
7421f34284
Oops, the sourceIndex of the documentElement in IE is 1, not 0.
2009-02-14 17:06:30 +00:00
John Resig
e16c7fe0f8
Make sure that elements are returned in document order - and that the results are unique.
2009-02-14 16:59:10 +00:00
John Resig
831b15b06c
Merging a bunch of changes back from Sizzle, by LosTFx.
2009-02-10 00:28:38 +00:00
John Resig
b16da9d762
Reworked the attribute selection code to be able to select false-y values - and added some tests to verify that they work well against expandos.
2009-02-09 15:18:07 +00:00
John Resig
ab74ce7b57
match[4] is already saved in check - thanks Balazs.
2009-02-09 15:01:23 +00:00