aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Selector: Re-expose jQuery.find.{tokenize,select,compile,setDocument}Michał Gołębiowski-Owczarek2023-06-122-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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
* Deprecated: Define `.hover()` using non-deprecated methodsMichał Gołębiowski-Owczarek2023-05-221-1/+3
| | | | | | Make the deprecated `.hover()` method not rely on other deprecated methods: `.mouseenter()` & `.mouseleave()`. Use `.on()` instead. Closes gh-5251
* Tests: Indicate Chrome 112 & Safari 16.4 pass the cssHas support testMichał Gołębiowski-Owczarek2023-04-051-2/+2
| | | | | | | | | | | Chrome 112 & Safari 16.4 introduce two changes: * `:has()` is non-forgiving * `CSS.supports( "selector(...)" )` parses everything in a non-forgiving way We no longer care about the latter but the former means the `cssHas` support test now passes. Closes gh-5225
* CSS: Make `offsetHeight( true )`, etc. include negative marginsMichał Gołębiowski-Owczarek2023-04-041-3/+6
| | | | | | | | | | | | This regressed in gh-3656 as the added logic to include scroll gutters in `.innerWidth()` / `.innerHeight()` didn't take negative margins into account. This broke handling of negative margins in `.offsetHeight( true )` and `.offsetWidth( true )`. To fix it, calculate margin delta separately and only add it after the scroll gutter adjustment logic. Fixes gh-3982 Closes gh-5234 Ref gh-3656
* Event: Avoid collisions between jQuery.event.special & Object.prototypeMichał Gołębiowski-Owczarek2023-04-031-2/+2
| | | | | | | This is a follow-up to similar changes to data & event storages from gh-4603. Closes gh-5235 Ref gh-4603
* Event: Simplify the check for saved data in leverageNativeMichał Gołębiowski-Owczarek2023-04-031-1/+1
| | | | | | | | | | Previously, when `leverageNative` handled async events, there was a case where an empty placeholder object was set as a result. Covering both such an object and `false` required a `length` check. However, this is not necessary since gh-5223 and the check was already simplified in other places; this one was missed. Closes gh-5236 Ref gh-5223
* Event: Make trigger(focus/blur/click) work with native handlersMichał Gołębiowski-Owczarek2023-03-271-4/+12
| | | | | | | | | | | | | | | | | | In `leverageNative`, instead of calling `event.stopImmediatePropagation()` which would abort both native & jQuery handlers, set the wrapper's `isImmediatePropagationStopped` property to a function returning `true`. Since for each element + type pair jQuery attaches only one native handler, there is also only one wrapper jQuery event so this achieves the goal: on the target element jQuery handlers don't fire but native ones do. Unfortunately, this workaround doesn't work for handlers on ancestors - since the native event is re-wrapped by a jQuery one on each level of the propagation, the only way to stop it for jQuery was to stop it for everyone via native `stopPropagation()`. This is not a problem for `focus`/`blur` which don't bubble, but it does also stop `click` on checkboxes and radios. We accept this limitation. Fixes gh-5015 Closes gh-5228
* Event: Simulate focus/blur in IE via focusin/focusoutMichał Gołębiowski-Owczarek2023-03-271-46/+56
| | | | | | | | | | | | | | | | | | | | | | | | In IE (all versions), `focus` & `blur` handlers are fired asynchronously but `focusin` & `focusout` are run synchronously. In other browsers, all those handlers are fired synchronously. Asynchronous behavior of these handlers in IE caused issues for IE (gh-4856, gh-4859). We now simulate `focus` via `focusin` & `blur` via `focusout` in IE to avoid these issues. This also let us simplify some tests. This commit also simplifies `leverageNative` - with IE now using `focusin` to simulate `focus` and `focusout` to simulate `blur`, we don't have to deal with async events in `leverageNative`. This also fixes broken `focus` triggers after first triggering it on a hidden element - previously, `leverageNative` assumed that the native `focus` handler not firing after calling the native `focus` method meant it would be handled later, asynchronously, which was not the case (gh-4950). Fixes gh-4856 Fixes gh-4859 Fixes gh-4950 Closes gh-5223 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Ajax: Don't treat array data as binaryMichał Gołębiowski-Owczarek2023-03-211-0/+1
| | | | | | | | | | | | | PR gh-5197 started treating all non-string non-plain-object `data` values as binary. However, `jQuery.ajax` also supports arrays as values of `data`. This change makes regular arrays no longer be considered binary data. Surprisingly, we had no tests for array `data` values; otherwise, we'd detect the issue earlier. This change also adds a few such missing tests. Closes gh-5203 Ref gh-5197
* Ajax: Allow `processData: true` even for binary dataMichał Gołębiowski-Owczarek2023-03-201-2/+5
| | | | | | | | | | The way gh-5197 implemented binary data handling, `processData` was being explicitly set to `false`. This is expected but it made it impossible to override it to `true`. The new logic will only set `processData` to `false` if it wasn't explicitly passed in original options. Closes gh-5205 Ref gh-5197
* Deferred: Rename `getStackHook` to `getErrorHook`Michał Gołębiowski-Owczarek2023-03-142-6/+9
| | | | | | | | | | | | | | Rename `jQuery.Deferred.getStackHook` to `jQuery.Deferred.getErrorHook` to indicate passing an error instance is usually a better choice - it works with source maps while a raw stack generally does not. In jQuery `3.7.0`, we'll keep both names, marking the old one as deprecated. In jQuery `4.0.0` we'll just keep the new one. This change implements the `4.0.0` version; PR gh-5212 implements the `3.7.0` one. Fixes gh-5201 Closes gh-5211 Ref gh-5212
* Selector: Stop relying on CSS.supports( "selector(...)" )Michał Gołębiowski-Owczarek2023-02-143-55/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | `CSS.supports( "selector(...)" )` has different semantics than selectors passed to `querySelectorAll`. Apart from the fact that the former returns `false` for unrecognized selectors and the latter throws, `qSA` is more forgiving and accepts some invalid selectors, auto-correcting them where needed - for example, mismatched brackers are auto-closed. This behavior difference is breaking for many users. To add to that, a recent CSSWG resolution made `:is()` & `:where()` the only pseudos with forgiving parsing; browsers are in the process of making `:has()` parsing unforgiving. Taking all that into account, we go back to our previous try-catch approach without relying on `CSS.supports( "selector(...)" )`. The only difference is we detect forgiving parsing in `:has()` and mark the selector as buggy. The PR also updates `playwright-webkit` so that we test against a version of WebKit that already has non-forgiving `:has()`. Fixes gh-5194 Closes gh-5206 Ref gh-5098 Ref gh-5107 Ref w3c/csswg-drafts#7676 Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
* Selector: Backport jQuery selection context logic to selector-nativeMichał Gołębiowski-Owczarek2023-02-1320-335/+465
| | | | | | | | | | | | | | | | | | | | | | 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
* Ajax: Support binary data (including FormData)Michał Gołębiowski-Owczarek2023-02-013-3/+21
| | | | | | | | | | | | Two changes have been applied: * prefilters are now applied before data is converted to a string; this allows prefilters to disable such a conversion * a prefilter for binary data is added; it disables data conversion for non-string non-plain-object `data`; for `FormData` bodies, it removes manually-set `Content-Type` header - this is required as browsers need to append their own boundary to the header Ref gh-4150 Closes gh-5197
* Deferred: Respect source maps in jQuery.Deferred.exceptionHookMichał Gołębiowski-Owczarek2023-02-011-2/+2
| | | | | | | | | | | | | | | | | | So far, `jQuery.Deferred.exceptionHook` used to log error message and stack separately. However, that breaks browser applying source maps against the stack trace - most browsers require logging an error instance. This change makes us do exactly that. One drawback of the change is that in IE 11 previously stack was printed directly and now just the error summary; to get to the actual stack trace, three clicks are required. This seems to be a low price to pay for having source maps work in all the other browsers, though. Safari with the new change requires one click to get to the stack trace which sounds manageable. Fixes gh-3179 Closes gh-5192 Ref https://crbug.com/622227
* Ajax: Support `headers` for script transport even when cross-domainMichał Gołębiowski-Owczarek2023-02-011-10/+18
| | | | | | | | | | | | | | | | The AJAX script transport has two versions: XHR + `jQuery.globalEval` or appending a script tag (note that `jQuery.globalEval` also appends a script tag now, but inline). The former cannot support the `headers` option which has so far not been taken into account. For jQuery 3.x, the main consequence was the option not being respected for cross-domain requests. Since in 4.x we use the latter way more often, the option was being ignored in more cases. The transport now checks whether the `headers` option is specified and uses the XHR way unless `scriptAttrs` are specified as well. Fixes gh-5142 Closes gh-5193
* Selector: Make selector lists work with `qSA` againMichał Gołębiowski-Owczarek2022-12-193-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jQuery 3.6.2 started using `CSS.supports( "selector(SELECTOR)" )` before using `querySelectorAll` on the selector. This was to solve gh-5098 - some selectors, like `:has()`, now had their parameters parsed in a forgiving way, meaning that `:has(:fakepseudo)` no longer throws but just returns 0 results, breaking that jQuery mechanism. A recent spec change made `CSS.supports( "selector(SELECTOR)" )` always use non-forgiving parsing, allowing us to use this API for what we've used `try-catch` before. To solve the issue on the spec side for older jQuery versions, `:has()` parameters are no longer using forgiving parsing in the latest spec update but our new mechanism is more future-proof anyway. However, the jQuery implementation has a bug - in `CSS.supports( "selector(SELECTOR)" )`, `SELECTOR` needs to be a `<complex-selector>` and not a `<complex-selector-list>`. Which means that selector lists now skip `qSA` and go to the jQuery custom traversal: ```js CSS.supports("selector(div:valid, span)"); // false CSS.supports("selector(div:valid)"); // true CSS.supports("selector(span)"); // true ``` To solve this, this commit wraps the selector list passed to `CSS.supports( "selector(:is(SELECTOR))" )` with `:is`, making it a single selector again. See: * https://w3c.github.io/csswg-drafts/css-conditional-4/#at-supports-ext * https://w3c.github.io/csswg-drafts/selectors-4/#typedef-complex-selector * https://w3c.github.io/csswg-drafts/selectors-4/#typedef-complex-selector-list Fixes gh-5177 Closes gh-5178 Ref w3c/csswg-drafts#7280
* Core:Selector: Move jQuery.contains from the selector to the core moduleMichał Gołębiowski-Owczarek2022-12-125-19/+14
| | | | | | | 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: Implement the `uniqueSort` chainable methodMichał Gołębiowski-Owczarek2022-11-281-0/+5
| | | | | | | | | Some APIs, like `.prevAll()`, return elements in the reversed order, causing confusing behavior when used with wrapping methods (see gh-5149 for more info) To provide an easy workaround, this commit implements a chainable `uniqueSort` method on jQuery objects, an equivalent of `jQuery.uniqueSort`. Fixes gh-5166 Closes gh-5168
* Tests: Indicate Firefox 106+ passes the `cssSupportsSelector` testMichał Gołębiowski-Owczarek2022-11-251-1/+1
| | | | | | Firefox 106 adjusted to the spec mandating that `CSS.supports("selector(...)")` uses non-forgiving parsing which makes it pass the relevant support test. Closes gh-5141
* 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:Manipulation: Fix DOM manip within template contentsMichał Gołębiowski-Owczarek2022-11-141-4/+3
| | | | | | | | | | | | | | | | The `<template/>` element `contents` property is a document fragment that may have a `null` `documentElement`. In Safari 16 this happens in more cases due to recent spec changes - in particular, even if that document fragment is explicitly adopted into an outer document. We're testing both of those cases now. The crash used to happen in `jQuery.contains`. As it turns out, we don't need to query the supposed container `documentElement` if it has the `Node.DOCUMENT_NODE` (9) `nodeType`; we can call `.contains()` directly on the `document`. That avoids the crash. Fixes gh-5147 Closes gh-5158
* Ajax: Support `null` as success functions in `jQuery.get`Michał Gołębiowski-Owczarek2022-10-172-3/+3
| | | | | | | | | | | | | According to the docs, one can use `null` as a success function in `jQuery.get` of `jQuery.post` so the following: ```js await jQuery.get( "https://httpbin.org/json", null, "text" ) ``` should get the text result. However, this shortcut hasn't been working so far. Fixes gh-4989 Closes gh-5139
* Selector: Drop support for legacy pseudos, test custom pseudosMichał Gołębiowski-Owczarek2022-10-111-21/+2
| | | | | | | | | This backports custom pseudos tests from Sizzle; they were missed in original test backports. Also, the support for legacy custom pseudos has been dropped. The `jQuery.expr` test cleanup has been wrapped in `try-finally` for cleaner test isolation in case anything goes wrong. Closes gh-5137
* Manipulation: Extract domManip to a separate fileMichał Gołębiowski-Owczarek2022-10-102-104/+110
| | | | | | | | | | | We've already had `buildFragment` extracted to a separate file long ago. `domManip` is quite a complex & crucial API and so far it has existed within the `manipulation.js` module. Extracting it makes the module shorter and easier to understand. A few comments / messages in tests have also been updated to not suggest there's a public `jQuery.domManip` API - it's been private since 3.0.0. Closes gh-5138
* CSS: Return `undefined` for whitespace-only CSS variable values (#5120)Michał Gołębiowski-Owczarek2022-10-031-4/+24
| | | | | | | | | | | | | | | | The spec requires that CSS variable values are trimmed. In browsers that do this - mainly, Safari, but also Firefox if the value only has leading whitespace - we currently return undefined; in other browsers, we return an empty string as the logic to fall back to undefined happens before trimming. This commit adds another explicit callback to `undefined` to have it consistent across browsers. Also, more explicit comments about behaviors we need to work around in various browsers have been added. Closes gh-5120 Ref gh-5106
* CSS: Don’t trim whitespace of undefined custom propertyAnders Kaseorg2022-09-191-1/+1
| | | | | | Fixes gh-5105 Closes gh-5106 Signed-off-by: Anders Kaseorg <andersk@mit.edu>
* Selector: Use jQuery `:has` if `CSS.supports(selector(...))` non-compliantMichał Gołębiowski-Owczarek2022-09-193-11/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | jQuery has followed the following logic for selector handling for ages: 1. Modify the selector to adhere to scoping rules jQuery mandates. 2. Try `qSA` on the modified selector. If it succeeds, use the results. 3. If `qSA` threw an error, run the jQuery custom traversal instead. It worked fine so far but now CSS has a concept of forgiving selector lists that some selectors like `:is()` & `:has()` use. That means providing unrecognized selectors as parameters to `:is()` & `:has()` no longer throws an error, it will just return no results. That made browsers with native `:has()` support break selectors using jQuery extensions inside, e.g. `:has(:contains("Item"))`. Detecting support for selectors can also be done via: ```js CSS.supports( "selector(SELECTOR_TO_BE_TESTED)" ) ``` which returns a boolean. There was a recent spec change requiring this API to always use non-forgiving parsing: https://github.com/w3c/csswg-drafts/issues/7280#issuecomment-1143852187 However, no browsers have implemented this change so far. To solve this, two changes are being made: 1. In browsers supports the new spec change to `CSS.supports( "selector()" )`, use it before trying `qSA`. 2. Otherwise, add `:has` to the buggy selectors list. Fixes gh-5098 Closes gh-5107 Ref w3c/csswg-drafts#7676
* Core: Drop the root parameter of jQuery.fn.initMichał Gołębiowski-Owczarek2022-08-291-8/+4
| | | | | | | | | | The third parameter of `jQuery.fn.init` - `root` - was just needed to support `jQuery.sub`. Since this API has been removed in jQuery 1.9.0 and Migrate 3.x is not filling it in, this parameter is no longer needed. This parameter has never been documented but it's safer to remove it in a major update. Closes gh-5096
* Effects: Remove jQuery.fx.intervalMichał Gołębiowski-Owczarek2022-03-011-2/+1
| | | | | | | `jQuery.fx.interval` has been deprecated since jQuery 3.0.0 but it has been still used in jQuery code until this change. This commit removes the definition and explicitly uses the `13` number in its place. Closes gh-5017
* 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
* Core: Don't rely on splice being present on inputBruno PIERRE2022-01-242-1/+5
| | | | | | | | | | Without this fix calling `jQuery.uniqueSort` on an array-like can result in: TypeError: results.splice is not a function at Function.jQuery.uniqueSort (https://code.jquery.com/jquery-git.js:664:12) at jQuery.fn.init.find (https://code.jquery.com/jquery-git.js:2394:27) at gocusihafe.js:3:4 Closes gh-4986
* Docs: Remove links to Web Archive from sourceMichał Gołębiowski-Owczarek2022-01-042-2/+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-0420-38/+41
| | | | | | | | | | | | | 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: Justify use of rtrim on CSS property valuesRichard Gibson2022-01-031-0/+6
| | | | | | | CSS does not acknowledge carriage return or form feed characters as whitespace but it does replace them with whitespace, making it acceptable to use `rtrim`. Closes gh-4956
* 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:Manipulation: Add basic TrustedHTML supportMichał Gołębiowski-Owczarek2021-09-306-42/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This ensures HTML wrapped in TrustedHTML can be used as an input to jQuery manipulation methods in a way that doesn't violate the `require-trusted-types-for` Content Security Policy directive. This commit builds on previous work needed for trusted types support, including gh-4642 and gh-4724. One restriction is that while any TrustedHTML wrapper should work as input for jQuery methods like `.html()` or `.append()`, for passing directly to the `jQuery` factory the string must start with `<` and end with `>`; no trailing or leading whitespaces are allowed. This is necessary as we cannot parse out a part of the input for further construction; that would violate the CSP rule - and that's what's done to HTML input not matching these constraints. No trusted types API is used explicitly in source; the majority of the work is ensuring we don't pass the input converted to string to APIs that would eventually assign it to `innerHTML`. This extra cautiousness is caused by the API being Blink-only, at least for now. The ban on passing strings to `innerHTML` means support tests relying on such assignments are impossible. We don't currently have such tests on the `main` branch but we used to have many of them in the 3.x & older lines. If there's a need to re-add such a test, we'll need an escape hatch to skip them for apps needing CSP-enforced TrustedHTML. See https://web.dev/trusted-types/ for more information about TrustedHTML. Fixes gh-4409 Closes gh-4927 Ref gh-4642 Ref gh-4724
* CSS: Trim whitespace surrounding CSS Custom Properties valuesfecore12021-09-237-5/+20
| | | | | | | | 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
* Manipulation: Don't remove HTML comments from scriptsMichał Gołębiowski-Owczarek2021-07-191-4/+2
| | | | | | | | | | | | | | | | | | | 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 also used to strip CDATA sections. However, 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. We've preserved that behavior for backwards compatibility in 3.x but we're removing it for 4.0. Fixes gh-4904 Closes gh-4906
* Event: Don't break focus triggering after `.on(focus).off(focus)`Michał Gołębiowski-Owczarek2021-05-101-4/+4
| | | | | | | | | | | | | | | | | | | The `_default` function in the special event settings for focus/blur has always returned `true` since gh-4813 as the event was already being fired from `leverageNative`. However, that only works if there's an active handler on that element; this made a quick consecutive call: ```js elem.on( "focus", function() {} ).off( "focus" ); ``` make subsequent `.trigger( "focus" )` calls to not do any triggering. The solution, already used in a similar `_default` method for the `click` event, is to check for the `dataPriv` entry on the element for the focus event (similarly for blur). Fixes gh-4867 Closes gh-4885
* Support: ensure display is set to block for the support divTimmy Willison2021-02-171-0/+9
| | | | | | | | | | * Support: ensure display is set to block for the support div - Fixes an issue with the support test in iframes in Android 8 Chrome 86+, where display: inline resulted in unexpected height values. Close gh-4845 Fixes gh-4832
* Ajax: Don't auto-execute scripts unless dataType providedMichał Gołębiowski-Owczarek2021-01-261-11/+2
| | | | | | | | | | | | | | PR gh-2588 made jQuery stop auto-execute cross-domain scripts unless `dataType: "script"` was explicitly provided; this change landed in jQuery 3.0.0. This change extends that logic same-domain scripts as well. After this change, to request a script under a provided URL to be evaluated, you need to provide `dataType: "script` in `jQuery.ajax` options or to use `jQuery.getScript`. Fixes gh-4822 Closes gh-4825 Ref gh-2432 Ref gh-2588
* Deferred: Rename master to primaryMichał Gołębiowski-Owczarek2021-01-121-8/+8
| | | Closes gh-4828
* Dimensions: Add offset prop fallback to FF for unreliable TR dimensionsTimmy Willison2021-01-112-14/+68
| | | | | | | | Firefox incorrectly (or perhaps correctly) includes table borders in computed dimensions, but they are the only one. Workaround this by testing for it and falling back to offset properties Fixes gh-4529 Closes gh-4808
* Core: Report browser errors in parseXMLMichał Gołębiowski-Owczarek2020-12-081-6/+11
| | | | Fixes gh-4784 Closes gh-4816
* Core: Make jQuery.isXMLDoc accept falsy inputMichał Gołębiowski-Owczarek2020-12-071-2/+2
| | | | Fixes gh-4782 Closes gh-4814
* Event: Make focus re-triggering not focus the original element backMichał Gołębiowski-Owczarek2020-12-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | If during a focus handler another focus event is triggered: ```js elem1.on( "focus", function() { elem2.trigger( "focus" ); } ); ``` due to their synchronous nature everywhere outside of IE the hack added in gh-4279 to leverage native events causes the native `.focus()` method to be called last for the initial element, making it steal the focus back. Since the native method is already being called in `leverageNative`, we can skip that final call. This aligns with changes to the `_default` method for the `click` event that were added when `leverageNative` was introduced there. A side effect of this change is that now `focusin` will only propagate to the document for the last focused element. This is a change in behavior but it also aligns us better with how this works with native methods. Fixes gh-4382 Closes gh-4813 Ref gh-4279
* Event: Don't crash if an element is removed on blurMichał Gołębiowski-Owczarek2020-10-191-1/+7
| | | | | | | | | | In Chrome, if an element having a `focusout` handler is blurred by clicking outside of it, it invokes the handler synchronously. If that handler calls `.remove()` on the element, the data is cleared, leaving private data undefined. We're reading a property from that data so we need to guard against this. Fixes gh-4417 Closes gh-4799
* Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)Michał Gołębiowski-Owczarek2020-09-2215-147/+70
| | | | | | | | | | | | 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
* Manipulation: Respect script crossorigin attribute in DOM manipulation高灰2020-09-222-1/+3
| | | | | | Fixes gh-4542 Closes gh-4563 Co-authored-by: Michał Gołębiowski-Owczarek <m.goleb@gmail.com>