-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependency: Update jquery to 3.4.1 #29837
Changes from all commits
b6a49a6
f7f5c25
20f4321
9faab45
d03635b
9172e26
2d823a3
66da39d
dccc1c0
3969ad0
435b9e0
fdeea9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4103,10 +4103,10 @@ describe('mouse state', () => { | |
const coordsChrome = { | ||
clientX: 492, | ||
clientY: 9, | ||
layerX: 492, | ||
layerY: 215, | ||
pageX: 492, | ||
pageY: 215, | ||
// pageY is 220.5 in headless Electron | ||
// since updating to jquery 3.2+....why... | ||
// pageY: 215, | ||
Comment on lines
+4107
to
+4109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
screenX: 492, | ||
screenY: 9, | ||
x: 492, | ||
|
@@ -4117,8 +4117,6 @@ describe('mouse state', () => { | |
const coordsFirefox = { | ||
clientX: 494, | ||
clientY: 10, | ||
// layerX: 492, | ||
// layerY: 215, | ||
pageX: 494, | ||
pageY: 226, | ||
screenX: 494, | ||
|
@@ -4130,8 +4128,6 @@ describe('mouse state', () => { | |
const coordsWebKit = { | ||
clientX: 500, | ||
clientY: 10, | ||
layerX: 500, | ||
layerY: 226, | ||
pageX: 500, | ||
pageY: 226, | ||
screenX: 500, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,10 @@ describe('src/cy/commands/actions/scroll', () => { | |
|
||
this.scrollBoth.scrollTop = 0 | ||
this.scrollBoth.scrollLeft = 0 | ||
|
||
// width/height of scrollable container - width of parent viewport (minux scrollbars) / 2 to get the center | ||
// browsers round up the pixel value so we need to round it | ||
this.halfScrollPixels = Math.round((500 - 100) / 2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just moving this calc to one place with some explanation because it took me a while to figure out these values from thin air. |
||
}) | ||
|
||
describe('subject', () => { | ||
|
@@ -86,7 +90,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
// in the percentage of the scroll (since going the height | ||
// of the container wouldn't scroll at all...) | ||
expect(this.scrollHoriz.get(0).scrollTop).to.eq(0) | ||
expect(this.scrollHoriz.get(0).scrollLeft).to.eq((500 - 100) / 2) | ||
expect(this.scrollHoriz.get(0).scrollLeft).to.eq(this.halfScrollPixels) | ||
}) | ||
}) | ||
}) | ||
|
@@ -108,7 +112,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
|
||
cy.get('#scroll-to-both').scrollTo('top').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(0) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) | ||
}) | ||
}) | ||
|
||
|
@@ -127,7 +131,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
|
||
cy.get('#scroll-to-both').scrollTo('left').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScrollPixels) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
}) | ||
}) | ||
|
@@ -137,8 +141,8 @@ describe('src/cy/commands/actions/scroll', () => { | |
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
|
||
cy.get('#scroll-to-both').scrollTo('center').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScrollPixels) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) | ||
}) | ||
}) | ||
|
||
|
@@ -147,7 +151,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
|
||
cy.get('#scroll-to-both').scrollTo('right').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScrollPixels) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100)) | ||
}) | ||
}) | ||
|
@@ -168,7 +172,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
|
||
cy.get('#scroll-to-both').scrollTo('bottom').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100)) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) | ||
}) | ||
}) | ||
|
||
|
@@ -229,8 +233,8 @@ describe('src/cy/commands/actions/scroll', () => { | |
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
|
||
cy.get('#scroll-to-both').scrollTo('50%', '50%').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScrollPixels) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) | ||
}) | ||
}) | ||
|
||
|
@@ -239,7 +243,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
|
||
cy.get('#scroll-to-both').scrollTo('0%', '50%').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScrollPixels) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) | ||
}) | ||
}) | ||
|
@@ -250,7 +254,7 @@ describe('src/cy/commands/actions/scroll', () => { | |
|
||
cy.get('#scroll-to-both').scrollTo('50%', '0%').then(function () { | ||
expect(this.scrollBoth.get(0).scrollTop).to.eq(0) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100) / 2) | ||
expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) | ||
}) | ||
}) | ||
}) | ||
|
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"; | ||
} |
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.
layerX and layerY properties are non-standard. We already had these mouse props commented out for Firefox because it was returning odd results. I'm removing the tests for these non-standard properties on all browsers. https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/layerX