aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes
Commit message (Collapse)AuthorAgeFilesLines
* CSS: Skip falsy values in `addClass( array )`, compress codeMichał Gołębiowski-Owczarek2022-01-241-40/+44
| | | | | | | | | | | | | | | This change makes jQuery skip falsy values in `addClass( array )` & `removeClass( array )` instead of stopping iteration when the first falsy value is detected. This makes code like: ```js elem.addClass( [ "a", "", "b" ] ); ``` add both the `a` & `b` classes. The code was also optimized for size a bit so it doesn't increase the minified gzipped size. Fixes gh-4998 Closes gh-5003
* Docs: Remove links to Web Archive from sourceMichał Gołębiowski-Owczarek2022-01-041-1/+0
| | | | | | | | Neither of the removed links is crucial; one of them refers to a site that has since started being malicious; while the Web Archive links remain safe, some scanners warn about such links. Removing them is the safest thing to do. Fixes gh-4981 Closes gh-4991
* Docs: Replace `#NUMBER` Trac issue references with `trac-NUMBER`Michał Gołębiowski-Owczarek2022-01-042-2/+2
| | | | | | | | | | | | | 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
* Attributes: Don't stringify attributes in the setterMichał Gołębiowski-Owczarek2021-11-011-1/+1
| | | | | | | | | | | | | Stringifying attributes in the setter was needed for IE <=9 but it breaks trusted types enforcement when setting a script `src` attribute. Note that this doesn't mean script execution works. Since jQuery disables all scripts by changing their type and then executes them by creating fresh script tags with proper `src` & possibly other attributes, this unwraps any trusted `src` wrappers, making the script not execute under strict CSP settings. We might try to fix it in the future in a separate change. Fixes gh-4948 Closes gh-4949
* Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)Michał Gołębiowski-Owczarek2020-09-221-2/+4
| | | | | | | | | | | | 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
* Attributes: Drop the `toggleClass(boolean|undefined)` signatureMichał Gołębiowski-Owczarek2020-09-011-42/+14
| | | | | | | The behavior of this signature is not intuitive, especially if classes are manipulated via other ways between `toggleClass` calls. Fixes gh-3388 Closes gh-4766
* Build: Correct code indentations based on jQuery Style GuideWonseop Kim2020-05-051-3/+3
| | | | | | | | 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
* Attributes: Refactor val(): don't strip carriage return, isolate IE workaroundsMichał Gołębiowski-Owczarek2020-01-131-22/+19
| | | | | | | | | | Before this change, `val()` was stripping out carriage return characters from the returned value. No test has relied on that. The logic was different for option elements as its custom defined hook was omitting this stripping logic. This commit gets rid of the carriage return removal and isolates the IE-only select val getter to be skipped in other browsers. Closes gh-4585
* Attributes: Don't set the type attr hook at all outside of IEMichał Gołębiowski-Owczarek2020-01-131-17/+18
| | | | | This removes a needless function call in modern browsers. Closes gh-4587
* Core: Migrate from AMD to ES modules 🎉Michał Gołębiowski-Owczarek2019-11-184-46/+21
| | | | | | | | | | | | | | | | | | | | | | 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
* Selector: Inline Sizzle into the selector moduleMichał Gołębiowski-Owczarek2019-07-293-36/+25
| | | | | | | | | | | | | | | | | | 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: forbid unused function parametersMichał Gołębiowski-Owczarek2019-05-131-1/+1
| | | | | | | | | | | | | This commit requires all function parameters to be used, not just the last one. In cases where that's not possible as we need to match an external API, there's an escape hatch of prefixing an unused argument with `_`. This change makes it easier to catch unused AMD dependencies and unused parameters in internal functions the API of which we may change at will, among other things. Unused AMD dependencies have been removed as part of this commit. Closes gh-4381
* Core: Remove IE-specific support tests, rely on document.documentModeMichał Gołębiowski-Owczarek2019-05-133-43/+13
| | | | | | | Also, update some tests to IE-sniff when deciding whether to skip a test. Fixes gh-4386 Closes gh-4387
* Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJSMichał Gołębiowski-Owczarek2019-04-294-29/+15
| | | | | | | | | | | 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
* Core: deprecate jQuery.isFunctionJason Bedard2018-01-152-8/+10
| | | | Fixes gh-3609
* Attributes: allow array param in add/remove/toggleClassTimmy Willison2018-01-081-8/+19
| | | | | | | | | +30 bytes instead of +182 Thanks to @faisaliyk for the first pass on this feature. Fixes gh-3532 Close gh-3917
* Build: fix tests in AMD modeTimmy Willison2017-03-061-2/+3
| | | | - nodeName was included at the wrong spot in dependency lists
* Core: Deprecate jQuery.nodeNamekaran-962017-03-012-5/+7
| | | | | Fixes gh-3475 Closes gh-3505
* Core: Deprecate jQuery.isArrayManoj Kumar2016-11-301-2/+2
| | | | | Fixes gh-2961 Closes gh-3278
* Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapseTimmy Willison2016-09-153-24/+22
| | | | | | | | | | | | - Renames and changes rnotwhite to focus on HTML whitespace chars - Change internal use of jQuery.trim to more accurate strip and collapse - Adds tests to ensure HTML space characters are retained where valid - Doesn't add tests where the difference is inconsequential and existing tests are adequate. Fixes gh-3003 Fixes gh-3072 Close gh-3316
* Build: Update eslint config and fix associated errorsOleg Gaidarenko2016-07-152-16/+27
|
* Build: More ESLint related changesOleg Gaidarenko2016-07-091-0/+8
|
* Build: ESLint detailsOleg Gaidarenko2016-06-111-0/+5
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Attributes: Avoid infinite recursion on non-lowercase attribute gettersMichał Gołębiowski2016-06-031-5/+7
| | | | | | | | | | | | Attribute hooks are determined for the lowercase versions of attribute names but this has not been reflected in the bool attribute hooks. The code that temporarily removed a handler to avoid an infinite loop was removing an incorrect handler causing stack overflow. Fixes gh-3133 Refs gh-2914 Refs gh-2916 Closes gh-3134
* Docs: Fix an incorrect comment in the attributes moduleMichał Gołębiowski2016-06-031-1/+1
| | | | | Attributes are no longer always treated as lowercase, although hooks for them are. This commit fixes a no longer correct comment.
* Build: Put all AMD modules in "src/" in strict modeMichał Gołębiowski2016-04-255-0/+10
| | | | Fixes gh-3073
* Docs: Update support comments to follow the new syntaxMichał Gołębiowski2016-03-302-2/+2
| | | | | The changes follow the spec proposed in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
* Docs: Update support comments related to IEMichał Gołębiowski2016-03-302-3/+3
| | | | All support comments were checked for Edge applicability.
* Docs:Tests: Remove legacy code & add support comments where neededMichał Gołębiowski2016-03-301-0/+1
| | | | | | | | This commits backports some changes done in the patch to the then-existing compat branch that removed support for old browsers and added some support comments. Refs 90d7cc1d8b2ea7ac75f0eacb42439349c9c73278
* Attributes: strip/collapse whitespace for set values on selectsTimmy Willison2016-03-171-5/+12
| | | | | Fixes gh-2978 Close gh-3002
* Attributes: remove redundant parent checkTimmy Willison2016-03-071-1/+1
|
* Attributes: remove the lower-casing logic for attribute namesMichał Gołębiowski2016-02-171-10/+2
| | | | | | | | | | | | | | | jQuery used to lower-case the attribute names passed to the .attr setter to workaround an old IE issue. This is no longer in jQuery 3.0 and removing it may even "accidentally" make this API sort-of work on SVGs (see gh-2910) so why not. Manual lowercasing had to be added to the place where the proper attrHook is retrieved so that it works regardless of the casing of the provided name. A regular `toLowerCase()` is enough there as those few attributes don't contain any non-ASCII characters. Fixes gh-2914 Closes gh-2916
* Attributes: Add a support comment & fix a link @ tabIndex hookMichał Gołębiowski2016-02-031-1/+2
| | | | Ref gh-2664
* Attributes: fix setting selected on an option in IE<=11Timmy Willison2016-01-191-0/+16
| | | | | Fixes gh-2732 Close gh-2840
* Revert "Attributes: Remove undocumented .toggleClass( boolean ) signature"Timmy Willison2016-01-071-17/+52
| | | | | | This reverts commit 53f798cf4d783bb813b4d1ba97411bc752b275f3. - Turns out this is documented, even if not fully. Need to deprecate before removal.
* Attributes: exclusively lowercase A-Z in attribute namesTimmy Willison2015-12-021-2/+9
| | | | | Fixes gh-2730 Close gh-2749
* Attributes: return empty array for select-multiple with no valuesTimmy Willison2015-11-051-1/+1
| | | | | Fixes gh-2562 Close gh-2689
* Attributes: do not set properties to false when removing booleansTimmy Willison2015-10-211-10/+2
| | | | Fixes gh-1759
* Attributes: fix tabIndex on <img> in IE11Joelle Fleurantin2015-10-181-5/+15
| | | | | Fixes gh-2647 Closes gh-2664
* Attributes: removeClass() -> attr("class", "")Thomas Tortorini2015-10-181-23/+21
| | | | | | - Classes simpliciation Close gh-2465
* Attributes: Use simpler boolean check vs a function callDave Methvin2015-10-181-5/+2
| | | | Ref gh-2491
* Attributes: Remove undocumented .toggleClass( boolean ) signatureDave Methvin2015-10-181-54/+22
| | | | | Fixes gh-2491 Close gh-2618
* Ajax:Attributes:CSS:Manipulation: Reduce Android 2.3 supportMichał Gołębiowski2015-09-142-7/+1
| | | | | | | | Drop non-critical workarounds for Android 2.3. Fixes gh-2483 Fixes gh-2505 Closes gh-2581
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-075-61/+73
| | | | Fixes gh-2056
* Core: organize prop & attr code to be similarGilad Peleg2015-06-232-54/+56
| | | | Closes gh-2384
* Attributes: add SVG class manipulationTimmy Willison2015-05-121-29/+43
| | | | | | | | | - Note: support for SVG is limited in jQuery, but this is one area where the cost vs benefit ratio was acceptable. Fixes gh-2199 Close gh-2268
* Core: Align branches: remove an unused variable, add commentsMichał Gołębiowski2015-04-271-2/+2
| | | | Closes gh-2233
* Attributes: remove unnecessary element null checkBastian Buchholz2015-04-201-1/+1
| | | | Close gh-2201
* Attributes: revert returning null for non-existant attributesTimmy Willison2015-03-301-1/+6
| | | | Ref https://github.com/jquery/jquery/issues/2118
* Attributes: revert returning null for non-elementsTimmy Willison2015-03-161-1/+1
|