-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dependency: Update jquery to 3.4.1 (#29837)
* Update jquery to 3.4.1 * refactor use of half scroll pixels with some explanation * remove layer coords from tests + comment out non-working page& value in chromium * Fix scrollTo calculation to match previous implementation * add changelog entry * patch jquery to use old calculations for width/height to avoid breaking change * revert scrollTo changes since jquery height/width calc is patched * Add issue to changelog * Make it a dev patch since it's a dev dependency
- Loading branch information
1 parent
a901ea3
commit 17fd597
Showing
7 changed files
with
252 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,223 @@ | ||
diff --git a/node_modules/jquery/README.md b/node_modules/jquery/README.md | ||
deleted file mode 100644 | ||
index 411a859..0000000 | ||
--- a/node_modules/jquery/README.md | ||
+++ /dev/null | ||
@@ -1,67 +0,0 @@ | ||
-# jQuery | ||
- | ||
-> jQuery is a fast, small, and feature-rich JavaScript library. | ||
- | ||
-For information on how to get started and how to use jQuery, please see [jQuery's documentation](http://api.jquery.com/). | ||
-For source files and issues, please visit the [jQuery repo](https://github.com/jquery/jquery). | ||
- | ||
-If upgrading, please see the [blog post for 3.4.1](https://blog.jquery.com/2019/05/01/jquery-3-4-1-triggering-focus-events-in-ie-and-finding-root-elements-in-ios-10/). This includes notable differences from the previous version and a more readable changelog. | ||
- | ||
-## Including jQuery | ||
- | ||
-Below are some of the most common ways to include jQuery. | ||
- | ||
-### Browser | ||
- | ||
-#### Script tag | ||
- | ||
-```html | ||
-<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script> | ||
-``` | ||
- | ||
-#### Babel | ||
- | ||
-[Babel](http://babeljs.io/) is a next generation JavaScript compiler. One of the features is the ability to use ES6/ES2015 modules now, even though browsers do not yet support this feature natively. | ||
- | ||
-```js | ||
-import $ from "jquery"; | ||
-``` | ||
- | ||
-#### Browserify/Webpack | ||
- | ||
-There are several ways to use [Browserify](http://browserify.org/) and [Webpack](https://webpack.github.io/). For more information on using these tools, please refer to the corresponding project's documention. In the script, including jQuery will usually look like this... | ||
- | ||
-```js | ||
-var $ = require("jquery"); | ||
-``` | ||
- | ||
-#### AMD (Asynchronous Module Definition) | ||
- | ||
-AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](http://requirejs.org/docs/whyamd.html). | ||
- | ||
-```js | ||
-define(["jquery"], function($) { | ||
- | ||
-}); | ||
-``` | ||
- | ||
-### Node | ||
- | ||
-To include jQuery in [Node](nodejs.org), first install with npm. | ||
- | ||
-```sh | ||
-npm install jquery | ||
-``` | ||
- | ||
-For jQuery to work in Node, a window with a document is required. Since no such window exists natively in Node, one can be mocked by tools such as [jsdom](https://github.com/tmpvar/jsdom). This can be useful for testing purposes. | ||
- | ||
-```js | ||
-require("jsdom").env("", function(err, window) { | ||
- if (err) { | ||
- console.error(err); | ||
- return; | ||
- } | ||
- | ||
- var $ = require("jquery")(window); | ||
-}); | ||
-``` | ||
diff --git a/node_modules/jquery/dist/jquery.js b/node_modules/jquery/dist/jquery.js | ||
index 773ad95..9e6076f 100644 | ||
--- a/node_modules/jquery/dist/jquery.js | ||
+++ b/node_modules/jquery/dist/jquery.js | ||
@@ -6534,69 +6534,100 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed | ||
return delta; | ||
} | ||
|
||
-function getWidthOrHeight( elem, dimension, extra ) { | ||
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { | ||
+ var i, | ||
+ val = 0; | ||
|
||
- // Start with computed style | ||
- var styles = getStyles( elem ), | ||
+ // If we already have the right measurement, avoid augmentation | ||
+ if ( extra === ( isBorderBox ? "border" : "content" ) ) { | ||
+ i = 4; | ||
|
||
- // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). | ||
- // Fake content-box until we know it's needed to know the true value. | ||
- boxSizingNeeded = !support.boxSizingReliable() || extra, | ||
- isBorderBox = boxSizingNeeded && | ||
- jQuery.css( elem, "boxSizing", false, styles ) === "border-box", | ||
- valueIsBorderBox = isBorderBox, | ||
+ // Otherwise initialize for horizontal or vertical properties | ||
+ } else { | ||
+ i = name === "width" ? 1 : 0; | ||
+ } | ||
|
||
- val = curCSS( elem, dimension, styles ), | ||
- offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); | ||
+ for ( ; i < 4; i += 2 ) { | ||
|
||
- // Support: Firefox <=54 | ||
- // Return a confounding non-pixel value or feign ignorance, as appropriate. | ||
- if ( rnumnonpx.test( val ) ) { | ||
- if ( !extra ) { | ||
- return val; | ||
+ // Both box models exclude margin, so add it if we want it | ||
+ if ( extra === "margin" ) { | ||
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); | ||
+ } | ||
+ | ||
+ if ( isBorderBox ) { | ||
+ | ||
+ // border-box includes padding, so remove it if we want content | ||
+ if ( extra === "content" ) { | ||
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); | ||
+ } | ||
+ | ||
+ // At this point, extra isn't border nor margin, so remove border | ||
+ if ( extra !== "margin" ) { | ||
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); | ||
+ } | ||
+ } else { | ||
+ | ||
+ // At this point, extra isn't content, so add padding | ||
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); | ||
+ | ||
+ // At this point, extra isn't content nor padding, so add border | ||
+ if ( extra !== "padding" ) { | ||
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); | ||
+ } | ||
} | ||
- val = "auto"; | ||
} | ||
|
||
+ return val; | ||
+} | ||
|
||
- // Fall back to offsetWidth/offsetHeight when value is "auto" | ||
- // This happens for inline elements with no explicit setting (gh-3571) | ||
- // Support: Android <=4.1 - 4.3 only | ||
- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) | ||
- // Support: IE 9-11 only | ||
- // Also use offsetWidth/offsetHeight for when box sizing is unreliable | ||
- // We use getClientRects() to check for hidden/disconnected. | ||
- // In those cases, the computed value can be trusted to be border-box | ||
- if ( ( !support.boxSizingReliable() && isBorderBox || | ||
- val === "auto" || | ||
- !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && | ||
- elem.getClientRects().length ) { | ||
+function getWidthOrHeight( elem, name, extra ) { | ||
|
||
+ // Start with offset property, which is equivalent to the border-box value | ||
+ var val, | ||
+ valueIsBorderBox = true, | ||
+ styles = getStyles( elem ), | ||
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; | ||
|
||
- // Where available, offsetWidth/offsetHeight approximate border box dimensions. | ||
- // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the | ||
- // retrieved value as a content box dimension. | ||
- valueIsBorderBox = offsetProp in elem; | ||
- if ( valueIsBorderBox ) { | ||
- val = elem[ offsetProp ]; | ||
- } | ||
+ // Support: IE <=11 only | ||
+ // Running getBoundingClientRect on a disconnected node | ||
+ // in IE throws an error. | ||
+ if ( elem.getClientRects().length ) { | ||
+ val = elem.getBoundingClientRect()[ name ]; | ||
} | ||
|
||
- // Normalize "" and auto | ||
- val = parseFloat( val ) || 0; | ||
+ // Some non-html elements return undefined for offsetWidth, so check for null/undefined | ||
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 | ||
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 | ||
+ if ( val <= 0 || val == null ) { | ||
|
||
- // Adjust for the element's box model | ||
+ // Fall back to computed then uncomputed css if necessary | ||
+ val = curCSS( elem, name, styles ); | ||
+ if ( val < 0 || val == null ) { | ||
+ val = elem.style[ name ]; | ||
+ } | ||
+ | ||
+ // Computed unit is not pixels. Stop here and return. | ||
+ if ( rnumnonpx.test( val ) ) { | ||
+ return val; | ||
+ } | ||
+ | ||
+ // Check for style in case a browser which returns unreliable values | ||
+ // for getComputedStyle silently falls back to the reliable elem.style | ||
+ valueIsBorderBox = isBorderBox && | ||
+ ( support.boxSizingReliable() || val === elem.style[ name ] ); | ||
+ | ||
+ // Normalize "", auto, and prepare for extra | ||
+ val = parseFloat( val ) || 0; | ||
+ } | ||
+ | ||
+ // Use the active box-sizing model to add/subtract irrelevant styles | ||
return ( val + | ||
- boxModelAdjustment( | ||
+ augmentWidthOrHeight( | ||
elem, | ||
- dimension, | ||
+ name, | ||
extra || ( isBorderBox ? "border" : "content" ), | ||
valueIsBorderBox, | ||
- styles, | ||
- | ||
- // Provide the current computed size to request scroll gutter calculation (gh-3589) | ||
- val | ||
+ styles | ||
) | ||
) + "px"; | ||
} |
Oops, something went wrong.
17fd597
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
17fd597
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
linux arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
17fd597
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
win32 x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
17fd597
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin x64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally:
17fd597
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Circle has built the
darwin arm64
version of the Test Runner.Learn more about this pre-release build at https://on.cypress.io/advanced-installation#Install-pre-release-version
Run this command to install the pre-release locally: