diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index c357ee1adcbe..3269e27caf96 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -9,6 +9,10 @@ _Released 12/3/2024 (PENDING)_ - Prebuilt binaries for Linux are no longer compatible with Linux distributions based on glibc <2.28, for example: Ubuntu 14-18, RHEL 7, CentOS 7, Amazon Linux 2. Addresses [#29601](https://github.com/cypress-io/cypress/issues/29601). - The undocumented methods `Cypress.backend('firefox:force:gc')` and `Cypress.backend('log:memory:pressure')` were removed. Addresses [#30222](https://github.com/cypress-io/cypress/issues/30222). +**Dependency Updates:** + +- Updated `jQuery` from `3.4.1` to `3.7.1`. Addressed in [#30345](https://github.com/cypress-io/cypress/pull/30345). + ## 13.15.1 _Released 10/1/2024 (PENDING)_ diff --git a/package.json b/package.json index 8f6aeb311e83..e8d5846cfde0 100644 --- a/package.json +++ b/package.json @@ -262,7 +262,7 @@ "**/@types/cheerio": "0.22.21", "**/@types/enzyme": "3.10.5", "**/@types/react": "16.9.50", - "**/jquery": "3.4.1", + "**/jquery": "3.7.1", "**/pretty-format": "26.4.0", "**/sharp": "0.29.3", "**/socket.io-parser": "4.0.5", diff --git a/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts b/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts index b6ce3b93d8cf..ed9ebc5f3efa 100644 --- a/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts +++ b/packages/app/cypress/e2e/cypress-in-cypress-component.cy.ts @@ -37,7 +37,8 @@ describe('Cypress In Cypress CT', { viewportWidth: 1500, defaultCommandTimeout: cy.get('body').click() cy.findByTestId('playground-activator').click() - cy.findByTestId('playground-selector').clear().type('[data-cy-root]') + cy.findByTestId('playground-selector').clear() + cy.findByTestId('playground-selector').type('[data-cy-root]') // TODO: restore when Percy CSS is fixed. See https://github.com/cypress-io/cypress/issues/23435 // snapshotAUTPanel('cy.get selector') diff --git a/packages/app/src/runner/aut-iframe.ts b/packages/app/src/runner/aut-iframe.ts index 65030131559f..c73aff2da0a3 100644 --- a/packages/app/src/runner/aut-iframe.ts +++ b/packages/app/src/runner/aut-iframe.ts @@ -14,6 +14,7 @@ import Highlight from './selector-playground/Highlight.ce.vue' type $CypressJQuery = any const sizzleRe = /sizzle/i +const jQueryRe = /jquery/i export class AutIframe { debouncedToggleSelectorPlayground: DebouncedFunc<(isEnabled: any) => void> @@ -540,8 +541,8 @@ export class AutIframe { $el = $root.find(selector) } } catch (err) { - // if not a sizzle error, ignore it and let $el be null - if (!sizzleRe.test(err.stack)) throw err + // if not a sizzle or jQuery error, ignore it and let $el be null + if (!(sizzleRe.test(err.stack) || jQueryRe.test(err.stack))) throw err } return $el diff --git a/packages/driver/cypress/e2e/commands/actions/scroll.cy.js b/packages/driver/cypress/e2e/commands/actions/scroll.cy.js index d18f45fb3e7a..508cb0053490 100644 --- a/packages/driver/cypress/e2e/commands/actions/scroll.cy.js +++ b/packages/driver/cypress/e2e/commands/actions/scroll.cy.js @@ -28,9 +28,15 @@ 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 + // width or height of DOM in pixels + this.scrollableContainerWidthHeight = 500 + this.elementWidthHeight = 100 + this.scrollBarWidthHeight = 15 + + // divide by 2 to get the center // browsers round up the pixel value so we need to round it - this.halfScrollPixels = Math.round((500 - 100) / 2) + this.halfScroll = Math.round((this.scrollableContainerWidthHeight - this.elementWidthHeight) / 2) + this.fullScroll = Math.round(this.scrollableContainerWidthHeight - this.elementWidthHeight) }) describe('subject', () => { @@ -48,7 +54,9 @@ describe('src/cy/commands/actions/scroll', () => { it('can use window', () => { cy.window().scrollTo('10px').then((win) => { - expect(win.scrollX).to.eq(10) + // Firefox doesn't round this number like other browsers + // So we round in the test to get consistent results here + expect(Math.round(win.scrollX)).to.eq(10) }) }) @@ -86,11 +94,10 @@ describe('src/cy/commands/actions/scroll', () => { expect(this.scrollHoriz.get(0).scrollLeft).to.eq(0) cy.get('#scroll-to-horizontal').scrollTo('50%').then(function () { - // they don't calculate the height of the container - // 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(this.halfScrollPixels) + // since there is no veritical scrollbar to take into account + // this is just half of the basic width + expect(this.scrollHoriz.get(0).scrollLeft).to.eq(this.halfScroll) }) }) }) @@ -112,7 +119,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(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScroll) }) }) @@ -122,7 +129,7 @@ describe('src/cy/commands/actions/scroll', () => { cy.get('#scroll-to-both').scrollTo('topRight').then(function () { expect(this.scrollBoth.get(0).scrollTop).to.eq(0) - expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100)) + expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.fullScroll) }) }) @@ -131,7 +138,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(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScroll) expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) }) }) @@ -141,8 +148,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(this.halfScrollPixels) - expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScroll) + expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScroll) }) }) @@ -151,8 +158,8 @@ 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(this.halfScrollPixels) - expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100)) + expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScroll) + expect(this.scrollBoth.get(0).scrollLeft).to.eq((this.fullScroll)) }) }) @@ -161,7 +168,7 @@ describe('src/cy/commands/actions/scroll', () => { expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) cy.get('#scroll-to-both').scrollTo('bottomLeft').then(function () { - expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100)) + expect(this.scrollBoth.get(0).scrollTop).to.eq((this.fullScroll)) expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) }) }) @@ -171,8 +178,8 @@ describe('src/cy/commands/actions/scroll', () => { expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) 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(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollTop).to.eq((this.fullScroll)) + expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScroll) }) }) @@ -181,8 +188,8 @@ describe('src/cy/commands/actions/scroll', () => { expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) cy.get('#scroll-to-both').scrollTo('bottomRight').then(function () { - expect(this.scrollBoth.get(0).scrollTop).to.eq((500 - 100)) - expect(this.scrollBoth.get(0).scrollLeft).to.eq((500 - 100)) + expect(this.scrollBoth.get(0).scrollTop).to.eq((this.fullScroll)) + expect(this.scrollBoth.get(0).scrollLeft).to.eq((this.fullScroll)) }) }) }) @@ -233,8 +240,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(this.halfScrollPixels) - expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScroll) + expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScroll) }) }) @@ -243,7 +250,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(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollTop).to.eq(this.halfScroll) expect(this.scrollBoth.get(0).scrollLeft).to.eq(0) }) }) @@ -254,7 +261,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(this.halfScrollPixels) + expect(this.scrollBoth.get(0).scrollLeft).to.eq(this.halfScroll) }) }) }) @@ -353,12 +360,8 @@ describe('src/cy/commands/actions/scroll', () => { // https://github.com/cypress-io/cypress/issues/1924 it('skips scrollability check', () => { - const scrollTo = cy.spy($.fn, 'scrollTo') - cy.get('button:first').scrollTo('bottom', { ensureScrollable: false }).then(() => { cy.stub(Cypress.ensure, 'isScrollable') - - expect(scrollTo).to.be.calledWithMatch({}, { ensureScrollable: false }) expect(Cypress.ensure.isScrollable).not.to.be.called }) }) diff --git a/packages/driver/cypress/e2e/commands/assertions.cy.js b/packages/driver/cypress/e2e/commands/assertions.cy.js index d0f2bc673ffa..3da8fa44a2fe 100644 --- a/packages/driver/cypress/e2e/commands/assertions.cy.js +++ b/packages/driver/cypress/e2e/commands/assertions.cy.js @@ -2650,18 +2650,6 @@ describe('src/cy/commands/assertions', () => { expect({}).to.have.focus }) - - it('calls into custom focus pseudos', () => { - cy.$$('button:first').focus() - const stub = cy.spy($.expr.pseudos, 'focus').as('focus') - - expect(cy.$$('button:first')).to.have.focus - - cy.get('button:first').should('have.focus') - .then(() => { - expect(stub).to.be.calledTwice - }) - }) }) context('match', () => { diff --git a/packages/driver/cypress/e2e/dom/visibility.cy.ts b/packages/driver/cypress/e2e/dom/visibility.cy.ts index fc747350b5c3..f6d94412e10b 100644 --- a/packages/driver/cypress/e2e/dom/visibility.cy.ts +++ b/packages/driver/cypress/e2e/dom/visibility.cy.ts @@ -168,7 +168,7 @@ describe('src/cypress/dom/visibility', () => { } // ensure all tests run against a scrollable window - const scrollThisIntoView = add('
Should be in view
') + const scrollThisIntoView = add('
Should be in view
') this.$visHidden = add('') this.$parentVisHidden = add('') diff --git a/packages/driver/cypress/e2e/dom/visibility_shadow_dom.cy.ts b/packages/driver/cypress/e2e/dom/visibility_shadow_dom.cy.ts index 5d1b6779e432..18e353ee1691 100644 --- a/packages/driver/cypress/e2e/dom/visibility_shadow_dom.cy.ts +++ b/packages/driver/cypress/e2e/dom/visibility_shadow_dom.cy.ts @@ -27,7 +27,7 @@ describe('src/cypress/dom/visibility - shadow dom', () => { } // ensure all tests run against a scrollable window - const scrollThisIntoView = $(`
Should be in view
`).appendTo(cy.$$('body')) + const scrollThisIntoView = $(`
Should be in view
`).appendTo(cy.$$('body')) // scroll the 2nd element into view so that // there is always a scrollTop so we ensure diff --git a/packages/driver/package.json b/packages/driver/package.json index a59fb2d116f4..5eae37cde49d 100644 --- a/packages/driver/package.json +++ b/packages/driver/package.json @@ -55,7 +55,7 @@ "is-valid-domain": "0.0.20", "is-valid-hostname": "1.0.1", "jimp": "0.22.12", - "jquery": "3.4.1", + "jquery": "3.7.1", "js-cookie": "3.0.5", "json-stable-stringify": "1.0.1", "lodash": "^4.17.21", diff --git a/packages/driver/patches/jquery+3.4.1.dev.patch b/packages/driver/patches/jquery+3.7.1.dev.patch similarity index 59% rename from packages/driver/patches/jquery+3.4.1.dev.patch rename to packages/driver/patches/jquery+3.7.1.dev.patch index 4b7abd8f32fd..75d47694f60b 100644 --- a/packages/driver/patches/jquery+3.4.1.dev.patch +++ b/packages/driver/patches/jquery+3.7.1.dev.patch @@ -1,17 +1,17 @@ diff --git a/node_modules/jquery/README.md b/node_modules/jquery/README.md deleted file mode 100644 -index 411a859..0000000 +index fcc11f3..0000000 --- a/node_modules/jquery/README.md +++ /dev/null -@@ -1,67 +0,0 @@ +@@ -1,60 +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 information on how to get started and how to use jQuery, please see [jQuery's documentation](https://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. +-If upgrading, please see the [blog post for 3.7.1](https://blog.jquery.com/2023/08/28/jquery-3-7-1-released-reliable-table-row-dimensions/). This includes notable differences from the previous version and a more readable changelog. - -## Including jQuery - @@ -22,95 +22,58 @@ index 411a859..0000000 -#### Script tag - -```html -- +- -``` - --#### Babel +-#### Webpack / Browserify / 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. +-There are several ways to use [Webpack](https://webpack.js.org/), [Browserify](http://browserify.org/) or [Babel](https://babeljs.io/). For more information on using these tools, please refer to the corresponding project's documentation. In the script, including jQuery will usually look like this: - -```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... +-If you need to use jQuery in a file that's not an ECMAScript module, you can use the CommonJS syntax: - -```js --var $ = require("jquery"); +-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). +-AMD is a module format built for the browser. For more information, we recommend [require.js' documentation](https://requirejs.org/docs/whyamd.html). - -```js --define(["jquery"], function($) { +-define( [ "jquery" ], function( $ ) { - --}); +-} ); -``` - -### Node - --To include jQuery in [Node](nodejs.org), first install with npm. +-To include jQuery in [Node](https://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. +-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/jsdom/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); --}); +-const { JSDOM } = require( "jsdom" ); +-const { window } = new JSDOM( "" ); +-const $ = require( "jquery" )( window ); -``` diff --git a/node_modules/jquery/dist/jquery.js b/node_modules/jquery/dist/jquery.js -index 773ad95..84ca2f6 100644 +index 1a86433..8215d0c 100644 --- a/node_modules/jquery/dist/jquery.js +++ b/node_modules/jquery/dist/jquery.js -@@ -1100,19 +1100,17 @@ setDocument = Sizzle.setDocument = function( node ) { - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - -- // Support: IE 9-11, Edge -- // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) -- if ( preferredDoc !== document && -- (subWindow = document.defaultView) && subWindow.top !== subWindow ) { -+ // Support: IE 9 - 11+, Edge 12 - 18+ -+ // Accessing iframe documents after unload throws "permission denied" errors (see trac-13936) -+ // Support: IE 11+, Edge 17 - 18+ -+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing -+ // two documents; shallow comparisons work. -+ // eslint-disable-next-line eqeqeq -+ if ( docElem.msMatchesSelector && preferredDoc != document && -+ ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - -- // Support: IE 11, Edge -- if ( subWindow.addEventListener ) { -- subWindow.addEventListener( "unload", unloadHandler, false ); -- -- // Support: IE 9 - 10 only -- } else if ( subWindow.attachEvent ) { -- subWindow.attachEvent( "onunload", unloadHandler ); -- } -+ // Support: IE 9 - 11+, Edge 12 - 18+ -+ subWindow.addEventListener( "unload", unloadHandler ); - } - - /* Attributes -@@ -6534,69 +6491,100 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed - return delta; +@@ -6647,78 +6647,100 @@ function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computed + return delta + marginDelta; } -function getWidthOrHeight( elem, dimension, extra ) { -+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { ++function augmentWidthOrHeight( elem, dimension, extra, isBorderBox, styles ) { + var i, + val = 0; @@ -128,7 +91,7 @@ index 773ad95..84ca2f6 100644 - valueIsBorderBox = isBorderBox, + // Otherwise initialize for horizontal or vertical properties + } else { -+ i = name === "width" ? 1 : 0; ++ i = dimension === "width" ? 1 : 0; + } - val = curCSS( elem, dimension, styles ), @@ -143,15 +106,26 @@ index 773ad95..84ca2f6 100644 + // Both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); -+ } -+ + } +- val = "auto"; +- } + + if ( isBorderBox ) { -+ + +- // Support: IE 9 - 11 only +- // Use offsetWidth/offsetHeight for when box sizing is unreliable. +- // In those cases, the computed value can be trusted to be border-box. +- if ( ( !support.boxSizingReliable() && isBorderBox || + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } -+ + +- // Support: IE 10 - 11+, Edge 15 - 18+ +- // IE/Edge misreport `getComputedStyle` of table rows with width/height +- // set in CSS while `offset*` properties report correct values. +- // Interestingly, in some cases IE 9 doesn't suffer from this issue. +- !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + // 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 ); @@ -160,32 +134,27 @@ index 773ad95..84ca2f6 100644 + + // At this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); -+ + +- // Fall back to offsetWidth/offsetHeight when value is "auto" +- // This happens for inline elements with no explicit setting (gh-3571) +- val === "auto" || + // 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"; - } ++ } ++ } +- // Support: Android <=4.1 - 4.3 only +- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) +- !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + 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" ) && +- // Make sure the element is visible & connected - elem.getClientRects().length ) { -+function getWidthOrHeight( elem, name, extra ) { - ++function getWidthOrHeight( elem, dimension, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var val, + valueIsBorderBox = true, @@ -203,7 +172,7 @@ index 773ad95..84ca2f6 100644 + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + if ( elem.getClientRects().length ) { -+ val = elem.getBoundingClientRect()[ name ]; ++ val = elem.getBoundingClientRect()[ dimension ]; } - // Normalize "" and auto @@ -212,14 +181,14 @@ index 773ad95..84ca2f6 100644 + // 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 ); ++ val = curCSS( elem, dimension, styles ); + if ( val < 0 || val == null ) { -+ val = elem.style[ name ]; ++ val = elem.style[ dimension ]; + } -+ + +- // Adjust for the element's box model + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test( val ) ) { + return val; @@ -228,7 +197,7 @@ index 773ad95..84ca2f6 100644 + // 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 ] ); ++ ( support.boxSizingReliable() || val === elem.style[ dimension ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; @@ -239,8 +208,7 @@ index 773ad95..84ca2f6 100644 - boxModelAdjustment( + augmentWidthOrHeight( elem, -- dimension, -+ name, + dimension, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, - styles, @@ -250,4 +218,4 @@ index 773ad95..84ca2f6 100644 + styles ) ) + "px"; - } \ No newline at end of file + } diff --git a/packages/driver/src/cy/commands/actions/focus.ts b/packages/driver/src/cy/commands/actions/focus.ts index e1b64ef86bfb..996b4964fc0a 100644 --- a/packages/driver/src/cy/commands/actions/focus.ts +++ b/packages/driver/src/cy/commands/actions/focus.ts @@ -60,7 +60,7 @@ export default (Commands, Cypress, cy) => { $elements.isElement(options.$el.get(0)) && $elements.isBody(options.$el.get(0)) - // http://www.w3.org/$R/html5/editing.html#specially-focusable + // https://dev.w3.org/html5/spec-LC/editing.html#specially-focusable // ensure there is only 1 dom element in the subject // make sure its allowed to be focusable if (!(isWin || isBody || $dom.isFocusable(options.$el))) { diff --git a/packages/driver/src/cy/commands/actions/scroll.ts b/packages/driver/src/cy/commands/actions/scroll.ts index 840fe5ca43c7..04b7f31fa958 100644 --- a/packages/driver/src/cy/commands/actions/scroll.ts +++ b/packages/driver/src/cy/commands/actions/scroll.ts @@ -381,10 +381,6 @@ export default (Commands, Cypress, cy, state) => { axis: options.axis, easing: options.easing, duration: options.duration, - // TODO: ensureScrollable option does not exist on jQuery or config/jquery.scrollto.ts. - // It can be removed. - // @ts-ignore - ensureScrollable: options.ensureScrollable, done () { return resolve(options.$el) }, diff --git a/yarn.lock b/yarn.lock index 31ccf4af0895..15bdc62adc35 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19762,10 +19762,10 @@ jpeg-js@^0.4.4: resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.4.tgz#a9f1c6f1f9f0fa80cdb3484ed9635054d28936aa" integrity sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg== -jquery@3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2" - integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw== +jquery@3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" + integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== js-beautify@1.14.6, js-beautify@^1.6.12: version "1.14.6"