aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
Commit message (Collapse)AuthorAgeFilesLines
* Docs: Replace `#NUMBER` Trac issue references with `trac-NUMBER`Michał Gołębiowski-Owczarek2022-01-121-1/+1
| | | | | | | | | | | | | | | | | This is a version of gh-4993 for the `3.x-stable` branch. 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-4994 Ref gh-4993 Ref 5d5ea015114092c157311c4948f7cc3d8c8e7f8a
* Manipulation: Don't remove HTML comments from scriptsMichał Gołębiowski-Owczarek2021-07-191-1/+8
| | | | | | | | | | | | | | | | | | | | | When evaluating scripts, jQuery strips out the possible wrapping HTML comment and a CDATA section. However, all supported browsers are already doing that when loading JS via appending a script tag to the DOM which is how we've been doing `jQuery.globalEval` since jQuery 3.0.0. jQuery logic was imperfect, e.g. it just stripped the `<!--` and `-->` markers, respectively at the beginning or the end of the script contents. However, browsers are also stripping everything following those markers in the same line, treating them as single-line comments delimiters; this is now also mandated by ECMAScript 2015 in Annex B. Instead of fixing the jQuery logic, just let the browser do its thing. We still need to strip CDATA sections for backwards compatibility. This shouldn't be needed as in XML documents they're already not visible when inspecting element contents and in HTML documents they have no meaning but we're preserving that logic for backwards compatibility. This will be removed completely in 4.0. Fixes gh-4904 Closes gh-4905 Ref gh-4906
* Manipulation: Make jQuery.htmlPrefilter an identity functionMichał Gołębiowski-Owczarek2020-03-161-8/+1
| | | | | | Closes gh-4642 (cherry picked from 90fed4b453a5becdb7f173d9e3c1492390a1441f)
* Data:Event:Manipulation: Prevent collisions with Object.prototypeMichał Gołębiowski-Owczarek2020-03-021-5/+3
| | | | | | | | | | Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. Fixes gh-3256 Closes gh-4603 (cherry picked from commit 9d76c0b163675505d1a901e5fe5249a2c55609bc)
* Core: Fire iframe script in its context, add doc param in globalEvalMichał Gołębiowski-Owczarek2020-02-101-1/+1
| | | | | | | | | | | | | 1. Support passing custom document to jQuery.globalEval; the script will be invoked in the context of this document. 2. Fire external scripts appended to iframe contents in that iframe context; this was already supported & tested for inline scripts but not for external ones. Fixes gh-4518 Closes gh-4601 (cherry picked from commit 4592595b478be979141ce35c693dbc6b65647173)
* Core: Use Array.prototype.flat where supportedAhmed.S.ElAfifi2019-09-251-3/+3
| | | | | | | | | | | | | Calling `Array.prototype.concat.apply( [], inputArray )` to flatten `inputArray` crashes for large arrays; using `Array.prototype.flat` avoids these issues in browsers that support it. In case it's necessary to support these large arrays even in older browsers, a polyfill for `Array.prototype.flat` can be loaded. This is already being done by many applications. (cherry picked from 9df4f1de12728b44a4b0f91748f12421008d9079) Fixes gh-4320 Closes gh-4459
* Core: Preserve CSP nonce on scripts with src attribute in DOM manipulationbuddh42019-03-251-1/+3
| | | | | Fixes gh-4323 Closes gh-4328
* Event: Leverage native events for focus/blur/click; propagate additional dataRichard Gibson2019-03-201-3/+3
| | | | | | | | | | | | | | | | | | | | | Summary of the changes/fixes: 1. Trigger checkbox and radio click events identically (cherry-picked from b442abacbb8464f0165059e8da734e3143d0721f that was reverted before). 2. Manually trigger a native event before checkbox/radio handlers. 3. Add test coverage for triggering namespaced native-backed events. 4. Propagate extra parameters passed when triggering the click event to the handlers. 5. Intercept and preserve namespaced native-backed events. 6. Leverage native events for focus and blur. 7. Accept that focusin handlers may fire more than once for now. Fixes gh-1741 Fixes gh-3423 Fixes gh-3751 Fixes gh-4139 Closes gh-4279 Ref gh-1367 Ref gh-3494
* Core: Support passing nonce through jQuery.globalEvalMichał Gołębiowski-Owczarek2019-01-211-1/+1
| | | | | | Fixes gh-4278 Closes gh-4280 Ref gh-3541 Ref gh-4269
* Manipulation: Respect script nomodule attribute in DOM manipulationMichał Gołębiowski-Owczarek2019-01-211-1/+1
| | | | | | | | | | | | | PR #3869 added support for `<script type="module">` & some support for the `nomodule` attribute but with no tests for `nomodule` and with the attribute only respected on inline scripts. This commit adds support for source-based scripts as well. It also adds tests for `nomodule`, including making sure legacy browsers execute such scripts as they'd natively do - that's the whole point of `nomodule` scripts, after all. Fixes gh-4281 Closes gh-4282 Ref gh-3871 Ref gh-3869
* Core: Recognize Shadow DOM in attachment checksSaptak Sengupta2018-11-091-1/+1
| | | | | | | Allow `isAttached` to check Shadow DOM for attachment. Fixes gh-3504 Closes gh-3996 Ref gh-3977
* Core: Use isAttached to check for attachment of elementSaptak Sengupta2018-03-051-3/+4
| | | | | | | This change replaces the use of contains to check for attachment by isAttached function Closes gh-3977 Ref gh-3504
* Manipulation: Add support for scripts with module typebasil.belokon2018-01-161-2/+2
| | | | | Fixes gh-3871 Close gh-3869
* Core: deprecate jQuery.isFunctionJason Bedard2018-01-151-4/+5
| | | | Fixes gh-3609
* Manipulation: use `.children` to select tbody elementsTimmy Willison2018-01-081-1/+1
| | | | | - selectors beginning with a child combinator are not valid natively. This fixes the tests when using selector-native.js
* Manipulation: Reduce size by eliminating single-use variableRichard Gibson2017-11-221-5/+2
| | | Closes gh-3851
* Docs:Tests: Update IE/Edge-related support comments & testsMichał Gołębiowski2017-05-151-1/+1
| | | Closes gh-3661
* Revert "Event: Trigger checkbox and radio click events identically"Timmy Willison2017-03-201-3/+3
| | | | This reverts commit b442abacbb8464f0165059e8da734e3143d0721f.
* Build: fix tests in AMD modeTimmy Willison2017-03-061-1/+1
| | | | - nodeName was included at the wrong spot in dependency lists
* Core: Deprecate jQuery.nodeNamekaran-962017-03-011-3/+4
| | | | | Fixes gh-3475 Closes gh-3505
* Event: Trigger checkbox and radio click events identicallyAlex Padilla2017-01-191-3/+3
| | | | | Fixes gh-3423 Closes gh-3494
* Manipulation: Restrict the tbody search to child nodesRichard Gibson2017-01-091-1/+2
| | | | | | | For performance, use a querySelectorAll path instead of Javascript iteration. http://codepen.io/anon/pen/vywJjx?editors=1010 Fixes gh-3439 Closes gh-3463
* Build: ESLint detailsOleg Gaidarenko2016-06-111-0/+6
| | | | | | Use eslint pragmas, fix new errors, etc Closes gh-3148
* Build: Put all AMD modules in "src/" in strict modeMichał Gołębiowski2016-04-251-0/+2
| | | | Fixes gh-3073
* Docs: Update support comments to follow the new syntaxMichał Gołębiowski2016-03-301-4/+4
| | | | | 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-301-1/+1
| | | | All support comments were checked for Edge applicability.
* Docs: Updated links to https where they are supported.Jon Dufresne2016-01-131-1/+1
| | | | Close gh-2746
* Manipulation: Bring tagname regexes up to specLeonardo Braga2016-01-071-1/+1
| | | | | Fixes gh-2005 Closes gh-2634
* Core: do not expose second argument of the `jQuery.globalEval`Oleg Gaidarenko2015-12-021-2/+3
| | | | | Closes jquery/api.jquery.com#831 Closes gh-2718
* Manipulation: execute scripts from iframe in the iframe's contextTimmy Willison2015-11-091-1/+1
| | | | | Fixes gh-1757 Close gh-2696
* Data: avoid using delete on DOM nodesJason Bedard2015-09-081-2/+8
| | | | Closes gh-2479
* Manipulation: Switch rnoInnerhtml to a version more performant in IESean Henderson2015-09-081-1/+5
| | | | | | | | | | | | IE versions greater than 9 do not handle the old regular expression well with large html content. This is due to the use of a non-capturing group after a very common html character (<). Test suite: http://jsfiddle.net/Lwa0t5rp/3/ Microsoft bug: https://connect.microsoft.com/IE/feedback/details/1736512/ Fixes gh-2563 Closes gh-2574
* Data: Don't expose jQuery.acceptDataJason Bedard2015-09-081-3/+3
| | | | | | jQuery.acceptData is an undocumented internal API that shouldn't be exposed. Fixes gh-2555
* Build: Update jscs and lint filesOleg Gaidarenko2015-09-071-24/+27
| | | | Fixes gh-2056
* Data: remove user data in cleanDataJason Bedard2015-07-281-10/+15
| | | | | Fixes gh-2503 Closes gh-2480
* Manipulation: Remove an internal argument to the remove methodMichał Gołębiowski2015-06-141-25/+29
| | | | | Fixes gh-2301 Closes gh-2366
* Manipulation: privatize internal domManip() functionTimmy Willison2015-05-051-94/+93
| | | | Fixes gh-2225
* Manipulation: privatize buildFragment() functionTimmy Willison2015-05-051-151/+13
| | | | Fixes gh-2224
* Manipulation: Make an HTML interception pointRichard Gibson2015-04-301-2/+6
| | | | | Fixes gh-1747 Closes gh-2203
* Manipulation: Detect sneaky no-content replaceWith inputRichard Gibson2015-04-301-18/+21
| | | | | | | Fixes gh-2204 Ref 642e9a45579cfa90861b8ea71a95dd077775caaf Closes gh-1752 Closes gh-2206
* Data: restore explicit data removal of private data in cleanData.Rick Waldron2015-03-091-1/+1
| | | | | Fixes gh-2127 Closes gh-2132
* Data: move element cache to element[expando]Rick Waldron2015-03-041-20/+11
| | | | | | | | | - avoid explicit data.discard() cleanup calls - explicitly remove the data.events property, only when private data exists - reduces code footprint Fixes gh-1734 Close gh-1428
* Manipulation: don't auto-insert tbodyOleg Gaidarenko2015-02-111-6/+6
| | | | | Fixes gh-1835 Closes gh-2021
* Manipulation: simplify html wrappersOleg Gaidarenko2015-02-101-2/+13
| | | | | | | | Take advantage of html serialization for html wrappers - saves 26 bytes Plus add additional test for "col" element Closes gh-2031 Fixes gh-2002
* Manipulation: add support to tag-hyphenated elementsLeonardo Braga2015-01-131-2/+2
| | | | | Fixes #1987 Closes gh-1988
* Core: Standardize indexOf comparisonsRichard Gibson2015-01-101-1/+1
| | | | | | | | not present: `< 0` present: `> -1` at index: `=== N` Closes gh-1984
* Misc: Drop support for older browsers; update support commentsMichał Gołębiowski2014-11-031-6/+6
| | | | | | | | That includes Opera 12.x, Firefox<29, Safari<6.0 and some hacks for old Blackberry. Closes gh-1820 Refs gh-1815
* Docs: 1.x-master branch -> compat branch; 2.x branch -> master branchTimmy Willison2014-11-031-1/+0
|
* Manipulation: Tolerate XMLNode host object input to getAllRichard Gibson2014-09-041-2/+6
| | | | | | Fixes #15151 Ref 25712d77c3bc0221b5b2b9b9492c20a9cfbe1b17 Closes gh-1602
* Build: update grunt-jscs-checker and pass with the new rulesTimmy Willison2014-07-171-19/+21
|