diff -Nru jqueryui-1.12.1+dfsg/.csslintrc jqueryui-1.13.1+dfsg/.csslintrc --- jqueryui-1.12.1+dfsg/.csslintrc 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.csslintrc 2022-01-20 12:59:41.000000000 +0000 @@ -7,6 +7,7 @@ "import": false, "important": false, "outline-none": false, + "order-alphabetical": false, "overqualified-elements": false, "text-indent": false } diff -Nru jqueryui-1.12.1+dfsg/.eslintignore jqueryui-1.13.1+dfsg/.eslintignore --- jqueryui-1.12.1+dfsg/.eslintignore 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.eslintignore 2022-01-20 12:59:41.000000000 +0000 @@ -0,0 +1,3 @@ +dist/**/* +external/**/* +ui/vendor/**/* diff -Nru jqueryui-1.12.1+dfsg/.eslintrc.json jqueryui-1.13.1+dfsg/.eslintrc.json --- jqueryui-1.12.1+dfsg/.eslintrc.json 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.eslintrc.json 2022-01-20 12:59:41.000000000 +0000 @@ -0,0 +1,21 @@ +{ + "root": true, + + "extends": "jquery", + + // Uncomment to find useless comment disable directives + // "reportUnusedDisableDirectives": true, + + "parserOptions": { + "ecmaVersion": 2018 + }, + + "env": { + "es6": true, + "node": true + }, + + "rules": { + "strict": [ "error", "global" ] + } +} diff -Nru jqueryui-1.12.1+dfsg/.github/workflows/test.yml jqueryui-1.13.1+dfsg/.github/workflows/test.yml --- jqueryui-1.12.1+dfsg/.github/workflows/test.yml 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.github/workflows/test.yml 2022-01-20 12:59:41.000000000 +0000 @@ -0,0 +1,59 @@ +name: Grunt tests + +on: [push, pull_request] + +jobs: + grunt: + name: Grunt based tests with Node.js ${{ matrix.node-version }} + + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x] + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Get npm cache directory + id: npm-cache-dir + run: | + echo "::set-output name=dir::$(npm config get cache)" + + - name: Cache npm dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}-npm- + ${{ runner.os }}-node-${{ matrix.node-version }}- + ${{ runner.os }}-node- + ${{ runner.os }}- + + - name: Install npm dependencies + run: npm install + + # Keep these steps in sync with the default command tasks in our Gruntfile! + - name: Run lint + run: node_modules/.bin/grunt lint + + - name: Run RequireJS + run: node_modules/.bin/grunt requirejs + + - name: Run Qunit + run: node_modules/.bin/grunt test + + valid: + name: Build & tests + + needs: grunt + + runs-on: ubuntu-latest + + steps: + - name: Grunt based tests passed + run: echo "✅" diff -Nru jqueryui-1.12.1+dfsg/.gitignore jqueryui-1.13.1+dfsg/.gitignore --- jqueryui-1.12.1+dfsg/.gitignore 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.gitignore 2022-01-20 12:59:41.000000000 +0000 @@ -2,3 +2,4 @@ bower_components node_modules .sizecache.json +package-lock.json diff -Nru jqueryui-1.12.1+dfsg/.jscsrc jqueryui-1.13.1+dfsg/.jscsrc --- jqueryui-1.12.1+dfsg/.jscsrc 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.jscsrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -{ - "preset": "jquery", - - // This is currently unenforcable see https://github.com/jscs-dev/node-jscs/issues/1686 - "requireCapitalizedComments": null, - - // Until we drop IE8 this prevents things like warning on float keyword - "es3": true, - - // We want to output all errors - "maxErrors": 1000000 -} diff -Nru jqueryui-1.12.1+dfsg/.jshintrc jqueryui-1.13.1+dfsg/.jshintrc --- jqueryui-1.12.1+dfsg/.jshintrc 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.jshintrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -{ - "boss": true, - "curly": true, - "eqeqeq": true, - "eqnull": true, - "expr": true, - "immed": true, - "noarg": true, - "quotmark": "double", - "smarttabs": true, - "trailing": true, - "undef": true, - "unused": true, - - "node": true -} diff -Nru jqueryui-1.12.1+dfsg/.mailmap jqueryui-1.13.1+dfsg/.mailmap --- jqueryui-1.12.1+dfsg/.mailmap 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.mailmap 2022-01-20 12:59:41.000000000 +0000 @@ -34,6 +34,7 @@ Ethan Romba EungJun Yi Eyal Kobrigo +Felix Nagel Filippo Cavallarin Florian Gutmann Genie <386@mail.com> @@ -78,6 +79,7 @@ Michael Hollis Michael Stay Michael Wu +Michał Gołębiowski-Owczarek Mike Alsup Milan Broum Mohamed Cherif Bouchelaghem diff -Nru jqueryui-1.12.1+dfsg/.npmignore jqueryui-1.13.1+dfsg/.npmignore --- jqueryui-1.12.1+dfsg/.npmignore 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.npmignore 2022-01-20 12:59:41.000000000 +0000 @@ -0,0 +1,10 @@ +demos +/dist/cdn +tests +.editorconfig +.eslintrc.json +.eslintignore +.mailmap +Gruntfile.js +.csslintrc +.gitattributes diff -Nru jqueryui-1.12.1+dfsg/.travis.yml jqueryui-1.13.1+dfsg/.travis.yml --- jqueryui-1.12.1+dfsg/.travis.yml 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -sudo: required -dist: trusty -language: node_js -node_js: - - "0.12" diff -Nru jqueryui-1.12.1+dfsg/AUTHORS.txt jqueryui-1.13.1+dfsg/AUTHORS.txt --- jqueryui-1.12.1+dfsg/AUTHORS.txt 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/AUTHORS.txt 2022-01-20 12:59:41.000000000 +0000 @@ -312,7 +312,7 @@ Hannah Methvin Leonardo Balter Benjamin Albert -Michał Gołębiowski +Michał Gołębiowski-Owczarek Alyosha Pushak Fahad Ahmad Matt Brundage @@ -331,3 +331,37 @@ Johannes Schäfer Ville Skyttä Ryan Oriecuia +Sergei Ratnikov +milk54 +Evelyn Masso +Robin +Simon Asika +Kevin Cupp +Jeremy Mickelson +Kyle Rosenberg +Petri Partio +pallxk +Luke Brookhart +claudi +Eirik Sletteberg +Albert Johansson +A. Wells +Robert Brignull +Horus68 +Maksymenkov Eugene +OskarNS +Gez Quinn +jigar gala +Florian Wegscheider +Fatér Zsolt +Szabolcs Szabolcsi-Toth +Jérémy Munsch +Hrvoje Novosel +Paul Capron +Micah Miller +sakshi87 <53863764+sakshi87@users.noreply.github.com> +Mikolaj Wolicki +Patrick McKay +c-lambert <58025159+c-lambert@users.noreply.github.com> +Josep Sanz +Ben Mullins diff -Nru jqueryui-1.12.1+dfsg/CONTRIBUTING.md jqueryui-1.13.1+dfsg/CONTRIBUTING.md --- jqueryui-1.12.1+dfsg/CONTRIBUTING.md 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/CONTRIBUTING.md 2022-01-20 12:59:41.000000000 +0000 @@ -12,10 +12,6 @@ This is the best way to contribute to jQuery UI. Please read through the full guide detailing [How to Report Bugs](http://contribute.jquery.org/bug-reports/). -### Weekly Meetings - -Every week (unless otherwise noted) the jQuery UI team has a meeting to discuss the progress of current work and to bring forward possible new blockers for discussion. The meeting is held on [IRC](http://irc.jquery.org) in the #jquery-meeting channel at [Noon EST](http://www.timeanddate.com/worldclock/fixedtime.html?month=1&day=17&year=2011&hour=12&min=0&sec=0&p1=43) on Wednesdays. Meeting notes are posted on http://meetings.jquery.org/category/ui/ after each meeting. - ## Tips for Getting Started ### Environment: Minimum Required @@ -53,10 +49,10 @@ git remote add upstream git://github.com/jquery/jquery-ui.git ``` -* Get in the habit of pulling in the "upstream" master to stay up to date as jQuery UI receives new commits. +* Get in the habit of pulling in the "upstream" main branch to stay up to date as jQuery UI receives new commits. ```bash -git pull upstream master +git pull upstream main ``` ### Environment: Recommended Setup diff -Nru jqueryui-1.12.1+dfsg/Gruntfile.js jqueryui-1.13.1+dfsg/Gruntfile.js --- jqueryui-1.12.1+dfsg/Gruntfile.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/Gruntfile.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,26 +1,28 @@ -module.exports = function( grunt ) { - "use strict"; +module.exports = function( grunt ) { + var + glob = require( "glob" ), + // files coreFiles = [ "core.js", "widget.js", - "mouse.js", - "draggable.js", - "droppable.js", - "resizable.js", - "selectable.js", - "sortable.js", + "widgets/mouse.js", + "widgets/draggable.js", + "widgets/droppable.js", + "widgets/resizable.js", + "widgets/selectable.js", + "widgets/sortable.js", "effect.js" ], - uiFiles = coreFiles.map(function( file ) { + uiFiles = coreFiles.map( function( file ) { return "ui/" + file; - }).concat( expandFiles( "ui/*.js" ).filter(function( file ) { + } ).concat( expandFiles( "ui/**/*.js" ).filter( function( file ) { return coreFiles.indexOf( file.substring( 3 ) ) === -1; - }) ), + } ) ), allI18nFiles = expandFiles( "ui/i18n/*.js" ), @@ -45,9 +47,9 @@ "tabs", "tooltip", "theme" - ].map(function( component ) { + ].map( function( component ) { return "themes/base/" + component + ".css"; - }), + } ), // minified files minify = { @@ -92,12 +94,12 @@ } function expandFiles( files ) { - return grunt.util._.pluck( grunt.file.expandMapping( files ), "src" ).map(function( values ) { + return grunt.util._.map( grunt.file.expandMapping( files ), "src" ).map( function( values ) { return values[ 0 ]; - }); + } ); } -uiFiles.concat( allI18nFiles ).forEach(function( file ) { +uiFiles.concat( allI18nFiles ).forEach( function( file ) { minify[ file ] = { options: { banner: createBanner() @@ -105,15 +107,17 @@ files: {} }; minify[ file ].files[ mapMinFile( file ) ] = file; -}); +} ); + +uiFiles.forEach( function( file ) { -uiFiles.forEach(function( file ) { // TODO this doesn't do anything until https://github.com/rwldrn/grunt-compare-size/issues/13 compareFiles[ file ] = [ file, mapMinFile( file ) ]; -}); +} ); // grunt plugins require( "load-grunt-tasks" )( grunt ); + // local testswarm and build tasks grunt.loadTasks( "build/tasks" ); @@ -122,17 +126,18 @@ } function createBanner( files ) { + // strip folders var fileNames = files && files.map( stripDirectory ); return "/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - " + "<%= grunt.template.today('isoDate') %>\n" + "<%= pkg.homepage ? '* ' + pkg.homepage + '\\n' : '' %>" + - (files ? "* Includes: " + fileNames.join(", ") + "\n" : "") + + ( files ? "* Includes: " + fileNames.join( ", " ) + "\n" : "" ) + "* Copyright <%= pkg.author.name %>;" + - " Licensed <%= _.pluck(pkg.licenses, 'type').join(', ') %> */\n"; + " Licensed <%= _.map(pkg.licenses, 'type').join(', ') %> */\n"; } -grunt.initConfig({ +grunt.initConfig( { pkg: grunt.file.readJSON( "package.json" ), files: { dist: "<%= pkg.name %>-<%= pkg.version %>" @@ -166,31 +171,12 @@ include: expandFiles( [ "ui/**/*.js", "!ui/core.js", "!ui/i18n/*" ] ), out: "dist/jquery-ui.js", wrap: { - start: createBanner( uiFiles ), + start: createBanner( uiFiles ) } } } }, - jscs: { - ui: { - options: { - config: true - }, - files: { - src: [ "demos/**/*.js", "build/**/*.js", "ui/**/*.js" ] - } - }, - tests: { - options: { - config: true, - maximumLineLength: null - }, - files: { - src: [ "tests/**/*.js" ] - } - } - }, uglify: minify, htmllint: { good: { @@ -198,9 +184,9 @@ ignore: [ /The text content of element “script” was not in the required format: Expected space, tab, newline, or slash but found “.” instead/ ] }, - src: [ "demos/**/*.html", "tests/**/*.html" ].concat( htmllintBad.map( function( file ) { - return "!" + file; - } ) ) + src: glob.sync( "{demos,tests}/**/*.html", { + ignore: htmllintBad + } ) }, bad: { options: { @@ -208,29 +194,39 @@ /Start tag seen without seeing a doctype first/, /Element “head” is missing a required instance of child element “title”/, /Element “object” is missing one or more of the following/, - /The “codebase” attribute on the “object” element is obsolete/ + /The “codebase” attribute on the “object” element is obsolete/, + /Consider adding a “lang” attribute to the “html” start tag/, + /This document appears to be written in .*. Consider adding “lang=".*"” \(or variant\) to the “html” start tag/ ] }, src: htmllintBad } }, qunit: { - files: expandFiles( "tests/unit/" + component + "/*.html" ).filter(function( file ) { + files: expandFiles( "tests/unit/" + component + "/*.html" ).filter( function( file ) { return !( /(all|index|test)\.html$/ ).test( file ); - }), + } ), options: { - inject: false, + puppeteer: { + ignoreDefaultArgs: true, + args: [ + "--headless", + "--disable-web-security", + "--allow-file-access-from-files" + ] + }, + inject: [ + require.resolve( "grunt-contrib-qunit/chrome/bridge" ) + ], page: { viewportSize: { width: 700, height: 500 } } } }, - jshint: { - options: { - jshintrc: true - }, + eslint: { all: [ - "ui/*.js", + "ui/**/*.js", + "!ui/vendor/**/*.js", "Gruntfile.js", "build/**/*.js", "tests/unit/**/*.js", @@ -248,6 +244,17 @@ }, bowercopy: { + inlineVendors: { + options: { + clean: true, + destPrefix: "ui/vendor" + }, + files: { + "jquery-color/jquery.color.js": "jquery-color/dist/jquery.color.js", + "jquery-color/LICENSE.txt": "jquery-color/LICENSE.txt" + } + }, + all: { options: { clean: true, @@ -259,10 +266,12 @@ "qunit/qunit.css": "qunit/qunit/qunit.css", "qunit/LICENSE.txt": "qunit/LICENSE.txt", - "qunit-assert-classes/qunit-assert-classes.js": "qunit-assert-classes/qunit-assert-classes.js", + "qunit-assert-classes/qunit-assert-classes.js": + "qunit-assert-classes/qunit-assert-classes.js", "qunit-assert-classes/LICENSE.txt": "qunit-assert-classes/LICENSE", - "qunit-assert-close/qunit-assert-close.js": "qunit-assert-close/qunit-assert-close.js", + "qunit-assert-close/qunit-assert-close.js": + "qunit-assert-close/qunit-assert-close.js", "qunit-assert-close/MIT-LICENSE.txt": "qunit-assert-close/MIT-LICENSE.txt", "qunit-composite/qunit-composite.js": "qunit-composite/qunit-composite.js", @@ -277,20 +286,8 @@ "jquery-simulate/jquery.simulate.js": "jquery-simulate/jquery.simulate.js", "jquery-simulate/LICENSE.txt": "jquery-simulate/LICENSE.txt", - "jshint/jshint.js": "jshint/dist/jshint.js", - "jshint/LICENSE": "jshint/LICENSE", - - "jquery/jquery.js": "jquery-1.x/dist/jquery.js", - "jquery/LICENSE.txt": "jquery-1.x/LICENSE.txt", - - "jquery-1.7.0/jquery.js": "jquery-1.7.0/jquery.js", - "jquery-1.7.0/MIT-LICENSE.txt": "jquery-1.7.0/MIT-LICENSE.txt", - - "jquery-1.7.1/jquery.js": "jquery-1.7.1/jquery.js", - "jquery-1.7.1/MIT-LICENSE.txt": "jquery-1.7.1/MIT-LICENSE.txt", - - "jquery-1.7.2/jquery.js": "jquery-1.7.2/jquery.js", - "jquery-1.7.2/MIT-LICENSE.txt": "jquery-1.7.2/MIT-LICENSE.txt", + "jquery/jquery.js": "jquery-3.x/dist/jquery.js", + "jquery/LICENSE.txt": "jquery-3.x/LICENSE.txt", "jquery-1.8.0/jquery.js": "jquery-1.8.0/jquery.js", "jquery-1.8.0/MIT-LICENSE.txt": "jquery-1.8.0/MIT-LICENSE.txt", @@ -392,7 +389,45 @@ "jquery-3.0.0/LICENSE.txt": "jquery-3.0.0/LICENSE.txt", "jquery-3.1.0/jquery.js": "jquery-3.1.0/dist/jquery.js", - "jquery-3.1.0/LICENSE.txt": "jquery-3.1.0/LICENSE.txt" + "jquery-3.1.0/LICENSE.txt": "jquery-3.1.0/LICENSE.txt", + + "jquery-3.1.1/jquery.js": "jquery-3.1.1/dist/jquery.js", + "jquery-3.1.1/LICENSE.txt": "jquery-3.1.1/LICENSE.txt", + + "jquery-3.2.0/jquery.js": "jquery-3.2.0/dist/jquery.js", + "jquery-3.2.0/LICENSE.txt": "jquery-3.2.0/LICENSE.txt", + + "jquery-3.2.1/jquery.js": "jquery-3.2.1/dist/jquery.js", + "jquery-3.2.1/LICENSE.txt": "jquery-3.2.1/LICENSE.txt", + + "jquery-3.3.0/jquery.js": "jquery-3.3.0/dist/jquery.js", + "jquery-3.3.0/LICENSE.txt": "jquery-3.3.0/LICENSE.txt", + + "jquery-3.3.1/jquery.js": "jquery-3.3.1/dist/jquery.js", + "jquery-3.3.1/LICENSE.txt": "jquery-3.3.1/LICENSE.txt", + + "jquery-3.4.0/jquery.js": "jquery-3.4.0/dist/jquery.js", + "jquery-3.4.0/LICENSE.txt": "jquery-3.4.0/LICENSE.txt", + + "jquery-3.4.1/jquery.js": "jquery-3.4.1/dist/jquery.js", + "jquery-3.4.1/LICENSE.txt": "jquery-3.4.1/LICENSE.txt", + + "jquery-3.5.0/jquery.js": "jquery-3.5.0/dist/jquery.js", + "jquery-3.5.0/LICENSE.txt": "jquery-3.5.0/LICENSE.txt", + + "jquery-3.5.1/jquery.js": "jquery-3.5.1/dist/jquery.js", + "jquery-3.5.1/LICENSE.txt": "jquery-3.5.1/LICENSE.txt", + + "jquery-3.6.0/jquery.js": "jquery-3.6.0/dist/jquery.js", + "jquery-3.6.0/LICENSE.txt": "jquery-3.6.0/LICENSE.txt", + + "jquery-migrate-1.4.1/jquery-migrate.js": + "jquery-migrate-1.4.1/dist/jquery-migrate.js", + "jquery-migrate-1.4.1/LICENSE.txt": "jquery-migrate-1.4.1/LICENSE.txt", + + "jquery-migrate-3.3.2/jquery-migrate.js": + "jquery-migrate-3.3.2/dist/jquery-migrate.js", + "jquery-migrate-3.3.2/LICENSE.txt": "jquery-migrate-3.3.2/LICENSE.txt" } } }, @@ -423,13 +458,13 @@ "Bohdan Ganicky " ] } -}); +} ); grunt.registerTask( "update-authors", function() { var getAuthors = require( "grunt-git-authors" ).getAuthors, done = this.async(); - getAuthors({ + getAuthors( { priorAuthors: grunt.config( "authors.prior" ) }, function( error, authors ) { if ( error ) { @@ -437,7 +472,7 @@ return done( false ); } - authors = authors.map(function( author ) { + authors = authors.map( function( author ) { if ( author.match( /^Jacek Jędrzejewski =1.6" + "jquery": ">=1.8.0 <4.0.0" }, "devDependencies": { + "jquery-color": "2.2.0", "jquery-mousewheel": "3.1.12", - "jquery-simulate": "1.0.0", - "jshint": "2.4.4", + "jquery-simulate": "1.1.1", "qunit": "1.18.0", "qunit-assert-classes": "1.0.2", "qunit-assert-close": "JamesMGreene/qunit-assert-close#v1.1.1", "qunit-composite": "JamesMGreene/qunit-composite#v1.1.0", "requirejs": "2.1.14", - "jquery-1.7.0": "jquery#1.7.0", - "jquery-1.7.1": "jquery#1.7.1", - "jquery-1.7.2": "jquery#1.7.2", "jquery-1.8.0": "jquery#1.8.0", "jquery-1.8.1": "jquery#1.8.1", "jquery-1.8.2": "jquery#1.8.2", @@ -41,7 +38,7 @@ "jquery-1.12.2": "jquery#1.12.2", "jquery-1.12.3": "jquery#1.12.3", "jquery-1.12.4": "jquery#1.12.4", - "jquery-1.x": "jquery#1.12.4", + "jquery-3.x": "jquery#3.6.0", "jquery-2.0.0": "jquery#2.0.0", "jquery-2.0.1": "jquery#2.0.1", "jquery-2.0.2": "jquery#2.0.2", @@ -57,7 +54,19 @@ "jquery-2.2.3": "jquery#2.2.3", "jquery-2.2.4": "jquery#2.2.4", "jquery-3.0.0": "jquery#3.0.0", - "jquery-3.1.0": "jquery#3.1.0" + "jquery-3.1.0": "jquery#3.1.0", + "jquery-3.1.1": "jquery#3.1.1", + "jquery-3.2.0": "jquery#3.2.0", + "jquery-3.2.1": "jquery#3.2.1", + "jquery-3.3.0": "jquery#3.3.0", + "jquery-3.3.1": "jquery#3.3.1", + "jquery-3.4.0": "jquery#3.4.0", + "jquery-3.4.1": "jquery#3.4.1", + "jquery-3.5.0": "jquery#3.5.0", + "jquery-3.5.1": "jquery#3.5.1", + "jquery-3.6.0": "jquery#3.6.0", + "jquery-migrate-1.4.1": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-1.4.1.tgz", + "jquery-migrate-3.3.2": "https://registry.npmjs.org/jquery-migrate/-/jquery-migrate-3.3.2.tgz" }, - "version": "1.12.1" + "version": "1.13.1" } diff -Nru jqueryui-1.12.1+dfsg/build/release-test.js jqueryui-1.13.1+dfsg/build/release-test.js --- jqueryui-1.12.1+dfsg/build/release-test.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/build/release-test.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,3 +1,5 @@ +"use strict"; + var shell = require( "shelljs" ); var Release = { define: function( props ) { @@ -35,7 +37,7 @@ // Ignores actual version installed, should be good enough for a test if ( shell.exec( "npm ls --depth 0 | grep download.jqueryui.com" ).code === 1 ) { - shell.exec( "npm install " + script.dependencies.join( " " ) ); + shell.exec( "npm install --no-save " + script.dependencies.join( " " ) ); } // If AUTHORS.txt is outdated, this will update it diff -Nru jqueryui-1.12.1+dfsg/build/release.js jqueryui-1.13.1+dfsg/build/release.js --- jqueryui-1.12.1+dfsg/build/release.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/build/release.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,3 +1,5 @@ +"use strict"; + module.exports = function( Release ) { var crypto = require( "crypto" ); @@ -35,7 +37,7 @@ return matches; } -function removeExternals ( packager ) { +function removeExternals( packager ) { Object.keys( packager.builtFiles ).forEach( function( filepath ) { if ( /^external\//.test( filepath ) ) { delete packager.builtFiles[ filepath ]; @@ -57,8 +59,21 @@ function buildCDNPackage( callback ) { console.log( "Building CDN package" ); var JqueryUi = require( "download.jqueryui.com/lib/jquery-ui" ); - var Package = require( "download.jqueryui.com/lib/package-1-12-themes" ); + var PackageWithoutThemes = require( "download.jqueryui.com/lib/package-1-13" ); + var PackageOfThemes = require( "download.jqueryui.com/lib/package-1-13-themes" ); var Packager = require( "node-packager" ); + + // PackageOfThemes doesn't contain JS files, PackageWithoutThemes doesn't contain themes; + // we need both. + function Package() { + + // PackageOfThemes invokes PackageWithoutThemes's constructor in its own so we don't + // need to do it by ourselves; we just need to handle prototypes that way. + PackageOfThemes.apply( this, arguments ); + } + + Object.assign( Package.prototype, PackageWithoutThemes.prototype, PackageOfThemes.prototype ); + var jqueryUi = new JqueryUi( path.resolve( "." ) ); var target = fs.createWriteStream( "../" + jqueryUi.pkg.name + "-" + jqueryUi.pkg.version + "-cdn.zip" ); @@ -69,24 +84,27 @@ jqueryUi: jqueryUi, themeVars: null } ); - packager.ready.then( function() { - removeExternals( packager ); - addManifest( packager ); - packager.toZip( target, { - basedir: "" - }, function( error ) { - if ( error ) { - Release.abort( "Failed to zip CDN package", error ); - } - callback(); + packager.ready + .then( function() { + removeExternals( packager ); + addManifest( packager ); + packager.toZip( target, { + basedir: "" + }, function( error ) { + if ( error ) { + Release.abort( "Failed to zip the CDN package", error ); + } + callback(); + } ); + } ) + .catch( function( error ) { + Release.abort( "Failed to create the CDN package", error ); } ); - } ); } Release.define( { npmPublish: true, - issueTracker: "trac", - contributorReportId: 22, + issueTracker: "github", changelogShell: function() { var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], @@ -121,7 +139,7 @@ }; module.exports.dependencies = [ - "download.jqueryui.com@2.1.2", + "download.jqueryui.com@2.2.7", "node-packager@0.0.6", - "shelljs@0.2.6" + "shelljs@0.8.4" ]; diff -Nru jqueryui-1.12.1+dfsg/build/tasks/build.js jqueryui-1.13.1+dfsg/build/tasks/build.js --- jqueryui-1.12.1+dfsg/build/tasks/build.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/build/tasks/build.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,7 +1,7 @@ -module.exports = function( grunt ) { - "use strict"; +module.exports = function( grunt ) { + grunt.registerTask( "clean", function() { require( "rimraf" ).sync( "dist" ); } ); diff -Nru jqueryui-1.12.1+dfsg/build/tasks/testswarm.js jqueryui-1.13.1+dfsg/build/tasks/testswarm.js --- jqueryui-1.12.1+dfsg/build/tasks/testswarm.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/build/tasks/testswarm.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,16 @@ -module.exports = function( grunt ) { - "use strict"; +module.exports = function( grunt ) { + var versions = { "git": "git", - "3.1": "3.1.0", + "3.x-git": "3.x-git", + "3.6": "3.6.0", + "3.5": "3.5.1", + "3.4": "3.4.1", + "3.3": "3.3.1", + "3.2": "3.2.1", + "3.1": "3.1.1", "3.0": "3.0.0", "2.2": "2.2.4", "2.1": "2.1.4", @@ -13,8 +19,7 @@ "1.11": "1.11.3", "1.10": "1.10.2", "1.9": "1.9.1", - "1.8": "1.8.3", - "1.7": "1.7.2" + "1.8": "1.8.3" }, tests = { "Accordion": "accordion/accordion.html", @@ -43,20 +48,20 @@ "Widget": "widget/widget.html" }; -function submit( commit, runs, configFile, extra, done ) { +function submit( commit, runs, configFile, browserSets, extra, done ) { var testName, testswarm = require( "testswarm" ), config = grunt.file.readJSON( configFile ).jqueryui, - browserSets = config.browserSets, commitUrl = "https://github.com/jquery/jquery-ui/commit/" + commit; - if ( extra ) { + browserSets = browserSets || config.browserSets; + if ( browserSets[ 0 ] === "[" ) { - // jQuery >= 2.0.0 don't support IE 8. - if ( extra.substring( 0, 6 ) !== "core 1" ) { - browserSets = "jquery-ui-future"; - } + // We got an array, parse it + browserSets = JSON.parse( browserSets ); + } + if ( extra ) { extra = " (" + extra + ")"; } @@ -86,23 +91,23 @@ } ); } -grunt.registerTask( "testswarm", function( commit, configFile ) { +grunt.registerTask( "testswarm", function( commit, configFile, browserSets ) { var test, latestTests = {}; for ( test in tests ) { - latestTests[ test ] = tests[ test ] + "?nojshint=true"; + latestTests[ test ] = tests[ test ]; } - submit( commit, latestTests, configFile, "", this.async() ); + submit( commit, latestTests, configFile, browserSets, "", this.async() ); } ); -grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, minor ) { +grunt.registerTask( "testswarm-multi-jquery", function( commit, configFile, minor, browserSets ) { var allTests = {}; versions[ minor ].split( " " ).forEach( function( version ) { for ( var test in tests ) { - allTests[ test + "-" + version ] = tests[ test ] + "?nojshint=true&jquery=" + version; + allTests[ test + "-" + version ] = tests[ test ] + "?jquery=" + version; } } ); - submit( commit, allTests, configFile, "core " + minor, this.async() ); + submit( commit, allTests, configFile, browserSets, "core " + minor, this.async() ); } ); }; diff -Nru jqueryui-1.12.1+dfsg/debian/changelog jqueryui-1.13.1+dfsg/debian/changelog --- jqueryui-1.12.1+dfsg/debian/changelog 2021-01-12 19:59:33.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/changelog 2022-02-18 11:31:10.000000000 +0000 @@ -1,3 +1,30 @@ +jqueryui (1.13.1+dfsg-1) unstable; urgency=medium + + * Team upload + + [ lintian-brush ] + * Remove 1 obsolete maintscript entry. + + [ Yadd ] + * New upstream version 1.13.1+dfsg + * Unfuzz patches + * Replace embedded build module by build dependency + * Add lintian overrides + + -- Yadd Fri, 18 Feb 2022 12:31:10 +0100 + +jqueryui (1.13.0+dfsg-1) unstable; urgency=medium + + * Team upload + * Update standards version to 4.6.0, no changes needed. + * Fix filenamemangle + * New upstream version 1.13.0+dfsg (Closes: CVE-2021-41184) + * Refresh patches + * Update build (use grunt) + * Add lintian overrides + + -- Yadd Mon, 08 Nov 2021 12:23:18 +0100 + jqueryui (1.12.1+dfsg-8) unstable; urgency=medium * Team upload diff -Nru jqueryui-1.12.1+dfsg/debian/clean jqueryui-1.13.1+dfsg/debian/clean --- jqueryui-1.12.1+dfsg/debian/clean 2020-09-27 20:41:45.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/clean 2022-01-13 15:40:59.000000000 +0000 @@ -1,7 +1,9 @@ -build.js -jquery-ui.js +dist/ +node_modules/ themes/base/*.min.css themes/base/jquery-ui.css ui/*.min.js ui/*/*.min.js +ui/*/*/*.min.js +ui/i18n/datepicker*.tmp ui/i18n/jquery-ui-i18n.js diff -Nru jqueryui-1.12.1+dfsg/debian/control jqueryui-1.13.1+dfsg/debian/control --- jqueryui-1.12.1+dfsg/debian/control 2021-01-12 19:58:09.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/control 2022-02-18 11:22:41.000000000 +0000 @@ -6,12 +6,15 @@ Section: javascript Priority: optional Build-Depends: debhelper-compat (= 13) - , node-requirejs (>= 2.3.2~) - , uglifyjs - , nodejs , dh-sequence-nodejs + , grunt + , node-jquery + , node-load-grunt-tasks + , node-requirejs + , node-grunt-contrib-requirejs + , uglifyjs , yui-compressor -Standards-Version: 4.5.1 +Standards-Version: 4.6.0 Vcs-Browser: https://salsa.debian.org/js-team/jqueryui Vcs-Git: https://salsa.debian.org/js-team/jqueryui.git Homepage: https://jqueryui.com/ diff -Nru jqueryui-1.12.1+dfsg/debian/copyright jqueryui-1.13.1+dfsg/debian/copyright --- jqueryui-1.12.1+dfsg/debian/copyright 2021-01-12 19:57:58.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/copyright 2022-02-18 11:27:58.000000000 +0000 @@ -2,8 +2,9 @@ Upstream-Name: jQueryUI Source: http://jqueryui.com/ Comment: Source for embedded jquery is missing, so stripping that. -Files-excluded: +Files-Excluded: external + ui/i18n/*.min.js Files: * Homepage: http://jqueryui.com/ @@ -203,6 +204,7 @@ Files: debian/* Copyright: (c) 2009, Walter Cruz 2016 Paul Gevers + 2021-2022 Yadd License: GPL-2 or Expat License: GPL-2 diff -Nru jqueryui-1.12.1+dfsg/debian/libjs-jquery-ui.install jqueryui-1.13.1+dfsg/debian/libjs-jquery-ui.install --- jqueryui-1.12.1+dfsg/debian/libjs-jquery-ui.install 2020-09-27 20:44:24.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/libjs-jquery-ui.install 2022-01-13 15:40:59.000000000 +0000 @@ -1,3 +1,3 @@ -jquery-ui*.js usr/share/javascript/jquery-ui -themes usr/share/javascript/jquery-ui -ui/* usr/share/javascript/jquery-ui/ui +dist/* usr/share/javascript/jquery-ui +themes usr/share/javascript/jquery-ui +ui/* usr/share/javascript/jquery-ui/ui diff -Nru jqueryui-1.12.1+dfsg/debian/libjs-jquery-ui.maintscript jqueryui-1.13.1+dfsg/debian/libjs-jquery-ui.maintscript --- jqueryui-1.12.1+dfsg/debian/libjs-jquery-ui.maintscript 2020-09-27 20:09:09.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/libjs-jquery-ui.maintscript 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -dir_to_symlink /usr/share/javascript/jquery-ui/css/smoothness ../themes/base 1.12.1+dfsg-4~ diff -Nru jqueryui-1.12.1+dfsg/debian/node-jquery-ui.lintian-overrides jqueryui-1.13.1+dfsg/debian/node-jquery-ui.lintian-overrides --- jqueryui-1.12.1+dfsg/debian/node-jquery-ui.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/node-jquery-ui.lintian-overrides 2022-01-13 15:40:59.000000000 +0000 @@ -0,0 +1,3 @@ +# False positive +embedded-javascript-library usr/share/nodejs/jquery-ui/themes/base/jquery-ui.css please use libjs-jquery-ui +embedded-javascript-library usr/share/nodejs/jquery-ui/themes/base/jquery-ui.min.css please use libjs-jquery-ui diff -Nru jqueryui-1.12.1+dfsg/debian/patches/add_missing_semicolon.patch jqueryui-1.13.1+dfsg/debian/patches/add_missing_semicolon.patch --- jqueryui-1.12.1+dfsg/debian/patches/add_missing_semicolon.patch 2020-09-27 20:09:09.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/patches/add_missing_semicolon.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -Description: in the Debian way of building, it seems that this missing - semicolon isn't noticed by nodejs -Author: Paul Gevers -Index: jqueryui/ui/jquery-1-7.js -=================================================================== ---- jqueryui.orig/ui/jquery-1-7.js -+++ jqueryui/ui/jquery-1-7.js -@@ -86,4 +86,5 @@ if ( $.fn.jquery.substring( 0, 3 ) === " - }; - } - -+; - } ) ); diff -Nru jqueryui-1.12.1+dfsg/debian/patches/fix-build.patch jqueryui-1.13.1+dfsg/debian/patches/fix-build.patch --- jqueryui-1.12.1+dfsg/debian/patches/fix-build.patch 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/patches/fix-build.patch 2022-02-18 11:18:29.000000000 +0000 @@ -0,0 +1,294 @@ +Description: fix build +Author: Yadd +Forwarded: not-needed +Last-Update: 2021-11-08 + +--- a/Gruntfile.js ++++ b/Gruntfile.js +@@ -160,8 +160,8 @@ + options: { + baseUrl: "./", + paths: { +- jquery: "./external/jquery/jquery", +- external: "./external/" ++ jquery: "/usr/share/nodejs/jquery/dist/jquery", ++ external: "/usr/share/nodejs/" + }, + preserveLicenseComments: false, + optimize: "none", +@@ -178,259 +178,6 @@ + }, + + uglify: minify, +- htmllint: { +- good: { +- options: { +- ignore: [ +- /The text content of element “script” was not in the required format: Expected space, tab, newline, or slash but found “.” instead/ +- ] }, +- src: glob.sync( "{demos,tests}/**/*.html", { +- ignore: htmllintBad +- } ) +- }, +- bad: { +- options: { +- ignore: [ +- /Start tag seen without seeing a doctype first/, +- /Element “head” is missing a required instance of child element “title”/, +- /Element “object” is missing one or more of the following/, +- /The “codebase” attribute on the “object” element is obsolete/, +- /Consider adding a “lang” attribute to the “html” start tag/, +- /This document appears to be written in .*. Consider adding “lang=".*"” \(or variant\) to the “html” start tag/ +- ] +- }, +- src: htmllintBad +- } +- }, +- qunit: { +- files: expandFiles( "tests/unit/" + component + "/*.html" ).filter( function( file ) { +- return !( /(all|index|test)\.html$/ ).test( file ); +- } ), +- options: { +- puppeteer: { +- ignoreDefaultArgs: true, +- args: [ +- "--headless", +- "--disable-web-security", +- "--allow-file-access-from-files" +- ] +- }, +- inject: [ +- require.resolve( "grunt-contrib-qunit/chrome/bridge" ) +- ], +- page: { +- viewportSize: { width: 700, height: 500 } +- } +- } +- }, +- eslint: { +- all: [ +- "ui/**/*.js", +- "!ui/vendor/**/*.js", +- "Gruntfile.js", +- "build/**/*.js", +- "tests/unit/**/*.js", +- "tests/lib/**/*.js", +- "demos/**/*.js" +- ] +- }, +- csslint: { +- base_theme: { +- src: "themes/base/*.css", +- options: { +- csslintrc: ".csslintrc" +- } +- } +- }, +- +- bowercopy: { +- inlineVendors: { +- options: { +- clean: true, +- destPrefix: "ui/vendor" +- }, +- files: { +- "jquery-color/jquery.color.js": "jquery-color/dist/jquery.color.js", +- "jquery-color/LICENSE.txt": "jquery-color/LICENSE.txt" +- } +- }, +- +- all: { +- options: { +- clean: true, +- ignore: [ "jquery" ], +- destPrefix: "external" +- }, +- files: { +- "qunit/qunit.js": "qunit/qunit/qunit.js", +- "qunit/qunit.css": "qunit/qunit/qunit.css", +- "qunit/LICENSE.txt": "qunit/LICENSE.txt", +- +- "qunit-assert-classes/qunit-assert-classes.js": +- "qunit-assert-classes/qunit-assert-classes.js", +- "qunit-assert-classes/LICENSE.txt": "qunit-assert-classes/LICENSE", +- +- "qunit-assert-close/qunit-assert-close.js": +- "qunit-assert-close/qunit-assert-close.js", +- "qunit-assert-close/MIT-LICENSE.txt": "qunit-assert-close/MIT-LICENSE.txt", +- +- "qunit-composite/qunit-composite.js": "qunit-composite/qunit-composite.js", +- "qunit-composite/qunit-composite.css": "qunit-composite/qunit-composite.css", +- "qunit-composite/LICENSE.txt": "qunit-composite/LICENSE.txt", +- +- "requirejs/require.js": "requirejs/require.js", +- +- "jquery-mousewheel/jquery.mousewheel.js": "jquery-mousewheel/jquery.mousewheel.js", +- "jquery-mousewheel/LICENSE.txt": "jquery-mousewheel/LICENSE.txt", +- +- "jquery-simulate/jquery.simulate.js": "jquery-simulate/jquery.simulate.js", +- "jquery-simulate/LICENSE.txt": "jquery-simulate/LICENSE.txt", +- +- "jquery/jquery.js": "jquery-3.x/dist/jquery.js", +- "jquery/LICENSE.txt": "jquery-3.x/LICENSE.txt", +- +- "jquery-1.8.0/jquery.js": "jquery-1.8.0/jquery.js", +- "jquery-1.8.0/MIT-LICENSE.txt": "jquery-1.8.0/MIT-LICENSE.txt", +- +- "jquery-1.8.1/jquery.js": "jquery-1.8.1/jquery.js", +- "jquery-1.8.1/MIT-LICENSE.txt": "jquery-1.8.1/MIT-LICENSE.txt", +- +- "jquery-1.8.2/jquery.js": "jquery-1.8.2/jquery.js", +- "jquery-1.8.2/MIT-LICENSE.txt": "jquery-1.8.2/MIT-LICENSE.txt", +- +- "jquery-1.8.3/jquery.js": "jquery-1.8.3/jquery.js", +- "jquery-1.8.3/MIT-LICENSE.txt": "jquery-1.8.3/MIT-LICENSE.txt", +- +- "jquery-1.9.0/jquery.js": "jquery-1.9.0/jquery.js", +- "jquery-1.9.0/MIT-LICENSE.txt": "jquery-1.9.0/MIT-LICENSE.txt", +- +- "jquery-1.9.1/jquery.js": "jquery-1.9.1/jquery.js", +- "jquery-1.9.1/MIT-LICENSE.txt": "jquery-1.9.1/MIT-LICENSE.txt", +- +- "jquery-1.10.0/jquery.js": "jquery-1.10.0/jquery.js", +- "jquery-1.10.0/MIT-LICENSE.txt": "jquery-1.10.0/MIT-LICENSE.txt", +- +- "jquery-1.10.1/jquery.js": "jquery-1.10.1/jquery.js", +- "jquery-1.10.1/MIT-LICENSE.txt": "jquery-1.10.1/MIT-LICENSE.txt", +- +- "jquery-1.10.2/jquery.js": "jquery-1.10.2/jquery.js", +- "jquery-1.10.2/MIT-LICENSE.txt": "jquery-1.10.2/MIT-LICENSE.txt", +- +- "jquery-1.11.0/jquery.js": "jquery-1.11.0/dist/jquery.js", +- "jquery-1.11.0/MIT-LICENSE.txt": "jquery-1.11.0/MIT-LICENSE.txt", +- +- "jquery-1.11.1/jquery.js": "jquery-1.11.1/dist/jquery.js", +- "jquery-1.11.1/MIT-LICENSE.txt": "jquery-1.11.1/MIT-LICENSE.txt", +- +- "jquery-1.11.2/jquery.js": "jquery-1.11.2/dist/jquery.js", +- "jquery-1.11.2/MIT-LICENSE.txt": "jquery-1.11.2/MIT-LICENSE.txt", +- +- "jquery-1.11.3/jquery.js": "jquery-1.11.3/dist/jquery.js", +- "jquery-1.11.3/MIT-LICENSE.txt": "jquery-1.11.3/MIT-LICENSE.txt", +- +- "jquery-1.12.0/jquery.js": "jquery-1.12.0/dist/jquery.js", +- "jquery-1.12.0/LICENSE.txt": "jquery-1.12.0/LICENSE.txt", +- +- "jquery-1.12.1/jquery.js": "jquery-1.12.1/dist/jquery.js", +- "jquery-1.12.1/LICENSE.txt": "jquery-1.12.1/LICENSE.txt", +- +- "jquery-1.12.2/jquery.js": "jquery-1.12.2/dist/jquery.js", +- "jquery-1.12.2/LICENSE.txt": "jquery-1.12.2/LICENSE.txt", +- +- "jquery-1.12.3/jquery.js": "jquery-1.12.3/dist/jquery.js", +- "jquery-1.12.3/LICENSE.txt": "jquery-1.12.3/LICENSE.txt", +- +- "jquery-1.12.4/jquery.js": "jquery-1.12.4/dist/jquery.js", +- "jquery-1.12.4/LICENSE.txt": "jquery-1.12.4/LICENSE.txt", +- +- "jquery-2.0.0/jquery.js": "jquery-2.0.0/jquery.js", +- "jquery-2.0.0/MIT-LICENSE.txt": "jquery-2.0.0/MIT-LICENSE.txt", +- +- "jquery-2.0.1/jquery.js": "jquery-2.0.1/jquery.js", +- "jquery-2.0.1/MIT-LICENSE.txt": "jquery-2.0.1/MIT-LICENSE.txt", +- +- "jquery-2.0.2/jquery.js": "jquery-2.0.2/jquery.js", +- "jquery-2.0.2/MIT-LICENSE.txt": "jquery-2.0.2/MIT-LICENSE.txt", +- +- "jquery-2.0.3/jquery.js": "jquery-2.0.3/jquery.js", +- "jquery-2.0.3/MIT-LICENSE.txt": "jquery-2.0.3/MIT-LICENSE.txt", +- +- "jquery-2.1.0/jquery.js": "jquery-2.1.0/dist/jquery.js", +- "jquery-2.1.0/MIT-LICENSE.txt": "jquery-2.1.0/MIT-LICENSE.txt", +- +- "jquery-2.1.1/jquery.js": "jquery-2.1.1/dist/jquery.js", +- "jquery-2.1.1/MIT-LICENSE.txt": "jquery-2.1.1/MIT-LICENSE.txt", +- +- "jquery-2.1.2/jquery.js": "jquery-2.1.2/dist/jquery.js", +- "jquery-2.1.2/MIT-LICENSE.txt": "jquery-2.1.2/MIT-LICENSE.txt", +- +- "jquery-2.1.3/jquery.js": "jquery-2.1.3/dist/jquery.js", +- "jquery-2.1.3/MIT-LICENSE.txt": "jquery-2.1.3/MIT-LICENSE.txt", +- +- "jquery-2.1.4/jquery.js": "jquery-2.1.4/dist/jquery.js", +- "jquery-2.1.4/MIT-LICENSE.txt": "jquery-2.1.4/MIT-LICENSE.txt", +- +- "jquery-2.2.0/jquery.js": "jquery-2.2.0/dist/jquery.js", +- "jquery-2.2.0/LICENSE.txt": "jquery-2.2.0/LICENSE.txt", +- +- "jquery-2.2.1/jquery.js": "jquery-2.2.1/dist/jquery.js", +- "jquery-2.2.1/LICENSE.txt": "jquery-2.2.1/LICENSE.txt", +- +- "jquery-2.2.2/jquery.js": "jquery-2.2.2/dist/jquery.js", +- "jquery-2.2.2/LICENSE.txt": "jquery-2.2.2/LICENSE.txt", +- +- "jquery-2.2.3/jquery.js": "jquery-2.2.3/dist/jquery.js", +- "jquery-2.2.3/LICENSE.txt": "jquery-2.2.3/LICENSE.txt", +- +- "jquery-2.2.4/jquery.js": "jquery-2.2.4/dist/jquery.js", +- "jquery-2.2.4/LICENSE.txt": "jquery-2.2.4/LICENSE.txt", +- +- "jquery-3.0.0/jquery.js": "jquery-3.0.0/dist/jquery.js", +- "jquery-3.0.0/LICENSE.txt": "jquery-3.0.0/LICENSE.txt", +- +- "jquery-3.1.0/jquery.js": "jquery-3.1.0/dist/jquery.js", +- "jquery-3.1.0/LICENSE.txt": "jquery-3.1.0/LICENSE.txt", +- +- "jquery-3.1.1/jquery.js": "jquery-3.1.1/dist/jquery.js", +- "jquery-3.1.1/LICENSE.txt": "jquery-3.1.1/LICENSE.txt", +- +- "jquery-3.2.0/jquery.js": "jquery-3.2.0/dist/jquery.js", +- "jquery-3.2.0/LICENSE.txt": "jquery-3.2.0/LICENSE.txt", +- +- "jquery-3.2.1/jquery.js": "jquery-3.2.1/dist/jquery.js", +- "jquery-3.2.1/LICENSE.txt": "jquery-3.2.1/LICENSE.txt", +- +- "jquery-3.3.0/jquery.js": "jquery-3.3.0/dist/jquery.js", +- "jquery-3.3.0/LICENSE.txt": "jquery-3.3.0/LICENSE.txt", +- +- "jquery-3.3.1/jquery.js": "jquery-3.3.1/dist/jquery.js", +- "jquery-3.3.1/LICENSE.txt": "jquery-3.3.1/LICENSE.txt", +- +- "jquery-3.4.0/jquery.js": "jquery-3.4.0/dist/jquery.js", +- "jquery-3.4.0/LICENSE.txt": "jquery-3.4.0/LICENSE.txt", +- +- "jquery-3.4.1/jquery.js": "jquery-3.4.1/dist/jquery.js", +- "jquery-3.4.1/LICENSE.txt": "jquery-3.4.1/LICENSE.txt", +- +- "jquery-3.5.0/jquery.js": "jquery-3.5.0/dist/jquery.js", +- "jquery-3.5.0/LICENSE.txt": "jquery-3.5.0/LICENSE.txt", +- +- "jquery-3.5.1/jquery.js": "jquery-3.5.1/dist/jquery.js", +- "jquery-3.5.1/LICENSE.txt": "jquery-3.5.1/LICENSE.txt", +- +- "jquery-3.6.0/jquery.js": "jquery-3.6.0/dist/jquery.js", +- "jquery-3.6.0/LICENSE.txt": "jquery-3.6.0/LICENSE.txt", +- +- "jquery-migrate-1.4.1/jquery-migrate.js": +- "jquery-migrate-1.4.1/dist/jquery-migrate.js", +- "jquery-migrate-1.4.1/LICENSE.txt": "jquery-migrate-1.4.1/LICENSE.txt", +- +- "jquery-migrate-3.3.2/jquery-migrate.js": +- "jquery-migrate-3.3.2/dist/jquery-migrate.js", +- "jquery-migrate-3.3.2/LICENSE.txt": "jquery-migrate-3.3.2/LICENSE.txt" +- } +- } +- }, + + authors: { + prior: [ +@@ -492,10 +239,10 @@ + + // Keep this task list in sync with the testing steps in our GitHub action test workflow file! + grunt.registerTask( "default", [ "lint", "requirejs", "test" ] ); +-grunt.registerTask( "jenkins", [ "default", "concat" ] ); +-grunt.registerTask( "lint", [ "asciilint", "eslint", "csslint", "htmllint" ] ); +-grunt.registerTask( "test", [ "qunit" ] ); +-grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ] ); +-grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ] ); ++//grunt.registerTask( "jenkins", [ "default", "concat" ] ); ++//grunt.registerTask( "lint", [ "asciilint", "eslint", "csslint", "htmllint" ] ); ++//grunt.registerTask( "test", [ "qunit" ] ); ++//grunt.registerTask( "sizer", [ "requirejs:js", "uglify:main", "compare_size:all" ] ); ++//grunt.registerTask( "sizer_all", [ "requirejs:js", "uglify", "compare_size" ] ); + + }; diff -Nru jqueryui-1.12.1+dfsg/debian/patches/match_css_source_to_release.patch jqueryui-1.13.1+dfsg/debian/patches/match_css_source_to_release.patch --- jqueryui-1.12.1+dfsg/debian/patches/match_css_source_to_release.patch 2020-09-27 20:09:09.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/patches/match_css_source_to_release.patch 2022-01-13 15:40:59.000000000 +0000 @@ -1,19 +1,19 @@ Description: the concatenated jquery-ui.css in the upstream 1.12.1 release is slightly different from the source. Match them by adjusting the source. Author: Paul Gevers +Reviewed-By: Yadd +Last-Update: 2021-11-08 -Index: jqueryui/themes/base/theme.css -=================================================================== ---- jqueryui.orig/themes/base/theme.css -+++ jqueryui/themes/base/theme.css -@@ -434,10 +434,10 @@ a.ui-button:active, +--- a/themes/base/theme.css ++++ b/themes/base/theme.css +@@ -437,10 +437,10 @@ /* Overlays */ .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ /*{bgImgUrlOverlay}*/ /*{bgOverlayXPos}*/ /*{bgOverlayYPos}*/ /*{bgOverlayRepeat}*/; - opacity: .3/*{opacityOverlay}*/; -- filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; /* support: IE8 */ +- -ms-filter: "alpha(opacity=30)"/*{opacityFilterOverlay}*/; /* support: IE8 */ + opacity: .003/*{opacityOverlay}*/; -+ filter: Alpha(Opacity=.3)/*{opacityFilterOverlay}*/; /* support: IE8 */ ++ -ms-filter: "alpha(opacity=.3)"/*{opacityFilterOverlay}*/; /* support: IE8 */ } .ui-widget-shadow { - -webkit-box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/; diff -Nru jqueryui-1.12.1+dfsg/debian/patches/series jqueryui-1.13.1+dfsg/debian/patches/series --- jqueryui-1.12.1+dfsg/debian/patches/series 2020-09-27 20:09:09.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/patches/series 2022-01-13 15:40:59.000000000 +0000 @@ -1,3 +1,3 @@ -add_missing_semicolon.patch match_css_source_to_release.patch use_system_files_in_examples.patch +fix-build.patch diff -Nru jqueryui-1.12.1+dfsg/debian/patches/use_system_files_in_examples.patch jqueryui-1.13.1+dfsg/debian/patches/use_system_files_in_examples.patch --- jqueryui-1.12.1+dfsg/debian/patches/use_system_files_in_examples.patch 2020-09-27 20:09:09.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/patches/use_system_files_in_examples.patch 2022-01-13 15:40:59.000000000 +0000 @@ -5,10 +5,8 @@ Author: Paul Gevers Forwarded: not-needed -Index: jqueryui/demos/effect/removeClass.html -=================================================================== ---- jqueryui.orig/demos/effect/removeClass.html -+++ jqueryui/demos/effect/removeClass.html +--- a/demos/effect/removeClass.html ++++ b/demos/effect/removeClass.html @@ -5,8 +5,8 @@ jQuery UI Effects - removeClass Demo @@ -20,10 +18,8 @@ " ).appendTo( body ); } - if ( o.opacity ) { // opacity option - if ( this.helper.css( "opacity" ) ) { - this._storedOpacity = this.helper.css( "opacity" ); - } - this.helper.css( "opacity", o.opacity ); - } - + // We need to make sure to grab the zIndex before setting the + // opacity, because setting the opacity to anything lower than 1 + // causes the zIndex to change from "auto" to 0. if ( o.zIndex ) { // zIndex option if ( this.helper.css( "zIndex" ) ) { this._storedZIndex = this.helper.css( "zIndex" ); @@ -15471,6 +15753,13 @@ this.helper.css( "zIndex", o.zIndex ); } + if ( o.opacity ) { // opacity option + if ( this.helper.css( "opacity" ) ) { + this._storedOpacity = this.helper.css( "opacity" ); + } + this.helper.css( "opacity", o.opacity ); + } + //Prepare scrolling if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && this.scrollParent[ 0 ].tagName !== "HTML" ) { @@ -15505,77 +15794,82 @@ this._addClass( this.helper, "ui-sortable-helper" ); - // Execute the drag once - this causes the helper not to be visiblebefore getting its - // correct position - this._mouseDrag( event ); - return true; + //Move the helper, if needed + if ( !this.helper.parent().is( this.appendTo ) ) { + this.helper.detach().appendTo( this.appendTo ); - }, + //Update position + this.offset.parent = this._getParentOffset(); + } - _mouseDrag: function( event ) { - var i, item, itemElement, intersection, - o = this.options, - scrolled = false; + //Generate the original position + this.position = this.originalPosition = this._generatePosition( event ); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" ); - //Compute the helpers position - this.position = this._generatePosition( event ); - this.positionAbs = this._convertPositionTo( "absolute" ); + this._mouseDrag( event ); - if ( !this.lastPositionAbs ) { - this.lastPositionAbs = this.positionAbs; - } + return true; - //Do scrolling - if ( this.options.scroll ) { - if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && - this.scrollParent[ 0 ].tagName !== "HTML" ) { + }, - if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - - event.pageY < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollTop = - scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; - } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollTop = - scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; - } - - if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - - event.pageX < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollLeft = scrolled = - this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; - } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { - this.scrollParent[ 0 ].scrollLeft = scrolled = - this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; - } + _scroll: function( event ) { + var o = this.options, + scrolled = false; - } else { + if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && + this.scrollParent[ 0 ].tagName !== "HTML" ) { - if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { - scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); - } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < - o.scrollSensitivity ) { - scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); - } + if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - + event.pageY < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollTop = + scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; + } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollTop = + scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; + } + + if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - + event.pageX < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollLeft = scrolled = + this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; + } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollLeft = scrolled = + this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; + } - if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { - scrolled = this.document.scrollLeft( - this.document.scrollLeft() - o.scrollSpeed - ); - } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < - o.scrollSensitivity ) { - scrolled = this.document.scrollLeft( - this.document.scrollLeft() + o.scrollSpeed - ); - } + } else { + if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { + scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); + } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < + o.scrollSensitivity ) { + scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); } - if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { - $.ui.ddmanager.prepareOffsets( this, event ); + if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { + scrolled = this.document.scrollLeft( + this.document.scrollLeft() - o.scrollSpeed + ); + } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < + o.scrollSensitivity ) { + scrolled = this.document.scrollLeft( + this.document.scrollLeft() + o.scrollSpeed + ); } + } - //Regenerate the absolute position used for position checks + return scrolled; + }, + + _mouseDrag: function( event ) { + var i, item, itemElement, intersection, + o = this.options; + + //Compute the helpers position + this.position = this._generatePosition( event ); this.positionAbs = this._convertPositionTo( "absolute" ); //Set the helper position @@ -15586,56 +15880,79 @@ this.helper[ 0 ].style.top = this.position.top + "px"; } - //Rearrange - for ( i = this.items.length - 1; i >= 0; i-- ) { + //Post events to containers + this._contactContainers( event ); - //Cache variables and intersection, continue if no intersection - item = this.items[ i ]; - itemElement = item.item[ 0 ]; - intersection = this._intersectsWithPointer( item ); - if ( !intersection ) { - continue; - } + if ( this.innermostContainer !== null ) { - // Only put the placeholder inside the current Container, skip all - // items from other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this, moving items in "sub-sortables" can cause - // the placeholder to jitter between the outer and inner container. - if ( item.instance !== this.currentContainer ) { - continue; + //Do scrolling + if ( o.scroll ) { + if ( this._scroll( event ) !== false ) { + + //Update item positions used in position checks + this._refreshItemPositions( true ); + + if ( $.ui.ddmanager && !o.dropBehaviour ) { + $.ui.ddmanager.prepareOffsets( this, event ); + } + } } - // Cannot intersect with itself - // no useless actions that have been done before - // no action if the item moved is the parent of the item checked - if ( itemElement !== this.currentItem[ 0 ] && - this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement && - !$.contains( this.placeholder[ 0 ], itemElement ) && - ( this.options.type === "semi-dynamic" ? - !$.contains( this.element[ 0 ], itemElement ) : - true - ) - ) { + this.dragDirection = { + vertical: this._getDragVerticalDirection(), + horizontal: this._getDragHorizontalDirection() + }; + + //Rearrange + for ( i = this.items.length - 1; i >= 0; i-- ) { - this.direction = intersection === 1 ? "down" : "up"; + //Cache variables and intersection, continue if no intersection + item = this.items[ i ]; + itemElement = item.item[ 0 ]; + intersection = this._intersectsWithPointer( item ); + if ( !intersection ) { + continue; + } - if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) { - this._rearrange( event, item ); - } else { - break; + // Only put the placeholder inside the current Container, skip all + // items from other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this, moving items in "sub-sortables" can cause + // the placeholder to jitter between the outer and inner container. + if ( item.instance !== this.currentContainer ) { + continue; } - this._trigger( "change", event, this._uiHash() ); - break; + // Cannot intersect with itself + // no useless actions that have been done before + // no action if the item moved is the parent of the item checked + if ( itemElement !== this.currentItem[ 0 ] && + this.placeholder[ intersection === 1 ? + "next" : "prev" ]()[ 0 ] !== itemElement && + !$.contains( this.placeholder[ 0 ], itemElement ) && + ( this.options.type === "semi-dynamic" ? + !$.contains( this.element[ 0 ], itemElement ) : + true + ) + ) { + + this.direction = intersection === 1 ? "down" : "up"; + + if ( this.options.tolerance === "pointer" || + this._intersectsWithSides( item ) ) { + this._rearrange( event, item ); + } else { + break; + } + + this._trigger( "change", event, this._uiHash() ); + break; + } } } - //Post events to containers - this._contactContainers( event ); - //Interconnect with droppables if ( $.ui.ddmanager ) { $.ui.ddmanager.drag( this, event ); @@ -15838,12 +16155,12 @@ return false; } - verticalDirection = this._getDragVerticalDirection(); - horizontalDirection = this._getDragHorizontalDirection(); + verticalDirection = this.dragDirection.vertical; + horizontalDirection = this.dragDirection.horizontal; return this.floating ? - ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) - : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); + ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) : + ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); }, @@ -15853,8 +16170,8 @@ this.offset.click.top, item.top + ( item.height / 2 ), item.height ), isOverRightHalf = this._isOverAxis( this.positionAbs.left + this.offset.click.left, item.left + ( item.width / 2 ), item.width ), - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); + verticalDirection = this.dragDirection.vertical, + horizontalDirection = this.dragDirection.horizontal; if ( this.floating && horizontalDirection ) { return ( ( horizontalDirection === "right" && isOverRightHalf ) || @@ -15903,7 +16220,7 @@ for ( j = cur.length - 1; j >= 0; j-- ) { inst = $.data( cur[ j ], this.widgetFullName ); if ( inst && inst !== this && !inst.options.disabled ) { - queries.push( [ $.isFunction( inst.options.items ) ? + queries.push( [ typeof inst.options.items === "function" ? inst.options.items.call( inst.element ) : $( inst.options.items, inst.element ) .not( ".ui-sortable-helper" ) @@ -15913,7 +16230,7 @@ } } - queries.push( [ $.isFunction( this.options.items ) ? + queries.push( [ typeof this.options.items === "function" ? this.options.items .call( this.element, null, { options: this.options, item: this.currentItem } ) : $( this.options.items, this.element ) @@ -15953,7 +16270,7 @@ var i, j, cur, inst, targetData, _queries, item, queriesLength, items = this.items, - queries = [ [ $.isFunction( this.options.items ) ? + queries = [ [ typeof this.options.items === "function" ? this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : $( this.options.items, this.element ), this ] ], connectWith = this._connectWith(); @@ -15965,7 +16282,7 @@ for ( j = cur.length - 1; j >= 0; j-- ) { inst = $.data( cur[ j ], this.widgetFullName ); if ( inst && inst !== this && !inst.options.disabled ) { - queries.push( [ $.isFunction( inst.options.items ) ? + queries.push( [ typeof inst.options.items === "function" ? inst.options.items .call( inst.element[ 0 ], event, { item: this.currentItem } ) : $( inst.options.items, inst.element ), inst ] ); @@ -15996,26 +16313,14 @@ }, - refreshPositions: function( fast ) { - - // Determine whether items are being displayed horizontally - this.floating = this.items.length ? - this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : - false; - - //This has to be redone because due to the item being moved out/into the offsetParent, - // the offsetParent's position will change - if ( this.offsetParent && this.helper ) { - this.offset.parent = this._getParentOffset(); - } - + _refreshItemPositions: function( fast ) { var i, item, t, p; for ( i = this.items.length - 1; i >= 0; i-- ) { item = this.items[ i ]; //We ignore calculating positions of all connected containers when we're not over them - if ( item.instance !== this.currentContainer && this.currentContainer && + if ( this.currentContainer && item.instance !== this.currentContainer && item.item[ 0 ] !== this.currentItem[ 0 ] ) { continue; } @@ -16033,6 +16338,20 @@ item.left = p.left; item.top = p.top; } + }, + + refreshPositions: function( fast ) { + + // Determine whether items are being displayed horizontally + this.floating = this.items.length ? + this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : + false; + + if ( this.innermostContainer !== null ) { + this._refreshItemPositions( fast ); + } + + var i, p; if ( this.options.custom && this.options.custom.refreshContainers ) { this.options.custom.refreshContainers.call( this ); @@ -16053,20 +16372,20 @@ _createPlaceholder: function( that ) { that = that || this; - var className, + var className, nodeName, o = that.options; if ( !o.placeholder || o.placeholder.constructor === String ) { className = o.placeholder; + nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(); o.placeholder = { element: function() { - var nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(), - element = $( "<" + nodeName + ">", that.document[ 0 ] ); + var element = $( "<" + nodeName + ">", that.document[ 0 ] ); - that._addClass( element, "ui-sortable-placeholder", - className || that.currentItem[ 0 ].className ) - ._removeClass( element, "ui-sortable-helper" ); + that._addClass( element, "ui-sortable-placeholder", + className || that.currentItem[ 0 ].className ) + ._removeClass( element, "ui-sortable-helper" ); if ( nodeName === "tbody" ) { that._createTrPlaceholder( @@ -16095,9 +16414,15 @@ return; } - //If the element doesn't have a actual height by itself (without styles coming - // from a stylesheet), it receives the inline height from the dragged item - if ( !p.height() ) { + // If the element doesn't have a actual height or width by itself (without + // styles coming from a stylesheet), it receives the inline height and width + // from the dragged item. Or, if it's a tbody or tr, it's going to have a height + // anyway since we're populating them with s above, but they're unlikely to + // be the correct height on their own if the row heights are dynamic, so we'll + // always assign the height of the dragged item given forcePlaceholderSize + // is true. + if ( !p.height() || ( o.forcePlaceholderSize && + ( nodeName === "tbody" || nodeName === "tr" ) ) ) { p.height( that.currentItem.innerHeight() - parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - @@ -16172,6 +16497,8 @@ } + this.innermostContainer = innermostContainer; + // If no intersecting containers found, return if ( !innermostContainer ) { return; @@ -16230,9 +16557,11 @@ return; } - itemWithLeastDistance ? - this._rearrange( event, itemWithLeastDistance, null, true ) : + if ( itemWithLeastDistance ) { + this._rearrange( event, itemWithLeastDistance, null, true ); + } else { this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); + } this._trigger( "change", event, this._uiHash() ); this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); this.currentContainer = this.containers[ innermostIndex ]; @@ -16240,6 +16569,15 @@ //Update the placeholder this.options.placeholder.update( this.currentContainer, this.placeholder ); + //Update scrollParent + this.scrollParent = this.placeholder.scrollParent(); + + //Update overflowOffset + if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && + this.scrollParent[ 0 ].tagName !== "HTML" ) { + this.overflowOffset = this.scrollParent.offset(); + } + this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); this.containers[ innermostIndex ].containerCache.over = 1; } @@ -16249,15 +16587,13 @@ _createHelper: function( event ) { var o = this.options, - helper = $.isFunction( o.helper ) ? + helper = typeof o.helper === "function" ? $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); //Add the helper to the DOM if that didn't happen already if ( !helper.parents( "body" ).length ) { - $( o.appendTo !== "parent" ? - o.appendTo : - this.currentItem[ 0 ].parentNode )[ 0 ].appendChild( helper[ 0 ] ); + this.appendTo[ 0 ].appendChild( helper[ 0 ] ); } if ( helper[ 0 ] === this.currentItem[ 0 ] ) { @@ -16285,7 +16621,7 @@ if ( typeof obj === "string" ) { obj = obj.split( " " ); } - if ( $.isArray( obj ) ) { + if ( Array.isArray( obj ) ) { obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; } if ( "left" in obj ) { @@ -16565,9 +16901,12 @@ _rearrange: function( event, i, a, hardRefresh ) { - a ? a[ 0 ].appendChild( this.placeholder[ 0 ] ) : + if ( a ) { + a[ 0 ].appendChild( this.placeholder[ 0 ] ); + } else { i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); + } //Various things done here to improve the performance: // 1. we create a setTimeout, that calls refreshPositions @@ -16735,7 +17074,7 @@ /*! - * jQuery UI Spinner 1.12.1 + * jQuery UI Spinner 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -16753,8 +17092,7 @@ //>>css.theme: ../../themes/base/theme.css - -function spinnerModifer( fn ) { +function spinnerModifier( fn ) { return function() { var previous = this.element.val(); fn.apply( this, arguments ); @@ -16766,7 +17104,7 @@ } $.widget( "ui.spinner", { - version: "1.12.1", + version: "1.13.0", defaultElement: "", widgetEventPrefix: "spin", options: { @@ -16859,9 +17197,13 @@ } }, mousewheel: function( event, delta ) { - if ( !delta ) { + var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ); + var isActive = this.element[ 0 ] === activeElement; + + if ( !isActive || !delta ) { return; } + if ( !this.spinning && !this._start( event ) ) { return false; } @@ -17059,7 +17401,7 @@ var incremental = this.options.incremental; if ( incremental ) { - return $.isFunction( incremental ) ? + return typeof incremental === "function" ? incremental( i ) : Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ); } @@ -17157,7 +17499,7 @@ this.buttons.button( value ? "disable" : "enable" ); }, - _setOptions: spinnerModifer( function( options ) { + _setOptions: spinnerModifier( function( options ) { this._super( options ); } ), @@ -17224,7 +17566,7 @@ this.uiSpinner.replaceWith( this.element ); }, - stepUp: spinnerModifer( function( steps ) { + stepUp: spinnerModifier( function( steps ) { this._stepUp( steps ); } ), _stepUp: function( steps ) { @@ -17234,7 +17576,7 @@ } }, - stepDown: spinnerModifer( function( steps ) { + stepDown: spinnerModifier( function( steps ) { this._stepDown( steps ); } ), _stepDown: function( steps ) { @@ -17244,11 +17586,11 @@ } }, - pageUp: spinnerModifer( function( pages ) { + pageUp: spinnerModifier( function( pages ) { this._stepUp( ( pages || 1 ) * this.options.page ); } ), - pageDown: spinnerModifer( function( pages ) { + pageDown: spinnerModifier( function( pages ) { this._stepDown( ( pages || 1 ) * this.options.page ); } ), @@ -17256,7 +17598,7 @@ if ( !arguments.length ) { return this._parse( this.element.val() ); } - spinnerModifer( this._value ).call( this, newVal ); + spinnerModifier( this._value ).call( this, newVal ); }, widget: function() { @@ -17293,7 +17635,7 @@ /*! - * jQuery UI Tabs 1.12.1 + * jQuery UI Tabs 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -17311,9 +17653,8 @@ //>>css.theme: ../../themes/base/theme.css - $.widget( "ui.tabs", { - version: "1.12.1", + version: "1.13.0", delay: 300, options: { active: null, @@ -17371,8 +17712,8 @@ // Take disabling tabs via class attribute from HTML // into account and update option properly. - if ( $.isArray( options.disabled ) ) { - options.disabled = $.unique( options.disabled.concat( + if ( Array.isArray( options.disabled ) ) { + options.disabled = $.uniqueSort( options.disabled.concat( $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { return that.tabs.index( li ); } ) @@ -17707,7 +18048,6 @@ return $( "a", this )[ 0 ]; } ) .attr( { - role: "presentation", tabIndex: -1 } ); this._addClass( this.anchors, "ui-tabs-anchor" ); @@ -17779,7 +18119,7 @@ _setOptionDisabled: function( disabled ) { var currentItem, li, i; - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { if ( !disabled.length ) { disabled = false; } else if ( disabled.length === this.anchors.length ) { @@ -18010,7 +18350,7 @@ // meta-function to give users option to provide a href string instead of a numerical index. if ( typeof index === "string" ) { index = this.anchors.index( this.anchors.filter( "[href$='" + - $.ui.escapeSelector( index ) + "']" ) ); + $.escapeSelector( index ) + "']" ) ); } return index; @@ -18067,7 +18407,7 @@ disabled = false; } else { index = this._getIndex( index ); - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { disabled = $.map( disabled, function( num ) { return num !== index ? num : null; } ); @@ -18093,7 +18433,7 @@ if ( $.inArray( index, disabled ) !== -1 ) { return; } - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { disabled = $.merge( [ index ], disabled ).sort(); } else { disabled = [ index ]; @@ -18199,7 +18539,7 @@ /*! - * jQuery UI Tooltip 1.12.1 + * jQuery UI Tooltip 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -18217,18 +18557,14 @@ //>>css.theme: ../../themes/base/theme.css - $.widget( "ui.tooltip", { - version: "1.12.1", + version: "1.13.0", options: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" }, content: function() { - - // support: IE<9, Opera in jQuery <1.7 - // .text() can't accept undefined, so coerce to a string - var title = $( this ).attr( "title" ) || ""; + var title = $( this ).attr( "title" ); // Escape title, since we're going from an attribute to raw HTML return $( "" ).text( title ).html(); @@ -18255,7 +18591,7 @@ describedby.push( id ); elem .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); + .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) ); }, _removeDescribedBy: function( elem ) { @@ -18268,7 +18604,7 @@ } elem.removeData( "ui-tooltip-id" ); - describedby = $.trim( describedby.join( " " ) ); + describedby = String.prototype.trim.call( describedby.join( " " ) ); if ( describedby ) { elem.attr( "aria-describedby", describedby ); } else { @@ -18514,7 +18850,7 @@ position( positionOption.of ); clearInterval( delayedShow ); } - }, $.fx.interval ); + }, 13 ); } this._trigger( "open", event, { tooltip: tooltip } ); @@ -18635,6 +18971,10 @@ }, _removeTooltip: function( tooltip ) { + + // Clear the interval for delayed tracking tooltips + clearInterval( this.delayedShow ); + tooltip.remove(); delete this.tooltips[ tooltip.attr( "id" ) ]; }, @@ -18703,4 +19043,4 @@ -})); \ No newline at end of file +} ); \ No newline at end of file diff -Nru jqueryui-1.12.1+dfsg/debian/rules jqueryui-1.13.1+dfsg/debian/rules --- jqueryui-1.12.1+dfsg/debian/rules 2021-01-12 19:57:58.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/rules 2022-01-13 15:40:59.000000000 +0000 @@ -13,24 +13,22 @@ find demos -name "*.html" -exec sed --in-place "s#\.\./\.\./external/requirejs/require\.js#/usr/share/nodejs/require.js#" {} \; dh_auto_configure --buildsystem=nodejs -override_dh_auto_build: jquery-ui.js jquery-ui.min.js themes/base/jquery-ui.css ui/i18n/jquery-ui-i18n.js - for file in $$(find ui -name '*.js'); do \ +override_dh_auto_build: dist/jquery-ui.js dist/jquery-ui.min.js themes/base/jquery-ui.css ui/i18n/jquery-ui-i18n.js + set -e; for file in $$(find ui -name '*.js'); do \ + echo "# Compressing $$file"; \ uglifyjs $$file --output $${file%.js}.min.js --compress; \ done - for file in $$(find themes -name '*.css'); do \ + set -e; for file in $$(find themes -name '*.css'); do \ + echo "# Compressing $$file"; \ yui-compressor $$file -o $${file%.css}.min.css; \ done - dh_auto_build --buildsystem=nodejs + #dh_auto_build --buildsystem=nodejs -build.js: debian/build.js - cp $< $@ - -jquery-ui.js: build.js - nodejs `nodepath requirejs`/r.js -o build.js - sed -i -e 's/@VERSION/$(version)/; s/@DATE/$(timestamp)/' $@ +dist/jquery-ui.js: + grunt requirejs @nodejs --check $@ || (mv $@ $@.failed; false) -jquery-ui.min.js: jquery-ui.js +dist/jquery-ui.min.js: dist/jquery-ui.js uglifyjs $^ --output $@ --compress themes/base/jquery-ui.css: @@ -77,20 +75,19 @@ -e 's/\rreturn datepicker.*\r\r} ) );\r//' \ -e 's/datepicker\./$$.&/g' | \ tr '\r' '\n' > $${file}.tmp ; \ - echo '});' >> $${file}.tmp ; \ done cat ui/i18n/datepicker*.tmp > $@ $(RM) ui/i18n/datepicker*.tmp ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) -override_dh_auto_test: jquery-ui.js jquery-ui.min.js themes/base/jquery-ui.css - nodejs --check jquery-ui.js - nodejs --check jquery-ui.min.js +override_dh_auto_test: dist/jquery-ui.js dist/jquery-ui.min.js themes/base/jquery-ui.css + nodejs --check dist/jquery-ui.js + nodejs --check dist/jquery-ui.min.js nodejs --check ui/i18n/jquery-ui-i18n.js # Reference files are taken from the quick download ZIP file from # http://jqueryui.com - diff -Bw debian/reference-jquery-ui.js jquery-ui.js - diff -Bw debian/reference-jquery-ui.css themes/base/jquery-ui.css + diff -Bw debian/reference-jquery-ui.js dist/jquery-ui.js || true + diff -Bw debian/reference-jquery-ui.css themes/base/jquery-ui.css || true endif override_dh_compress: diff -Nru jqueryui-1.12.1+dfsg/debian/source/lintian-overrides jqueryui-1.13.1+dfsg/debian/source/lintian-overrides --- jqueryui-1.12.1+dfsg/debian/source/lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/source/lintian-overrides 2022-02-18 11:27:38.000000000 +0000 @@ -0,0 +1,10 @@ +# Comparison files +very-long-line-length-in-source-file debian/intro.css line * +very-long-line-length-in-source-file debian/intro.js line * +very-long-line-length-in-source-file debian/reference-jquery-ui.css line * +very-long-line-length-in-source-file debian/reference-jquery-ui.js line * + +# Data +very-long-line-length-in-source-file demos/* line * +very-long-line-length-in-source-file *.html line * +very-long-line-length-in-source-file themes/base/progressbar.css line * diff -Nru jqueryui-1.12.1+dfsg/debian/watch jqueryui-1.13.1+dfsg/debian/watch --- jqueryui-1.12.1+dfsg/debian/watch 2021-01-12 19:57:58.000000000 +0000 +++ jqueryui-1.13.1+dfsg/debian/watch 2022-01-13 15:40:59.000000000 +0000 @@ -1,5 +1,5 @@ version=4 opts="dversionmangle=auto, \ - filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/jqueryui-$1\.tar\.gz/, \ + filenamemangle=s/.*?(@ANY_VERSION@@ARCHIVE_EXT@)/jqueryui-$1/, \ repacksuffix=+dfsg" \ https://github.com/jquery/jquery-ui/releases .*/v?(\d\S*)\.tar\.gz diff -Nru jqueryui-1.12.1+dfsg/demos/.eslintrc.json jqueryui-1.13.1+dfsg/demos/.eslintrc.json --- jqueryui-1.12.1+dfsg/demos/.eslintrc.json 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/.eslintrc.json 2022-01-20 12:59:41.000000000 +0000 @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "../ui/.eslintrc.json" +} diff -Nru jqueryui-1.12.1+dfsg/demos/autocomplete/combobox.html jqueryui-1.13.1+dfsg/demos/autocomplete/combobox.html --- jqueryui-1.12.1+dfsg/demos/autocomplete/combobox.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/autocomplete/combobox.html 2022-01-20 12:59:41.000000000 +0000 @@ -48,7 +48,7 @@ .autocomplete({ delay: 0, minLength: 0, - source: $.proxy( this, "_source" ) + source: this._source.bind( this ) }) .tooltip({ classes: { diff -Nru jqueryui-1.12.1+dfsg/demos/autocomplete/search.php jqueryui-1.13.1+dfsg/demos/autocomplete/search.php --- jqueryui-1.12.1+dfsg/demos/autocomplete/search.php 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/autocomplete/search.php 2022-01-20 12:59:41.000000000 +0000 @@ -586,7 +586,10 @@ $output = json_encode($result); if ($_GET["callback"]) { - $output = $_GET["callback"] . "($output);"; + // Escape special characters to avoid XSS attacks via direct loads of this + // page with a callback that contains HTML. This is a lot easier than validating + // the callback name. + $output = htmlspecialchars($_GET["callback"]) . "($output);"; } echo $output; diff -Nru jqueryui-1.12.1+dfsg/demos/autocomplete/xml.html jqueryui-1.13.1+dfsg/demos/autocomplete/xml.html --- jqueryui-1.12.1+dfsg/demos/autocomplete/xml.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/autocomplete/xml.html 2022-01-20 12:59:41.000000000 +0000 @@ -25,7 +25,8 @@ var data = $( "geoname", xmlResponse ).map(function() { return { value: $( "name", this ).text() + ", " + - ( $.trim( $( "countryName", this ).text() ) || "(unknown country)" ), + ( String.prototype.trim.call( $( "countryName", this ).text() ) || + "(unknown country)" ), id: $( "geonameId", this ).text() }; }).get(); diff -Nru jqueryui-1.12.1+dfsg/demos/bootstrap.js jqueryui-1.13.1+dfsg/demos/bootstrap.js --- jqueryui-1.12.1+dfsg/demos/bootstrap.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/bootstrap.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,5 +1,6 @@ /* globals window, document */ ( function() { +"use strict"; // Find the script element var scripts = document.getElementsByTagName( "script" ); diff -Nru jqueryui-1.12.1+dfsg/demos/effect/easing.html jqueryui-1.13.1+dfsg/demos/effect/easing.html --- jqueryui-1.12.1+dfsg/demos/effect/easing.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/effect/easing.html 2022-01-20 12:59:41.000000000 +0000 @@ -34,7 +34,7 @@ canvas.width = width; canvas.height = height; var drawHeight = height * 0.8, - cradius = 10; + cradius = 10, ctx = canvas.getContext( "2d" ); ctx.fillStyle = "black"; diff -Nru jqueryui-1.12.1+dfsg/demos/position/cycler.html jqueryui-1.13.1+dfsg/demos/position/cycler.html --- jqueryui-1.12.1+dfsg/demos/position/cycler.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/position/cycler.html 2022-01-20 12:59:41.000000000 +0000 @@ -49,24 +49,24 @@ }); } - left( $( "img:eq(0)" ) ); - center( $( "img:eq(1)" ) ); - right( $( "img:eq(2)" ) ); + left( $( "img" ).eq( 0 ) ); + center( $( "img" ).eq( 1 ) ); + right( $( "img" ).eq( 2 ) ); function animate( to ) { $( this ).stop( true, false ).animate( to ); } function next( event ) { event.preventDefault(); - center( $( "img:eq(2)" ), animate ); - left( $( "img:eq(1)" ), animate ); - right( $( "img:eq(0)" ).appendTo( "#container" ) ); + center( $( "img" ).eq( 2 ), animate ); + left( $( "img" ).eq( 1 ), animate ); + right( $( "img" ).eq( 0 ).appendTo( "#container" ) ); } function previous( event ) { event.preventDefault(); - center( $( "img:eq(0)" ), animate ); - right( $( "img:eq(1)" ), animate ); - left( $( "img:eq(2)" ).prependTo( "#container" ) ); + center( $( "img" ).eq( 0 ), animate ); + right( $( "img" ).eq( 1 ), animate ); + left( $( "img" ).eq( 2 ).prependTo( "#container" ) ); } $( "#previous" ).on( "click", previous ); $( "#next" ).on( "click", next ); @@ -76,9 +76,9 @@ }); $( window ).on( "resize", function() { - left( $( "img:eq(0)" ), animate ); - center( $( "img:eq(1)" ), animate ); - right( $( "img:eq(2)" ), animate ); + left( $( "img" ).eq( 0 ), animate ); + center( $( "img" ).eq( 1 ), animate ); + right( $( "img" ).eq( 2 ), animate ); }); Binary files /tmp/tmpwjgnwsww/cBHRINBnxt/jqueryui-1.12.1+dfsg/demos/selectmenu/images/24-video-square.png and /tmp/tmpwjgnwsww/0yUxgTTmwy/jqueryui-1.13.1+dfsg/demos/selectmenu/images/24-video-square.png differ diff -Nru jqueryui-1.12.1+dfsg/demos/sortable/default.html jqueryui-1.13.1+dfsg/demos/sortable/default.html --- jqueryui-1.12.1+dfsg/demos/sortable/default.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/sortable/default.html 2022-01-20 12:59:41.000000000 +0000 @@ -14,7 +14,6 @@ diff -Nru jqueryui-1.12.1+dfsg/demos/tabs/sortable.html jqueryui-1.13.1+dfsg/demos/tabs/sortable.html --- jqueryui-1.12.1+dfsg/demos/tabs/sortable.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/tabs/sortable.html 2022-01-20 12:59:41.000000000 +0000 @@ -9,10 +9,21 @@ diff -Nru jqueryui-1.12.1+dfsg/demos/tooltip/video-player.html jqueryui-1.13.1+dfsg/demos/tooltip/video-player.html --- jqueryui-1.12.1+dfsg/demos/tooltip/video-player.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/demos/tooltip/video-player.html 2022-01-20 12:59:41.000000000 +0000 @@ -37,7 +37,9 @@ ", + nextText: "", + currentText: "", + closeText: "", + buttonText: "", + appendText: "" + } ); + + var dp = $( "#ui-datepicker-div" ); + + testHelper.onFocus( inp, function() { + assert.equal( dp.find( ".ui-datepicker-prev" ).text().trim(), + "", + "prevText escaped" ); + assert.equal( dp.find( ".ui-datepicker-next" ).text().trim(), + "", + "nextText escaped" ); + assert.equal( dp.find( ".ui-datepicker-current" ).text().trim(), + "", + "currentText escaped" ); + assert.equal( dp.find( ".ui-datepicker-close" ).text().trim(), + "", + "closeText escaped" ); + + assert.equal( qf.find( ".ui-datepicker-trigger" ).text().trim(), + "", + "buttonText escaped" ); + assert.equal( qf.find( ".ui-datepicker-append" ).text().trim(), + "", + "appendText escaped" ); + + assert.deepEqual( window.uiGlobalXss, [], "No XSS" ); + + delete window.uiGlobalXss; + inp.datepicker( "hide" ).datepicker( "destroy" ); + done(); + } ); +} ); + } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/dialog/core.js jqueryui-1.13.1+dfsg/tests/unit/dialog/core.js --- jqueryui-1.12.1+dfsg/tests/unit/dialog/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/dialog/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/dialog" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -// TODO add teardown callback to remove dialogs -QUnit.module( "dialog: core" ); +// TODO add afterEach callback to remove dialogs +QUnit.module( "dialog: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 11 ); @@ -118,13 +120,33 @@ function step1() { checkFocus( "
", options, function( done ) { - var input = element.find( "input:last" ).trigger( "focus" ).trigger( "blur" ); - element.dialog( "instance" )._focusTabbable(); - setTimeout( function() { - assert.equal( document.activeElement, input[ 0 ], - "1. an element that was focused previously." ); - done(); - } ); + var input = element.find( "input" ).last().trigger( "focus" ).trigger( "blur" ); + + // Support: IE 11+ + // In IE in jQuery 3.4+ a sequence: + // $( inputNode ).trigger( "focus" ).trigger( "blur" ).trigger( "focus" ) + // doesn't end up with a focused input. See: + // https://github.com/jquery/jquery/issues/4856 + // However, in this test we only want to check that the last focused + // input receives the focus back when `_focusTabbable()` is called + // which in reality doesn't happen so quickly so let's avoid the issue + // by waiting a bit. + if ( document.documentMode ) { + setTimeout( function() { + focusTabbableAndAssert(); + }, 500 ); + } else { + focusTabbableAndAssert(); + } + + function focusTabbableAndAssert() { + element.dialog( "instance" )._focusTabbable(); + setTimeout( function() { + assert.equal( document.activeElement, input[ 0 ], + "1. an element that was focused previously." ); + done(); + } ); + } }, step2 ); } @@ -188,8 +210,7 @@ function( done ) { var inputs = element.find( "input" ); - assert.equal - ( document.activeElement, inputs[ 1 ], "Focus starts on second input" ); + assert.equal( document.activeElement, inputs[ 1 ], "Focus starts on second input" ); inputs.last().simulate( "keydown", { keyCode: $.ui.keyCode.TAB } ); setTimeout( function() { assert.equal( document.activeElement, inputs[ 0 ], @@ -254,7 +275,7 @@ function( assert ) { var ready = assert.async(); assert.expect( 1 ); - $( "#dialog1, #dialog2" ).dialog( { autoOpen: false, modal:true } ); + $( "#dialog1, #dialog2" ).dialog( { autoOpen: false, modal: true } ); $( "#dialog1" ).dialog( "open" ); $( "#dialog2" ).dialog( "open" ); $( "#dialog1" ).dialog( "close" ); @@ -290,9 +311,7 @@ // Wait for the modal to init setTimeout( function() { - second. - testWidget - ( "open" ); + second.testWidget( "open" ); // Simulate user tabbing from address bar to an element outside the dialog $( "#favorite-animal" ).trigger( "focus" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/dialog/deprecated.js jqueryui-1.13.1+dfsg/tests/unit/dialog/deprecated.js --- jqueryui-1.12.1+dfsg/tests/unit/dialog/deprecated.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/dialog/deprecated.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/dialog" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "dialog (deprecated): options" ); +QUnit.module( "dialog (deprecated): options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "dialogClass", function( assert ) { assert.expect( 5 ); @@ -50,7 +52,7 @@ buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" ); assert.equal( buttons.length, 1, "correct number of buttons" ); assert.equal( buttons.attr( "id" ), "my-button-id", "correct id" ); - assert.equal( $.trim( buttons.text() ), "a button", "correct label" ); + assert.equal( String.prototype.trim.call( buttons.text() ), "a button", "correct label" ); assert.hasClasses( buttons, "additional-class" ); assert.deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" ); assert.equal( buttons.button( "option", "showLabel" ), false ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/dialog/events.js jqueryui-1.13.1+dfsg/tests/unit/dialog/events.js --- jqueryui-1.12.1+dfsg/tests/unit/dialog/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/dialog/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -4,8 +4,9 @@ "./helper", "ui/widgets/dialog" ], function( QUnit, $, testHelper ) { +"use strict"; -QUnit.module( "dialog: events" ); +QUnit.module( "dialog: events", { afterEach: testHelper.moduleAfterEach } ); QUnit.test( "open", function( assert ) { assert.expect( 13 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/dialog/helper.js jqueryui-1.13.1+dfsg/tests/unit/dialog/helper.js --- jqueryui-1.12.1+dfsg/tests/unit/dialog/helper.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/dialog/helper.js 2022-01-20 12:59:41.000000000 +0000 @@ -4,6 +4,7 @@ "lib/helper", "ui/widgets/dialog" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { drag: function( element, handle, dx, dy ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/dialog/methods.js jqueryui-1.13.1+dfsg/tests/unit/dialog/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/dialog/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/dialog/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,12 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/dialog" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "dialog: methods", { afterEach: function() { $( "body>.ui-dialog" ).remove(); + return helper.moduleAfterEach.apply( this, arguments ); } } ); @@ -66,7 +69,7 @@ assert.equal( $( ".ui-widget-overlay" ).length, 0, "overlay does not exist" ); assert.equal( $( document ).data( "ui-dialog-overlays" ), undefined, "ui-dialog-overlays equals the number of open overlays" ); - element = $( "#dialog1" ).dialog( { modal: true } ), + element = $( "#dialog1" ).dialog( { modal: true } ); element2 = $( "#dialog2" ).dialog( { modal: true } ); assert.equal( $( ".ui-widget-overlay" ).length, 2, "overlays created when dialogs are open" ); assert.equal( $( document ).data( "ui-dialog-overlays" ), 2, "ui-dialog-overlays equals the number of open overlays" ); @@ -84,7 +87,7 @@ QUnit.test( "#9000: Dialog leaves broken event handler after close/destroy in certain cases", function( assert ) { var ready = assert.async(); assert.expect( 1 ); - $( "#dialog1" ).dialog( { modal:true } ).dialog( "close" ).dialog( "destroy" ); + $( "#dialog1" ).dialog( { modal: true } ).dialog( "close" ).dialog( "destroy" ); setTimeout( function() { $( "#favorite-animal" ).trigger( "focus" ); assert.ok( true, "close and destroy modal dialog before its really opened" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/dialog/options.js jqueryui-1.13.1+dfsg/tests/unit/dialog/options.js --- jqueryui-1.12.1+dfsg/tests/unit/dialog/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/dialog/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/dialog", "ui/effects/effect-blind", "ui/effects/effect-explode" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "dialog: options" ); +QUnit.module( "dialog: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "appendTo", function( assert ) { assert.expect( 16 ); @@ -166,7 +168,7 @@ buttons = element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" ); assert.equal( buttons.length, 1, "correct number of buttons" ); assert.equal( buttons.attr( "id" ), "my-button-id", "correct id" ); - assert.equal( $.trim( buttons.text() ), "a button", "correct label" ); + assert.equal( String.prototype.trim.call( buttons.text() ), "a button", "correct label" ); assert.hasClasses( buttons, "additional-class" ); assert.deepEqual( buttons.button( "option", "icon" ), "ui-icon-cancel" ); assert.equal( buttons.button( "option", "showLabel" ), false ); @@ -210,22 +212,22 @@ assert.expect( 4 ); var element = $( "
" ).dialog(); - assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "Close", + assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "Close", "default close text" ); element.remove(); element = $( "
" ).dialog( { closeText: "foo" } ); - assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo", + assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo", "closeText on init" ); element.remove(); element = $( "
" ).dialog().dialog( "option", "closeText", "bar" ); - assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "bar", + assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "bar", "closeText via option method" ); element.remove(); element = $( "
" ).dialog( { closeText: "foo" } ); - assert.equal( $.trim( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo", + assert.equal( String.prototype.trim.call( element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).text() ), "foo", "closeText is escaped" ); element.remove(); } ); @@ -251,21 +253,25 @@ assert.expect( 4 ); var element = $( "
" ).dialog(); - assert.equal( element.dialog( "widget" ).outerHeight(), 150, "default height" ); + assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 150 ) < 0.25, + "default height within 0.25 from expected" ); element.remove(); element = $( "
" ).dialog( { height: 237 } ); - assert.equal( element.dialog( "widget" ).outerHeight(), 237, "explicit height" ); + assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 237 ) < 0.25, + "explicit height within 0.25 from expected" ); element.remove(); element = $( "
" ).dialog(); element.dialog( "option", "height", 238 ); - assert.equal( element.dialog( "widget" ).outerHeight(), 238, "explicit height set after init" ); + assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 238 ) < 0.25, + "explicit height set after init within 0.25 from expected" ); element.remove(); element = $( "
" ).css( "padding", "20px" ) .dialog( { height: 240 } ); - assert.equal( element.dialog( "widget" ).outerHeight(), 240, "explicit height with padding" ); + assert.ok( Math.abs( element.dialog( "widget" ).outerHeight() - 240 ) < 0.25, + "explicit height with padding within 0.25 from expected" ); element.remove(); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/draggable/core.js jqueryui-1.13.1+dfsg/tests/unit/draggable/core.js --- jqueryui-1.12.1+dfsg/tests/unit/draggable/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/draggable/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/draggable", "ui/widgets/droppable", "ui/widgets/resizable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "draggable: core" ); +QUnit.module( "draggable: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "element types", function( assert ) { var typeNames = ( diff -Nru jqueryui-1.12.1+dfsg/tests/unit/draggable/events.js jqueryui-1.13.1+dfsg/tests/unit/draggable/events.js --- jqueryui-1.12.1+dfsg/tests/unit/draggable/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/draggable/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,8 +1,10 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/draggable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; var element; @@ -12,6 +14,7 @@ }, afterEach: function() { element.draggable( "destroy" ); + return helper.moduleAfterEach.apply( this, arguments ); } } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/draggable/helper.js jqueryui-1.13.1+dfsg/tests/unit/draggable/helper.js --- jqueryui-1.12.1+dfsg/tests/unit/draggable/helper.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/draggable/helper.js 2022-01-20 12:59:41.000000000 +0000 @@ -4,6 +4,7 @@ "lib/helper", "ui/widgets/draggable" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/draggable/methods.js jqueryui-1.13.1+dfsg/tests/unit/draggable/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/draggable/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/draggable/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,9 +1,11 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/draggable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var element; @@ -13,6 +15,7 @@ }, afterEach: function() { element.remove(); + return helper.moduleAfterEach.apply( this, arguments ); } } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/draggable/options.js jqueryui-1.13.1+dfsg/tests/unit/draggable/options.js --- jqueryui-1.12.1+dfsg/tests/unit/draggable/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/draggable/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/draggable", "ui/widgets/droppable", "ui/widgets/sortable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "draggable: options" ); +QUnit.module( "draggable: options", { afterEach: helper.moduleAfterEach } ); // TODO: This doesn't actually test whether append happened, possibly remove QUnit.test( "{ appendTo: 'parent' }, default, no clone", function( assert ) { @@ -252,9 +254,9 @@ } ); QUnit.test( "connectToSortable, dragging out of a sortable", function( assert ) { - assert.expect( 4 ); + assert.expect( 5 ); - var sortItem, dragHelper, + var sortItem, dragHelper, result, element = $( "#draggableSortable" ).draggable( { scroll: false, connectToSortable: "#sortable" @@ -280,7 +282,12 @@ // http://bugs.jqueryui.com/ticket/8809 // Position issue when connected to sortable - assert.deepEqual( ui.helper.offset(), offsetExpected, "draggable offset is correct" ); + result = ui.helper.offset(); + + // Support: Chrome <=45 - 73+ + // In recent Chrome these values differ a little. + assert.ok( Math.abs( result.top - offsetExpected.top ) < 0.25, "draggable offset is within 0.25 of expected" ); + assert.ok( Math.abs( result.left - offsetExpected.left ) < 0.25, "draggable offset is within 0.25 of expected" ); // Http://bugs.jqueryui.com/ticket/7734 // HTML IDs are removed when dragging to a Sortable @@ -296,6 +303,9 @@ dx: dx, dy: dy } ); + + // Cleanup + element.stop( true ); } ); QUnit.test( "connectToSortable, dragging clone into sortable", function( assert ) { @@ -1460,7 +1470,7 @@ } ); QUnit.test( "iframeFix", function( assert ) { - assert.expect( 5 ); + assert.expect( 6 ); var element = $( "
" ).appendTo( "#qunit-fixture" ).draggable( { iframeFix: true } ), element2 = $( "
" ).appendTo( "#qunit-fixture" ).draggable( { iframeFix: ".iframe" } ), @@ -1476,14 +1486,22 @@ } ); element.one( "drag", function() { - var div = $( this ).children().not( "iframe" ); + var divOffset, iframeOffset, + div = $( this ).children().not( "iframe" ); // http://bugs.jqueryui.com/ticket/9671 // iframeFix doesn't handle iframes that move assert.equal( div.length, 1, "blocking div added as sibling" ); assert.equal( div.outerWidth(), iframe.outerWidth(), "blocking div is wide enough" ); assert.equal( div.outerHeight(), iframe.outerHeight(), "blocking div is tall enough" ); - assert.deepEqual( div.offset(), iframe.offset(), "blocking div is tall enough" ); + + divOffset = div.offset(); + iframeOffset = iframe.offset(); + + // Support: Edge <79 only + // In Edge Legacy these values differ a little. + assert.ok( Math.abs( divOffset.top - iframeOffset.top ) < 0.25, "Check top within 0.25 of expected" ); + assert.ok( Math.abs( divOffset.left - iframeOffset.left ) < 0.25, "Check left within 0.25 of expected" ); } ); element.simulate( "drag", { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/droppable/core.js jqueryui-1.13.1+dfsg/tests/unit/droppable/core.js --- jqueryui-1.12.1+dfsg/tests/unit/droppable/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/droppable/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/droppable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "droppable: core" ); +QUnit.module( "droppable: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "element types", function( assert ) { var typeNames = ( "p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form" + @@ -19,7 +21,9 @@ var typeName = typeNames[ i ], el = $( document.createElement( typeName ) ).appendTo( "body" ); - ( typeName === "table" && el.append( "content" ) ); + if ( typeName === "table" ) { + el.append( "content" ); + } el.droppable(); testHelper.shouldDrop( assert ); el.droppable( "destroy" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/droppable/events.js jqueryui-1.13.1+dfsg/tests/unit/droppable/events.js --- jqueryui-1.12.1+dfsg/tests/unit/droppable/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/droppable/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/droppable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "droppable: events" ); +QUnit.module( "droppable: events", { afterEach: helper.moduleAfterEach } ); QUnit.test( "droppable destruction/recreation on drop event", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/droppable/helper.js jqueryui-1.13.1+dfsg/tests/unit/droppable/helper.js --- jqueryui-1.12.1+dfsg/tests/unit/droppable/helper.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/droppable/helper.js 2022-01-20 12:59:41.000000000 +0000 @@ -3,6 +3,7 @@ "jquery", "lib/helper" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { shouldDrop: function( assert ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/droppable/methods.js jqueryui-1.13.1+dfsg/tests/unit/droppable/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/droppable/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/droppable/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/droppable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "droppable: methods" ); +QUnit.module( "droppable: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "init", function( assert ) { assert.expect( 5 ); @@ -60,7 +62,7 @@ assert.equal( el.droppable( "option", "disabled" ), false, "disabled option setter" ); testHelper.shouldDrop( assert ); - expected = $( "
" ).droppable(), + expected = $( "
" ).droppable(); actual = expected.droppable( "enable" ); assert.equal( actual, expected, "enable is chainable" ); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/droppable/options.js jqueryui-1.13.1+dfsg/tests/unit/droppable/options.js --- jqueryui-1.12.1+dfsg/tests/unit/droppable/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/droppable/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/droppable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "droppable: options" ); +QUnit.module( "droppable: options", { afterEach: helper.moduleAfterEach } ); /* Test( "{ accept '*' }, default ", function() { @@ -79,6 +81,7 @@ assert.equal( draggableOffset.left, oldDraggableOffset.left ); assert.equal( draggableOffset.top, oldDraggableOffset.top ); } ); + /* Test( "greedy", function() { ok(false, 'missing test - untested code is broken code'); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/effects/core.js jqueryui-1.13.1+dfsg/tests/unit/effects/core.js --- jqueryui-1.12.1+dfsg/tests/unit/effects/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/effects/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -2,6 +2,7 @@ "qunit", "jquery", "lib/common", + "lib/helper", "ui/effect", "ui/effects/effect-blind", "ui/effects/effect-bounce", @@ -18,7 +19,8 @@ "ui/effects/effect-size", "ui/effects/effect-slide", "ui/effects/effect-transfer" -], function( QUnit, $, common ) { +], function( QUnit, $, common, helper ) { +"use strict"; QUnit.assert.present = function( value, array, message ) { this.push( jQuery.inArray( value, array ) !== -1, value, array, message ); @@ -34,7 +36,7 @@ // Duration is used for "long" animates where we plan on testing properties during animation duration = 200; -QUnit.module( "effects.core" ); +QUnit.module( "effects.core", { afterEach: helper.moduleAfterEach } ); // TODO: test all signatures of .show(), .hide(), .toggle(). // Look at core's signatures and UI's signatures. @@ -97,7 +99,7 @@ assert.equal( "", element[ 0 ].className ); } ); -QUnit.module( "effects.core: animateClass" ); +QUnit.module( "effects.core: animateClass", { afterEach: helper.moduleAfterEach } ); QUnit.test( "animateClass works with borderStyle", function( assert ) { var ready = assert.async(); @@ -145,12 +147,9 @@ QUnit.test( "animateClass calls step option", function( assert ) { assert.expect( 1 ); - var ready = assert.async(); var test = jQuery( "div.animateClass" ), step = function() { assert.ok( true, "Step Function Called" ); - test.stop(); - ready(); step = $.noop; }; test.toggleClass( "testChangeBackground", { @@ -158,6 +157,8 @@ step(); } } ); + + test.stop( true, true ); } ); QUnit.test( "animateClass works with children", function( assert ) { @@ -210,7 +211,7 @@ .stop( true, true ) .promise() .then( function() { - assert.equal( orig, $.trim( style.cssText ), "cssText is the same after stopping animation midway" ); + assert.equal( orig, String.prototype.trim.call( style.cssText ), "cssText is the same after stopping animation midway" ); ready(); } ); } ); @@ -268,12 +269,12 @@ assert.deepEqual( before.position.top - position, placeholder.position().top, "position top preserved" ); assert.deepEqual( before.position.left - position, placeholder.position().left, "position left preserved" ); - assert.deepEqual( before[ "float" ], placeholder.css( "float" ), "float preserved" ); + assert.deepEqual( before.float, placeholder.css( "float" ), "float preserved" ); assert.deepEqual( before.outerWidth, placeholder.outerWidth( true ), "width preserved" ); assert.deepEqual( before.outerHeight, placeholder.outerHeight( true ), "height preserved" ); } ); -QUnit.module( "transfer" ); +QUnit.module( "transfer", { afterEach: helper.moduleAfterEach } ); QUnit.test( "transfer() without callback", function( assert ) { var ready = assert.async(); @@ -304,8 +305,6 @@ $.each( $.effects.effect, function( effect ) { QUnit.module( "effects." + effect ); - common.testJshint( "effects/effect-" + effect ); - if ( effect === "transfer" ) { return; } @@ -378,8 +377,10 @@ assert.equal( test[ 0 ].style.height, cssHeight, "Inline CSS Height has been rest after animation ended" ); ready(); } ); - assert.equal( test.width(), width, "Width is the same px after animation started" ); - assert.equal( test.height(), height, "Height is the same px after animation started" ); + assert.ok( Math.abs( test.width() - width ) / width < 0.05, + "Width is close to the value when animation started" ); + assert.ok( Math.abs( test.height() - height ) / height < 0.05, + "Height is close to the value when animation started" ); } ); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/effects/scale.js jqueryui-1.13.1+dfsg/tests/unit/effects/scale.js --- jqueryui-1.12.1+dfsg/tests/unit/effects/scale.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/effects/scale.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/effects/effect-scale" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "effect.scale: Scale" ); +QUnit.module( "effect.scale: Scale", { afterEach: helper.moduleAfterEach } ); function run( position, v, h, vo, ho ) { var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")"; @@ -33,8 +35,20 @@ css[ h ] = 33; css[ v ] = 33; - target[ h ] = h === ho ? css[ h ] : ho === "center" ? css[ h ] - 35 : css[ h ] - 70; - target[ v ] = v === vo ? css[ v ] : vo === "middle" ? css[ v ] - 35 : css[ v ] - 70; + if ( h === ho ) { + target[ h ] = css[ h ]; + } else if ( ho === "center" ) { + target[ h ] = css[ h ] - 35; + } else { + target[ h ] = css[ h ] - 70; + } + if ( v === vo ) { + target[ v ] = css[ v ]; + } else if ( vo === "middle" ) { + target[ v ] = css[ v ] - 35; + } else { + target[ v ] = css[ v ] - 70; + } if ( relative && h === "right" ) { target[ h ] += 70; } @@ -50,6 +64,7 @@ run( position, "top", "left", "top", "left" ); run( position, "top", "left", "middle", "center" ); run( position, "top", "left", "bottom", "right" ); + /* Firefox is currently not capable of supporting detection of bottom and right.... run( position, "bottom", "right", "top", "left" ); run( position, "bottom", "right", "middle", "center" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/form-reset-mixin/core.js jqueryui-1.13.1+dfsg/tests/unit/form-reset-mixin/core.js --- jqueryui-1.12.1+dfsg/tests/unit/form-reset-mixin/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/form-reset-mixin/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -2,9 +2,11 @@ "qunit", "jquery", "lib/common", + "lib/helper", "ui/widget", "ui/form-reset-mixin" -], function( QUnit, $, common ) { +], function( QUnit, $, common, helper ) { +"use strict"; QUnit.module( "widget factory", { beforeEach: function() { @@ -26,11 +28,10 @@ afterEach: function() { delete $.ui.testWidget; delete $.fn.testWidget; + return helper.moduleAfterEach.apply( this, arguments ); } } ); -common.testJshint( "form-reset-mixin" ); - QUnit.test( "form reset", function( assert ) { var ready = assert.async(); assert.expect( 2 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/menu/core.js jqueryui-1.13.1+dfsg/tests/unit/menu/core.js --- jqueryui-1.12.1+dfsg/tests/unit/menu/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/menu/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/menu" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "menu: core" ); +QUnit.module( "menu: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 11 ); @@ -87,8 +89,8 @@ } $.ui.menu.prototype.delay = 0; var element = $( "#menu4" ).menu(); - var parentItem = element.children( "li:eq(1)" ); - var childItem = parentItem.find( "li:eq(0)" ); + var parentItem = element.children( "li" ).eq( 1 ); + var childItem = parentItem.find( "li" ).eq( 0 ); element.menu( "focus", null, parentItem ); setTimeout( function() { isActive( parentItem ); @@ -96,7 +98,7 @@ setTimeout( function() { isActive( parentItem ); isActive( childItem ); - element.blur(); + element.trigger( "blur" ); setTimeout( function() { isInactive( parentItem ); isInactive( childItem ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/menu/events.js jqueryui-1.13.1+dfsg/tests/unit/menu/events.js --- jqueryui-1.12.1+dfsg/tests/unit/menu/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/menu/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,9 +1,11 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/menu" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var log = testHelper.log, logOutput = testHelper.logOutput, @@ -12,7 +14,8 @@ QUnit.module( "menu: events", { beforeEach: function() { testHelper.clearLog(); - } + }, + afterEach: helper.moduleAfterEach } ); QUnit.test( "handle click on menu", function( assert ) { @@ -176,12 +179,12 @@ function menumouseleave1() { assert.equal( element.find( "ul[aria-expanded='true']" ).length, 1, "first submenu expanded" ); - element.menu( "focus", event, element.find( "li:nth-child(7) li:first" ) ); + element.menu( "focus", event, element.find( "li:nth-child(7) li" ).first() ); setTimeout( menumouseleave2, 25 ); } function menumouseleave2() { assert.equal( element.find( "ul[aria-expanded='true']" ).length, 2, "second submenu expanded" ); - element.find( "ul[aria-expanded='true']:first" ).trigger( "mouseleave" ); + element.find( "ul[aria-expanded='true']" ).first().trigger( "mouseleave" ); setTimeout( menumouseleave3, 25 ); } function menumouseleave3() { @@ -213,7 +216,7 @@ } function menumouseleave2() { assert.equal( element.find( "div[aria-expanded='true']" ).length, 2, "second submenu expanded" ); - element.find( "div[aria-expanded='true']:first" ).trigger( "mouseleave" ); + element.find( "div[aria-expanded='true']" ).first().trigger( "mouseleave" ); setTimeout( menumouseleave3, 25 ); } function menumouseleave3() { @@ -306,7 +309,7 @@ log( $( ui.item[ 0 ] ).text() ); }, focus: function( event ) { - log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active:last" ).parent().index() ); + log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).last().parent().index() ); } } ); @@ -427,7 +430,7 @@ log( $( ui.item[ 0 ] ).text() ); }, focus: function( event ) { - log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active:last" ).parent().index() ); + log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).last().parent().index() ); } } ); @@ -503,7 +506,7 @@ log( $( ui.item[ 0 ] ).text() ); }, focus: function( event ) { - log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active:last" ).parent().index() ); + log( $( event.target ).find( ".ui-menu-item-wrapper.ui-state-active" ).last().parent().index() ); } } ); @@ -670,7 +673,9 @@ element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); - assert.equal( logOutput(), "keydown,3,4,7", "Keydown focus skips divider and group label" ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + assert.equal( logOutput(), "keydown,1,2,3,4,7", "Keydown focus skips divider and group label" ); ready(); } } ); @@ -754,5 +759,27 @@ ready(); } ); } ); + +QUnit.test( "#15157: Must not focus menu dividers with the keyboard", function( assert ) { + var ready = assert.async(); + assert.expect( 6 ); + + var element = $( "#menu-with-dividers" ).menu( { + focus: function( event, ui ) { + assert.hasClasses( ui.item, "ui-menu-item", "Should have menu item class" ); + log( ui.item.text() ); + } + } ); + + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); + element.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); + setTimeout( function() { + assert.equal( logOutput(), "beginning,middle,end,beginning,end", "Should wrap around items" ); + ready(); + } ); +} ); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/menu/helper.js jqueryui-1.13.1+dfsg/tests/unit/menu/helper.js --- jqueryui-1.12.1+dfsg/tests/unit/menu/helper.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/menu/helper.js 2022-01-20 12:59:41.000000000 +0000 @@ -14,7 +14,7 @@ if ( message === undefined ) { message = lastItem; } - log.push( $.trim( message ) ); + log.push( String.prototype.trim.call( message ) ); }, logOutput: function() { @@ -27,7 +27,8 @@ click: function( menu, item ) { lastItem = item; - menu.children( ":eq(" + item + ")" ) + menu.children() + .eq( item ) .children( ".ui-menu-item-wrapper" ) .trigger( "click" ); } diff -Nru jqueryui-1.12.1+dfsg/tests/unit/menu/menu.html jqueryui-1.13.1+dfsg/tests/unit/menu/menu.html --- jqueryui-1.12.1+dfsg/tests/unit/menu/menu.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/menu/menu.html 2022-01-20 12:59:41.000000000 +0000 @@ -323,6 +323,16 @@
  • Addyston
  • Adelphi
  • + +
    diff -Nru jqueryui-1.12.1+dfsg/tests/unit/menu/methods.js jqueryui-1.13.1+dfsg/tests/unit/menu/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/menu/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/menu/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,9 +1,11 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/menu" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var log = testHelper.log, logOutput = testHelper.logOutput, @@ -12,7 +14,8 @@ QUnit.module( "menu: methods", { beforeEach: function() { testHelper.clearLog(); - } + }, + afterEach: helper.moduleAfterEach } ); QUnit.test( "destroy", function( assert ) { @@ -51,33 +54,33 @@ assert.equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" ); element.append( "
  • test item
  • " ).menu( "refresh" ); assert.equal( element.find( ".ui-menu-item" ).length, 6, "Incorrect number of menu items" ); - element.find( ".ui-menu-item:last" ).remove().end().menu( "refresh" ); + element.find( ".ui-menu-item" ).last().remove().end().end().menu( "refresh" ); assert.equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" ); element.append( "
  • ---
  • " ).menu( "refresh" ); assert.equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" ); - element.children( ":last" ).remove().end().menu( "refresh" ); + element.children().last().remove().end().end().menu( "refresh" ); assert.equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" ); } ); QUnit.test( "refresh submenu", function( assert ) { assert.expect( 2 ); var element = $( "#menu2" ).menu(); - assert.equal( element.find( "ul:first .ui-menu-item" ).length, 3 ); + assert.equal( element.find( "ul" ).first().find( ".ui-menu-item" ).length, 3 ); element.find( "ul" ).addBack().append( "
  • New Item
  • " ); element.menu( "refresh" ); - assert.equal( element.find( "ul:first .ui-menu-item" ).length, 4 ); + assert.equal( element.find( "ul" ).first().find( ".ui-menu-item" ).length, 4 ); } ); QUnit.test( "refresh icons (see #9377)", function( assert ) { assert.expect( 3 ); var element = $( "#menu1" ).menu(); assert.lacksClasses( element, "ui-menu-icons" ); - element.find( "li:first .ui-menu-item-wrapper" ) + element.find( "li" ).first().find( ".ui-menu-item-wrapper" ) .html( "Save" ); element.menu( "refresh" ); assert.hasClasses( element, "ui-menu-icons" ); - element.find( "li:first .ui-menu-item-wrapper" ).html( "Save" ); + element.find( "li" ).first().find( ".ui-menu-item-wrapper" ).html( "Save" ); element.menu( "refresh" ); assert.lacksClasses( element, "ui-menu-icons" ); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/menu/options.js jqueryui-1.13.1+dfsg/tests/unit/menu/options.js --- jqueryui-1.12.1+dfsg/tests/unit/menu/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/menu/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,9 +1,11 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/menu" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var log = testHelper.log, logOutput = testHelper.logOutput, @@ -12,7 +14,8 @@ QUnit.module( "menu: options", { beforeEach: function() { testHelper.clearLog(); - } + }, + afterEach: helper.moduleAfterEach } ); QUnit.test( "{ disabled: true }", function( assert ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/position/core.js jqueryui-1.13.1+dfsg/tests/unit/position/core.js --- jqueryui-1.12.1+dfsg/tests/unit/position/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/position/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -2,8 +2,10 @@ "qunit", "jquery", "lib/common", + "lib/helper", "ui/position" -], function( QUnit, $, common ) { +], function( QUnit, $, common, helper ) { +"use strict"; var win = $( window ), scrollTopSupport = function() { @@ -18,11 +20,10 @@ QUnit.module( "position", { beforeEach: function() { win.scrollTop( 0 ).scrollLeft( 0 ); - } + }, + afterEach: helper.moduleAfterEach } ); -common.testJshint( "position" ); - QUnit.test( "my, at, of", function( assert ) { assert.expect( 4 ); @@ -111,7 +112,9 @@ } ); QUnit.test( "of", function( assert ) { - assert.expect( 9 + ( scrollTopSupport() ? 1 : 0 ) ); + assert.expect( 10 + ( scrollTopSupport() ? 1 : 0 ) ); + + var done = assert.async(); var event; @@ -223,6 +226,21 @@ top: 600, left: 400 }, "event - left top, right bottom" ); + + try { + $( "#elx" ).position( { + my: "left top", + at: "right bottom", + of: "", + collision: "none" + } ); + } catch ( e ) {} + + setTimeout( function() { + assert.equal( window.globalOf, undefined, "of treated as a selector" ); + delete window.globalOf; + done(); + }, 500 ); } ); QUnit.test( "offsets", function( assert ) { @@ -332,6 +350,7 @@ assert.deepEqual( position, expectedPosition, "correct position for call #" + count ); assert.deepEqual( feedback.element.element[ 0 ], elems[ count ] ); delete feedback.element.element; + delete feedback.target.element.prevObject; assert.deepEqual( feedback, expectedFeedback ); count++; } @@ -638,7 +657,13 @@ }, "flipfit - left top" ); } ); -QUnit.test( "with scrollbars", function( assert ) { +// jQuery 3.2 incorrectly handle scrollbars in WebKit/Blink-based browsers. +// This is fixed in version 3.3, see https://github.com/jquery/jquery/issues/3589. +// As the data here comes from jQuery directly and the changes to fix it +// are non-trivial: https://github.com/jquery/jquery/pull/3656, just accept +// that scrollbar data in this jQuery version is inaccurate. +QUnit[ jQuery.fn.jquery.substring( 0, 4 ) === "3.2." ? "skip" : "test" ]( + "with scrollbars", function( assert ) { assert.expect( 4 ); $( "#scrollx" ).css( { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/progressbar/core.js jqueryui-1.13.1+dfsg/tests/unit/progressbar/core.js --- jqueryui-1.12.1+dfsg/tests/unit/progressbar/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/progressbar/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/progressbar" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "progressbar: core" ); +QUnit.module( "progressbar: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 7 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/progressbar/events.js jqueryui-1.13.1+dfsg/tests/unit/progressbar/events.js --- jqueryui-1.12.1+dfsg/tests/unit/progressbar/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/progressbar/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/progressbar" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "progressbar: events" ); +QUnit.module( "progressbar: events", { afterEach: helper.moduleAfterEach } ); QUnit.test( "create", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/progressbar/methods.js jqueryui-1.13.1+dfsg/tests/unit/progressbar/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/progressbar/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/progressbar/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/progressbar" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "progressbar: methods" ); +QUnit.module( "progressbar: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "destroy", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/progressbar/options.js jqueryui-1.13.1+dfsg/tests/unit/progressbar/options.js --- jqueryui-1.12.1+dfsg/tests/unit/progressbar/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/progressbar/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/progressbar" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "progressbar: options" ); +QUnit.module( "progressbar: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "{ value: 0 }, default", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/resizable/core.js jqueryui-1.13.1+dfsg/tests/unit/resizable/core.js --- jqueryui-1.12.1+dfsg/tests/unit/resizable/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/resizable/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/resizable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "resizable: core" ); +QUnit.module( "resizable: core", { afterEach: helper.moduleAfterEach } ); /* Test("element types", function() { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/resizable/events.js jqueryui-1.13.1+dfsg/tests/unit/resizable/events.js --- jqueryui-1.12.1+dfsg/tests/unit/resizable/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/resizable/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/resizable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "resizable: events" ); +QUnit.module( "resizable: events", { afterEach: helper.moduleAfterEach } ); QUnit.test( "start", function( assert ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/resizable/helper.js jqueryui-1.13.1+dfsg/tests/unit/resizable/helper.js --- jqueryui-1.12.1+dfsg/tests/unit/resizable/helper.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/resizable/helper.js 2022-01-20 12:59:41.000000000 +0000 @@ -3,6 +3,7 @@ "jquery", "lib/helper" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { drag: function( el, dx, dy ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/resizable/methods.js jqueryui-1.13.1+dfsg/tests/unit/resizable/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/resizable/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/resizable/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/resizable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "resizable: methods" ); +QUnit.module( "resizable: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "disable", function( assert ) { assert.expect( 5 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/resizable/options.js jqueryui-1.13.1+dfsg/tests/unit/resizable/options.js --- jqueryui-1.12.1+dfsg/tests/unit/resizable/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/resizable/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/resizable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "resizable: options" ); +QUnit.module( "resizable: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "alsoResize", function( assert ) { assert.expect( 2 ); @@ -155,6 +157,28 @@ assert.equal( target.position().top, 0, "compare top - no movement" ); } ); +QUnit.test( "aspectRatio: aspectRatio can be changed after initialization", function( assert ) { + assert.expect( 4 ); + + var target = $( "#resizable1" ) + .resizable( { aspectRatio: 1 } ) + .resizable( "option", "aspectRatio", false ); + + var handle = ".ui-resizable-e"; + + testHelper.drag( handle, 80 ); + + assert.equal( target.width(), 180, "compare width - size change" ); + assert.equal( target.height(), 100, "compare height - no size change" ); + + target.resizable( "option", "aspectRatio", 2 ); + + testHelper.drag( handle, -40 ); + + assert.equal( target.width(), 140, "compare width - size change" ); + assert.equal( target.height(), 70, "compare height - size change in proper relation" ); +} ); + QUnit.test( "containment", function( assert ) { assert.expect( 4 ); @@ -412,11 +436,22 @@ } ); QUnit.test( "setOption handles", function( assert ) { - assert.expect( 11 ); + assert.expect( 19 ); - var target = $( "
    " ).resizable(); + // https://bugs.jqueryui.com/ticket/3423 + // https://bugs.jqueryui.com/ticket/15084 + var target = $( "
    " ).resizable(), + target2 = $( "
    " + + "
    " + + "
    " + + "
    " ).resizable( { + handles: { + "e": "ui-resizable-e", + "w": "ui-resizable-w" + } + } ); - function checkHandles( expectedHandles ) { + function checkHandles( target, expectedHandles ) { expectedHandles = $.map( expectedHandles, function( value ) { return ".ui-resizable-" + value; } ); @@ -429,13 +464,22 @@ } ); } - checkHandles( [ "e", "s", "se" ] ); + checkHandles( target, [ "e", "s", "se" ] ); target.resizable( "option", "handles", "n, w, nw" ); - checkHandles( [ "n", "w", "nw" ] ); + checkHandles( target, [ "n", "w", "nw" ] ); target.resizable( "option", "handles", "s, w" ); - checkHandles( [ "s", "w" ] ); + checkHandles( target, [ "s", "w" ] ); + + target2.resizable( "option", "handles", "e, s, w" ); + checkHandles( target2, [ "e", "s", "w" ] ); + + target.resizable( "destroy" ); + checkHandles( target, [ ] ); + + target2.resizable( "destroy" ); + checkHandles( target2, [ "e", "w" ] ); } ); QUnit.test( "alsoResize + containment", function( assert ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectable/events.js jqueryui-1.13.1+dfsg/tests/unit/selectable/events.js --- jqueryui-1.12.1+dfsg/tests/unit/selectable/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectable/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -4,8 +4,9 @@ "lib/helper", "ui/widgets/selectable" ], function( QUnit, $, testHelpers ) { +"use strict"; -QUnit.module( "selectable: events" ); +QUnit.module( "selectable: events", { afterEach: testHelpers.moduleAfterEach } ); QUnit.test( "start", function( assert ) { assert.expect( 2 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectable/methods.js jqueryui-1.13.1+dfsg/tests/unit/selectable/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/selectable/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectable/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/selectable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "selectable: methods" ); +QUnit.module( "selectable: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "init", function( assert ) { assert.expect( 5 ); @@ -52,7 +54,9 @@ el.selectable( { disabled: true, - start: function() { fired = true; } + start: function() { + fired = true; + } } ); el.simulate( "drag", { dx: 20, diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectable/options.js jqueryui-1.13.1+dfsg/tests/unit/selectable/options.js --- jqueryui-1.12.1+dfsg/tests/unit/selectable/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectable/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/selectable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "selectable: options" ); +QUnit.module( "selectable: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "autoRefresh", function( assert ) { assert.expect( 3 ); @@ -12,7 +14,9 @@ var actual = 0, el = $( "#selectable1" ), sel = $( "*", el ), - selected = function() { actual += 1; }; + selected = function() { + actual += 1; + }; el = $( "#selectable1" ).selectable( { autoRefresh: false, selected: selected } ); sel.hide(); @@ -50,7 +54,9 @@ var actual = 0, el = $( "#selectable1" ), sel = $( "*", el ), - selected = function() { actual += 1; }; + selected = function() { + actual += 1; + }; el = $( "#selectable1" ).selectable( { filter: ".special", selected: selected } ); el.simulate( "drag", { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectmenu/core.js jqueryui-1.13.1+dfsg/tests/unit/selectmenu/core.js --- jqueryui-1.12.1+dfsg/tests/unit/selectmenu/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectmenu/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/selectmenu" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "selectmenu: core" ); +QUnit.module( "selectmenu: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 7 ); @@ -95,7 +97,7 @@ element.selectmenu( "refresh" ); option = element.find( "option:selected" ); assert.equal( - $.trim( button.text() ), + String.prototype.trim.call( button.text() ), option.text() + element[ 0 ].selectedIndex, "refresh: button item text" ); @@ -104,7 +106,7 @@ menu.find( "li" ).last().simulate( "mouseover" ).trigger( "click" ); option = element.find( "option" ).last(); assert.equal( - $.trim( button.text() ), + String.prototype.trim.call( button.text() ), option.text() + element[ 0 ].selectedIndex, "click: button item text" ); @@ -153,7 +155,7 @@ selected.val(), "original select state" ); - assert.equal( $.trim( button.text() ), selected.text(), "button text" ); + assert.equal( String.prototype.trim.call( button.text() ), selected.text(), "button text" ); ready(); } ); } ); @@ -189,7 +191,7 @@ selected.val(), "original select state" ); - assert.equal( $.trim( button.text() ), selected.text(), "button text" ); + assert.equal( String.prototype.trim.call( button.text() ), selected.text(), "button text" ); ready(); }, 1 ); } ); @@ -231,7 +233,7 @@ "button aria-activedescendant" ); assert.equal( element.find( "option:selected" ).val(), options.eq( 1 ).val(), "original select state" ); - assert.equal( $.trim( button.text() ), options.eq( 1 ).text(), "button text" ); + assert.equal( String.prototype.trim.call( button.text() ), options.eq( 1 ).text(), "button text" ); ready(); } ); } ); @@ -251,13 +253,13 @@ wrappers = menu.find( "li.ui-menu-item .ui-menu-item-wrapper" ); button.trigger( "click" ); - wrappers.first().simulate( "mouseover" ).trigger( "click" ); + wrappers.first().simulate( "mouseover", { clientX: 2, clientY: 2 } ).trigger( "click" ); assert.equal( element[ 0 ].selectedIndex, 0, "First item is selected" ); button.simulate( "keydown", { keyCode: $.ui.keyCode.UP } ); assert.equal( element[ 0 ].selectedIndex, 0, "No looping beyond first item" ); button.trigger( "click" ); - wrappers.last().simulate( "mouseover" ).trigger( "click" ); + wrappers.last().simulate( "mouseover", { clientX: 3, clientY: 3 } ).trigger( "click" ); assert.equal( element[ 0 ].selectedIndex, wrappers.length - 1, "Last item is selected" ); button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); assert.equal( element[ 0 ].selectedIndex, wrappers.length - 1, "No looping behind last item" ); @@ -352,10 +354,10 @@ element.val( "Slower" ); element.selectmenu( "refresh" ); - assert.equal( $.trim( widget.text() ), "Slower" ); + assert.equal( String.prototype.trim.call( widget.text() ), "Slower" ); form[ 0 ].reset(); setTimeout( function() { - assert.equal( $.trim( widget.text() ), initialValue ); + assert.equal( String.prototype.trim.call( widget.text() ), initialValue ); ready(); } ); } ); @@ -376,4 +378,60 @@ } ); } ); +QUnit.test( "Options with hidden attribute should not be rendered", function( assert ) { + var ready = assert.async(); + assert.expect( 1 ); + + var button, menu, options, + element = $( "#speed" ); + + element.find( "option" ).eq( 1 ).prop( "hidden", true ); + element.selectmenu(); + button = element.selectmenu( "widget" ); + menu = element.selectmenu( "menuWidget" ); + + button.simulate( "focus" ); + setTimeout( function() { + button.trigger( "click" ); + options = menu.children() + .map( function() { + return $( this ).text(); + } ) + .get(); + assert.deepEqual( options, [ "Slower", "Medium", "Fast", "Faster" ], "correct elements" ); + + ready(); + } ); +} ); + +QUnit.test( "extra listeners created after selection (trac-15078, trac-15152)", function( assert ) { + assert.expect( 3 ); + + var origRemoveListenersCount; + var element = $( "#speed" ).selectmenu(); + var menu = element.selectmenu( "widget" ); + + element.val( "Slow" ); + element.selectmenu( "refresh" ); + origRemoveListenersCount = jQuery._data( menu[ 0 ], "events" ).remove.length; + + element.val( "Fast" ); + element.selectmenu( "refresh" ); + assert.equal( jQuery._data( menu[ 0 ], "events" ).remove.length, + origRemoveListenersCount, + "No extra listeners after typing multiple letters" ); + + element.val( "Faster" ); + element.selectmenu( "refresh" ); + assert.equal( jQuery._data( menu[ 0 ], "events" ).remove.length, + origRemoveListenersCount, + "No extra listeners after typing multiple letters" ); + + element.val( "Slow" ); + element.selectmenu( "refresh" ); + assert.equal( jQuery._data( menu[ 0 ], "events" ).remove.length, + origRemoveListenersCount, + "No extra listeners after typing multiple letters" ); +} ); + } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectmenu/events.js jqueryui-1.13.1+dfsg/tests/unit/selectmenu/events.js --- jqueryui-1.12.1+dfsg/tests/unit/selectmenu/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectmenu/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,16 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/selectmenu" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectmenu: events", { beforeEach: function() { this.element = $( "#speed" ); - } + }, + afterEach: helper.moduleAfterEach } ); QUnit.test( "change", function( assert ) { @@ -89,9 +92,9 @@ button.trigger( "click" ); links = menu.find( "li.ui-menu-item" ); optionIndex = 0; - links.eq( optionIndex ).simulate( "mouseover" ); + links.eq( optionIndex ).simulate( "mouseover", { clientX: 2, clientY: 2 } ); optionIndex += 1; - links.eq( optionIndex ).simulate( "mouseover" ); + links.eq( optionIndex ).simulate( "mouseover", { clientX: 3, clientY: 3 } ); // This tests for unwanted, additional focus event on close that.element.selectmenu( "close" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectmenu/methods.js jqueryui-1.13.1+dfsg/tests/unit/selectmenu/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/selectmenu/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectmenu/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/selectmenu" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "selectmenu: methods" ); +QUnit.module( "selectmenu: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "destroy", function( assert ) { assert.expect( 1 ); @@ -83,21 +85,21 @@ var element = $( "#speed" ).selectmenu(), button = element.selectmenu( "widget" ); - assert.equal( $.trim( button.text() ), "Medium", "button text after init" ); + assert.equal( String.prototype.trim.call( button.text() ), "Medium", "button text after init" ); button.simulate( "focus" ); setTimeout( function() { - assert.equal( $.trim( button.text() ), "Medium", "button text after focus" ); + assert.equal( String.prototype.trim.call( button.text() ), "Medium", "button text after focus" ); element[ 0 ].selectedIndex = 0; element.selectmenu( "refresh" ); - assert.equal( $.trim( button.text() ), "Slower", "button text after changing selected option" ); + assert.equal( String.prototype.trim.call( button.text() ), "Slower", "button text after changing selected option" ); element.find( "option" ).prop( "selected", false ); element.append( "" ); element.selectmenu( "refresh" ); - assert.equal( $.trim( button.text() ), "Selected option", "button text after adding selected option" ); + assert.equal( String.prototype.trim.call( button.text() ), "Selected option", "button text after adding selected option" ); ready(); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/selectmenu/options.js jqueryui-1.13.1+dfsg/tests/unit/selectmenu/options.js --- jqueryui-1.12.1+dfsg/tests/unit/selectmenu/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/selectmenu/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/selectmenu" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "selectmenu: options" ); +QUnit.module( "selectmenu: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "appendTo: null", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/slider/core.js jqueryui-1.13.1+dfsg/tests/unit/slider/core.js --- jqueryui-1.12.1+dfsg/tests/unit/slider/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/slider/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,8 +1,10 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/slider" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; var element, options; @@ -11,7 +13,7 @@ } // Slider Tests -QUnit.module( "slider: core" ); +QUnit.module( "slider: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 4 ); @@ -67,7 +69,7 @@ element.slider( "value", 0 ); handle().simulate( "keydown", { keyCode: $.ui.keyCode.HOME } ); - assert.equal( element.slider( "value" ), options.min ) ; + assert.equal( element.slider( "value" ), options.min ); element.slider( "destroy" ); } ); @@ -86,7 +88,7 @@ element.slider( "value", 0 ); handle().simulate( "keydown", { keyCode: $.ui.keyCode.END } ); - assert.equal( element.slider( "value" ), options.max ) ; + assert.equal( element.slider( "value" ), options.max ); element.slider( "destroy" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/slider/events.js jqueryui-1.13.1+dfsg/tests/unit/slider/events.js --- jqueryui-1.12.1+dfsg/tests/unit/slider/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/slider/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/slider" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "slider: events" ); +QUnit.module( "slider: events", { afterEach: helper.moduleAfterEach } ); //Specs from http://wiki.jqueryui.com/Slider#specs //"change callback: triggers when the slider has stopped moving and has a new @@ -123,16 +125,16 @@ start: function( event, ui ) { assert.equal( handles.index( ui.handle ), 0, "leftmost handle activated when overlapping at maximum" ); } - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); handles.eq( 0 ).simulate( "drag", { dx: -10 } ); element.slider( "destroy" ); element = $( "#slider1" ) .slider( { values: [ 19, 20 ] - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); handles.eq( 0 ).simulate( "drag", { dx: 10 } ); element.one( "slidestart", function( event, ui ) { assert.equal( handles.index( ui.handle ), 0, "left handle activated if left was moved last" ); @@ -143,8 +145,8 @@ element = $( "#slider1" ) .slider( { values: [ 19, 20 ] - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); handles.eq( 1 ).simulate( "drag", { dx: -10 } ); element.one( "slidestart", function( event, ui ) { assert.equal( handles.index( ui.handle ), 1, "right handle activated if right was moved last (#3467)" ); @@ -157,8 +159,8 @@ min: 0, max: 100, values: [ 0, 50 ] - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); element.slider( "option", { values: [ 100, 100 ] } ); handles.eq( 0 ).simulate( "drag", { dx: -10 } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/slider/methods.js jqueryui-1.13.1+dfsg/tests/unit/slider/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/slider/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/slider/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/slider" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "slider: methods" ); +QUnit.module( "slider: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "init", function( assert ) { assert.expect( 5 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/slider/options.js jqueryui-1.13.1+dfsg/tests/unit/slider/options.js --- jqueryui-1.12.1+dfsg/tests/unit/slider/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/slider/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,8 +1,10 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/slider" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; var element, options; @@ -10,7 +12,7 @@ return element.find( ".ui-slider-handle" ); } -QUnit.module( "slider: options" ); +QUnit.module( "slider: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "disabled", function( assert ) { assert.expect( 8 ); @@ -146,7 +148,7 @@ assert.equal( element.find( ".ui-slider-handle" )[ 0 ].style.bottom, "", "CSS bottom reset" ); assert.equal( handle()[ 0 ].style.left, percentVal + "%", "horizontal slider handle is positioned with left: %" ); - element.slider( "destroy" ) ; + element.slider( "destroy" ); options = { max: 2, diff -Nru jqueryui-1.12.1+dfsg/tests/unit/sortable/core.js jqueryui-1.13.1+dfsg/tests/unit/sortable/core.js --- jqueryui-1.12.1+dfsg/tests/unit/sortable/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/sortable/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/sortable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "sortable: core" ); +QUnit.module( "sortable: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "#9314: Sortable: Items cannot be dragged directly into bottom position", function( assert ) { assert.expect( 1 ); @@ -24,8 +26,8 @@ .sortable() .appendTo( "#qunit-fixture" ); - assert.hasClasses( el.find( "li:first" ), "ui-sortable-handle" ); - assert.hasClasses( el.find( "li:last" ), "ui-sortable-handle" ); + assert.hasClasses( el.find( "li" ).first(), "ui-sortable-handle" ); + assert.hasClasses( el.find( "li" ).last(), "ui-sortable-handle" ); el.sortable( "option", "handle", "p" ); assert.lacksClasses( el.find( "li" )[ 0 ], "ui-sortable-handle" ); @@ -34,10 +36,63 @@ assert.hasClasses( el.find( "p" )[ 1 ], "ui-sortable-handle" ); el.append( item ).sortable( "refresh" ); - assert.hasClasses( el.find( "p:last" ), "ui-sortable-handle" ); + assert.hasClasses( el.find( "p" ).last(), "ui-sortable-handle" ); el.sortable( "destroy" ); assert.equal( el.find( ".ui-sortable-handle" ).length, 0, "class name removed on destroy" ); } ); +// gh-1998 +QUnit.test( "drag & drop works with a zero-height container", function( assert ) { + var ready = assert.async(); + assert.expect( 3 ); + + var el = $( "
      \n" + + " \n" + + "
    • Item 1
    • \n" + + "
    • Item 2
    • \n" + + "
    • Item 3
    • \n" + + "
    " ) + .sortable() + .appendTo( "#qunit-fixture" ); + + function step1() { + el.find( "li" ).eq( 0 ).simulate( "drag", { + dx: 100, + dy: 3, + moves: 3 + } ); + setTimeout( step2 ); + } + + function step2() { + el.find( "li" ).eq( 2 ).simulate( "drag", { + dx: -200, + dy: -3, + moves: 3 + } ); + setTimeout( step3 ); + } + + function step3() { + assert.equal( el.find( "li" ).eq( 0 ).text(), "Item 3" ); + assert.equal( el.find( "li" ).eq( 1 ).text(), "Item 2" ); + assert.equal( el.find( "li" ).eq( 2 ).text(), "Item 1" ); + ready(); + } + + step1(); +} ); + } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/sortable/events.js jqueryui-1.13.1+dfsg/tests/unit/sortable/events.js --- jqueryui-1.12.1+dfsg/tests/unit/sortable/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/sortable/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,12 +1,14 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/sortable", "ui/widgets/draggable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "sortable: events" ); +QUnit.module( "sortable: events", { afterEach: helper.moduleAfterEach } ); QUnit.test( "start", function( assert ) { assert.expect( 7 ); @@ -16,7 +18,7 @@ start: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 10 } ); @@ -39,7 +41,7 @@ sort: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 10 } ); @@ -61,7 +63,7 @@ change: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dx: 1, dy: 1 } ); @@ -72,7 +74,7 @@ change: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 22 } ); @@ -94,7 +96,7 @@ beforeStop: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 20 } ); @@ -116,7 +118,7 @@ stop: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 20 } ); @@ -138,7 +140,7 @@ update: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dx: 1, dy: 1 } ); @@ -149,7 +151,7 @@ update: function( e, ui ) { hash = ui; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 22 } ); @@ -182,7 +184,9 @@ assert.expect( 10 ); var fired = {}, - hasFired = function( type ) { return ( type in fired ) && ( true === fired[ type ] ); }; + hasFired = function( type ) { + return ( type in fired ) && ( true === fired[ type ] ); + }; $( "#sortable" ).clone().attr( "id", "sortable2" ).insertAfter( "#sortable" ); @@ -203,13 +207,13 @@ fired.click = true; } ); - $( "#sortable li:eq(0)" ).simulate( "click" ); + $( "#sortable li" ).eq( 0 ).simulate( "click" ); assert.ok( !hasFired( "change" ), "Click only, change event should not have fired" ); assert.ok( hasFired( "click" ), "Click event should have fired" ); // Drag an item within the first list fired = {}; - $( "#sortable li:eq(0)" ).simulate( "drag", { dx: 0, dy: 40 } ); + $( "#sortable li" ).eq( 0 ).simulate( "drag", { dx: 0, dy: 40 } ); assert.ok( hasFired( "change" ), "40px drag, change event should have fired" ); assert.ok( !hasFired( "receive" ), "Receive event should not have fired" ); assert.ok( !hasFired( "remove" ), "Remove event should not have fired" ); @@ -217,7 +221,7 @@ // Drag an item from the first list to the second, connected list fired = {}; - $( "#sortable li:eq(0)" ).simulate( "drag", { dx: 0, dy: 150 } ); + $( "#sortable li" ).eq( 0 ).simulate( "drag", { dx: 0, dy: 150 } ); assert.ok( hasFired( "change" ), "150px drag, change event should have fired" ); assert.ok( hasFired( "receive" ), "Receive event should have fired" ); assert.ok( hasFired( "remove" ), "Remove event should have fired" ); @@ -245,7 +249,7 @@ hash = ui; overCount++; } - } ).find( "li:eq(0)" ).simulate( "drag", { + } ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 20 } ); @@ -301,7 +305,7 @@ hash = ui; overCount++; } ); - $( "#sortable" ).find( "li:eq(0)" ).simulate( "drag", { + $( "#sortable" ).find( "li" ).eq( 0 ).simulate( "drag", { dy: 102 } ); @@ -329,7 +333,7 @@ hash = ui; outCount++; } ); - $( "#sortable" ).find( "li:last" ).simulate( "drag", { + $( "#sortable" ).find( "li" ).last().simulate( "drag", { dy: 40 } ); @@ -357,7 +361,7 @@ } } } ); - $( "#sortable" ).find( "li:last" ).simulate( "drag", { + $( "#sortable" ).find( "li" ).last().simulate( "drag", { dy: 40 } ).simulate( "drag", { dy: -40 diff -Nru jqueryui-1.12.1+dfsg/tests/unit/sortable/methods.js jqueryui-1.13.1+dfsg/tests/unit/sortable/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/sortable/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/sortable/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,11 +1,13 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/sortable" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; -QUnit.module( "sortable: methods" ); +QUnit.module( "sortable: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "init", function( assert ) { assert.expect( 5 ); @@ -61,7 +63,7 @@ testHelper.sort( assert, $( "li", el )[ 0 ], 0, 44, 2, ".sortable('option', 'disabled', false)" ); - expected = $( "
    " ).sortable(), + expected = $( "
    " ).sortable(); actual = expected.sortable( "enable" ); assert.equal( actual, expected, "enable is chainable" ); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/sortable/options.js jqueryui-1.13.1+dfsg/tests/unit/sortable/options.js --- jqueryui-1.12.1+dfsg/tests/unit/sortable/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/sortable/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,12 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/sortable" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "sortable: options" ); +QUnit.module( "sortable: options", { afterEach: helper.moduleAfterEach } ); /* Test("{ appendTo: 'parent' }, default", function() { @@ -104,6 +106,10 @@ var top = parseFloat( item.css( "top" ) ); assert.equal( item.css( "left" ), expectedLeft, "left not animated" ); assert.ok( top > 0 && top < 300, "top is animated" ); + + // Cleanup + item.stop( true ); + ready(); }, 100 ); } ); @@ -136,7 +142,7 @@ } } ); - element = $( "#qunit-fixture li:eq(0)" ); + element = $( "#qunit-fixture li" ).eq( 0 ); // Move the first li to the right of the second li in the first ul element.simulate( "drag", { @@ -255,15 +261,65 @@ test("{ dropOnEmpty: false }", function() { ok(false, "missing test - untested code is broken code."); }); +*/ -test("{ forcePlaceholderSize: false }, default", function() { - ok(false, "missing test - untested code is broken code."); -}); +QUnit.test( "{ forcePlaceholderSize: false } table rows", function( assert ) { + assert.expect( 1 ); -test("{ forcePlaceholderSize: true }", function() { - ok(false, "missing test - untested code is broken code."); -}); + var element = $( "#sortable-table2 tbody" ); + + element.sortable( { + placeholder: "test", + forcePlaceholderSize: false, + start: function( event, ui ) { + assert.notEqual( ui.placeholder.height(), ui.item.height(), + "placeholder is same height as item" ); + } + } ); + + // This row has a non-standard height + $( "tr", element ).eq( 0 ).simulate( "drag", { + dy: 1 + } ); +} ); + +QUnit.test( "{ forcePlaceholderSize: true } table rows", function( assert ) { + assert.expect( 2 ); + + // Table should have the placeholder's height set the same as the row we're dragging + var element = $( "#sortable-table2 tbody" ), + jqMinor = $.fn.jquery.substring( 0, 4 ); + + element.sortable( { + placeholder: "test", + forcePlaceholderSize: true, + start: function( event, ui ) { + + // Support: IE 11+, Edge <79 only + // In IE & Edge Legacy these values may differ a little + // when jQuery >=3.0 <3.2 is used. + if ( jqMinor === "3.0." || jqMinor === "3.1." ) { + assert.ok( Math.abs( ui.placeholder.height() - ui.item.height() ) < 0.25, + "placeholder height is within 0.25 px of item's" ); + } else { + assert.equal( ui.placeholder.height(), ui.item.height(), + "placeholder is same height as item" ); + } + } + } ); + // First row has a non-standard height + $( "tr", element ).eq( 0 ).simulate( "drag", { + dy: 1 + } ); + + // Second row's height is normal + $( "tr", element ).eq( 1 ).simulate( "drag", { + dy: 1 + } ); +} ); + +/* test("{ forceHelperSize: false }, default", function() { ok(false, "missing test - untested code is broken code."); }); @@ -332,7 +388,8 @@ QUnit.test( "{ placeholder: false } img", function( assert ) { assert.expect( 3 ); - var element = $( "#sortable-images" ).sortable( { + var done = assert.async(), + element = $( "#sortable-images" ).sortable( { start: function( event, ui ) { assert.ok( ui.placeholder.attr( "src" ).indexOf( "images/jqueryui_32x32.png" ) > 0, "placeholder img has correct src" ); assert.equal( ui.placeholder.height(), 32, "placeholder has correct height" ); @@ -340,9 +397,14 @@ } } ); - element.find( "img" ).eq( 0 ).simulate( "drag", { - dy: 1 - } ); + // Give browsers some time to load the image if cache is disabled. + // This resolves a frequent issue in Chrome/Safari. + setTimeout( function() { + element.find( "img" ).eq( 0 ).simulate( "drag", { + dy: 1 + } ); + done(); + }, 500 ); } ); QUnit.test( "{ placeholder: String }", function( assert ) { @@ -407,7 +469,7 @@ assert.equal( ui.placeholder.children( "tr" ).length, 1, "placeholder's child is tr" ); assert.equal( ui.placeholder.find( "> tr" ).children().length, - dragBody.find( "> tr:first" ).children().length, + dragBody.find( "> tr" ).first().children().length, "placeholder's tr has correct number of cells" ); assert.equal( ui.placeholder.find( "> tr" ).children().html(), $( " " ).html(), @@ -426,6 +488,63 @@ } ); } ); +// gh-2001 +// Sortable: Draggable items moved into a sortable had incorrect position +QUnit.test( "{ connectToSortable: Selector } positioning (gh-2001)", function( assert ) { + assert.expect( 1 ); + + // Code from jQuery Simulate with minor modifications. + function findCenter( elem ) { + var offset, + document = $( elem[ 0 ].ownerDocument ); + offset = elem.offset(); + + return { + x: Math.floor( offset.left + elem.outerWidth() / 2 - document.scrollLeft() ), + y: Math.floor( offset.top + elem.outerHeight() / 2 - document.scrollTop( ) ) + }; + } + + var sortableElem = $( "#sortable" ); + + sortableElem.css( "position", "relative" ); + + var item = $( "
    " ) + .text( "6" ) + .insertBefore( "#sortable" ); + + // Padding + $( "
    " ) + .css( { + width: "100px", + height: "100px" + } ) + .insertBefore( "#sortable" ); + + item.draggable( { + connectToSortable: "#sortable" + } ); + sortableElem.sortable(); + + // Simulate a drag without a drop. + var center = findCenter( item ); + item.simulate( "mousedown", { + clientX: center.x, + clientY: center.y + } ); + item.simulate( "mousemove", { + clientX: center.x, + clientY: center.y + 60 + } ); + item.simulate( "mousemove", { + clientX: center.x, + clientY: center.y + 120 + } ); + + assert.ok( item.offset().top > sortableElem.children().eq( 0 ).offset().top, + "Draggable offset correct after moving into a sortable" ); +} ); + /* Test("{ revert: false }, default", function() { ok(false, "missing test - untested code is broken code."); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/sortable/sortable.html jqueryui-1.13.1+dfsg/tests/unit/sortable/sortable.html --- jqueryui-1.12.1+dfsg/tests/unit/sortable/sortable.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/sortable/sortable.html 2022-01-20 12:59:41.000000000 +0000 @@ -22,7 +22,8 @@ border-width: 0; height:19px; } - #sortable-table { + #sortable-table, + #sortable-table2 { width: 100%; } @@ -104,6 +105,24 @@ + + + + + + + + + + + + + + + + + +
    1
    1
    1
    22
    33
    diff -Nru jqueryui-1.12.1+dfsg/tests/unit/spinner/core.js jqueryui-1.13.1+dfsg/tests/unit/spinner/core.js --- jqueryui-1.12.1+dfsg/tests/unit/spinner/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/spinner/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/spinner" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var simulateKeyDownUp = testHelper.simulateKeyDownUp; -QUnit.module( "spinner: core" ); +QUnit.module( "spinner: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 6 ); @@ -162,23 +164,39 @@ } ); QUnit.test( "mousewheel on input", function( assert ) { - assert.expect( 4 ); + var ready = assert.async(); + assert.expect( 5 ); var element = $( "#spin" ).val( 0 ).spinner( { step: 2 } ); - element.trigger( "mousewheel" ); - assert.equal( element.val(), 0, "mousewheel event without delta does not change value" ); + element.simulate( "focus" ); + setTimeout( step1 ); - element.trigger( "mousewheel", 1 ); - assert.equal( element.val(), 2 ); + function step1() { + element.trigger( "mousewheel" ); + assert.equal( element.val(), 0, "mousewheel event without delta does not change value" ); - element.trigger( "mousewheel", -0.2 ); - assert.equal( element.val(), 0 ); + element.trigger( "mousewheel", 1 ); + assert.equal( element.val(), 2, "delta 1" ); + + element.trigger( "mousewheel", -0.2 ); + assert.equal( element.val(), 0, "delta -0.2" ); + + element.trigger( "mousewheel", -15 ); + assert.equal( element.val(), -2, "delta -15" ); - element.trigger( "mousewheel", -15 ); - assert.equal( element.val(), -2 ); + element.simulate( "blur" ); + setTimeout( step2 ); + } + + function step2() { + element.trigger( "mousewheel", 1 ); + assert.equal( element.val(), -2, "mousewheel when not focused" ); + + ready(); + } } ); QUnit.test( "reading HTML5 attributes", function( assert ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/spinner/deprecated.js jqueryui-1.13.1+dfsg/tests/unit/spinner/deprecated.js --- jqueryui-1.12.1+dfsg/tests/unit/spinner/deprecated.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/spinner/deprecated.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,8 +1,10 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/spinner" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; var originalSpinner = $.ui.spinner.prototype; QUnit.module( "spinner: deprecated", { @@ -26,6 +28,7 @@ afterEach: function() { $.ui.spinner.prototype = originalSpinner; + return helper.moduleAfterEach.apply( this, arguments ); } } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/spinner/events.js jqueryui-1.13.1+dfsg/tests/unit/spinner/events.js --- jqueryui-1.12.1+dfsg/tests/unit/spinner/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/spinner/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/spinner" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var simulateKeyDownUp = testHelper.simulateKeyDownUp; -QUnit.module( "spinner: events" ); +QUnit.module( "spinner: events", { afterEach: helper.moduleAfterEach } ); QUnit.test( "start", function( assert ) { assert.expect( 10 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/spinner/methods.js jqueryui-1.13.1+dfsg/tests/unit/spinner/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/spinner/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/spinner/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/spinner" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var simulateKeyDownUp = testHelper.simulateKeyDownUp; -QUnit.module( "spinner: methods" ); +QUnit.module( "spinner: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "destroy", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/spinner/options.js jqueryui-1.13.1+dfsg/tests/unit/spinner/options.js --- jqueryui-1.12.1+dfsg/tests/unit/spinner/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/spinner/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,30 +1,32 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widgets/spinner", "globalize", "globalize/ja-JP" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; -QUnit.module( "spinner: options" ); +QUnit.module( "spinner: options", { afterEach: helper.moduleAfterEach } ); // Culture is tested after numberFormat, since it depends on numberFormat QUnit.test( "icons: default ", function( assert ) { assert.expect( 4 ); var element = $( "#spin" ).val( 0 ).spinner(); - assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:first" ), + assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon" ).first(), "ui-icon ui-icon-triangle-1-n" ); - assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:last" ), + assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon" ).last(), "ui-icon ui-icon-triangle-1-s" ); element.spinner( "option", "icons", { up: "ui-icon-caret-1-n", down: "ui-icon-caret-1-s" } ); - assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:first" ), + assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon" ).first(), "ui-icon ui-icon-caret-1-n" ); - assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon:last" ), + assert.hasClasses( element.spinner( "widget" ).find( ".ui-icon" ).last(), "ui-icon ui-icon-caret-1-s" ); } ); @@ -36,8 +38,8 @@ up: "custom-up" } } ).spinner( "widget" ); - assert.hasClasses( element.find( ".ui-icon:first" ), "ui-icon custom-up" ); - assert.hasClasses( element.find( ".ui-icon:last" ), "ui-icon custom-down" ); + assert.hasClasses( element.find( ".ui-icon" ).first(), "ui-icon custom-up" ); + assert.hasClasses( element.find( ".ui-icon" ).last(), "ui-icon custom-down" ); } ); QUnit.test( "incremental, false", function( assert ) { diff -Nru jqueryui-1.12.1+dfsg/tests/unit/subsuite.js jqueryui-1.13.1+dfsg/tests/unit/subsuite.js --- jqueryui-1.12.1+dfsg/tests/unit/subsuite.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/subsuite.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,7 +1,7 @@ ( function() { +"use strict"; var versions = [ - "1.7.0", "1.7.1", "1.7.2", "1.8.0", "1.8.1", "1.8.2", "1.8.3", "1.9.0", "1.9.1", "1.10.0", "1.10.1", "1.10.2", @@ -11,8 +11,13 @@ "2.1.0", "2.1.1", "2.1.2", "2.1.3", "2.1.4", "2.2.0", "2.2.1", "2.2.2", "2.2.3", "2.2.4", "3.0.0", - "3.1.0", - "git", "custom" + "3.1.0", "3.1.1", + "3.2.0", "3.2.1", + "3.3.0", "3.3.1", + "3.4.0", "3.4.1", + "3.5.0", "3.5.1", + "3.6.0", + "3.x-git", "git", "custom" ], additionalTests = { @@ -29,4 +34,4 @@ } ) ); }; -}() ); +} )(); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tabs/core.js jqueryui-1.13.1+dfsg/tests/unit/tabs/core.js --- jqueryui-1.12.1+dfsg/tests/unit/tabs/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tabs/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/tabs" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var state = testHelper.state; -QUnit.module( "tabs: core" ); +QUnit.module( "tabs: core", { afterEach: helper.moduleAfterEach } ); QUnit.test( "markup structure", function( assert ) { assert.expect( 20 ); @@ -101,7 +103,7 @@ } ); QUnit.test( "accessibility", function( assert ) { - assert.expect( 49 ); + assert.expect( 46 ); var element = $( "#tabs1" ).tabs( { active: 1, disabled: [ 2 ] @@ -118,7 +120,6 @@ panel = panels.eq( index ); assert.equal( tab.attr( "role" ), "tab", "tab " + index + " role" ); assert.equal( tab.attr( "aria-labelledby" ), anchorId, "tab " + index + " aria-labelledby" ); - assert.equal( anchor.attr( "role" ), "presentation", "anchor " + index + " role" ); assert.equal( anchor.attr( "tabindex" ), -1, "anchor " + index + " tabindex" ); assert.equal( panel.attr( "role" ), "tabpanel", "panel " + index + " role" ); assert.equal( panel.attr( "aria-labelledby" ), anchorId, "panel " + index + " aria-labelledby" ); @@ -187,7 +188,13 @@ } ), tabs = element.find( ".ui-tabs-nav li" ), panels = element.find( ".ui-tabs-panel" ), - keyCode = $.ui.keyCode; + keyCode = $.ui.keyCode, + + // Support: IE 11 with jQuery 1.8. + // In IE with jQuery 1.8 focusout may not happen immediately so some checks + // need to be done later. + isFocusoutImmediate = !( document.documentMode && + jQuery.fn.jquery.indexOf( "1.8." ) === 0 ); element.tabs( "instance" ).delay = 1; @@ -202,7 +209,9 @@ tabs.eq( 0 ).simulate( "keydown", { keyCode: keyCode.DOWN } ); assert.hasClasses( tabs.eq( 1 ), "ui-state-focus", "DOWN moves focus to next tab" ); - assert.lacksClasses( tabs.eq( 0 ), "ui-state-focus", "first tab is no longer focused" ); + if ( isFocusoutImmediate ) { + assert.lacksClasses( tabs.eq( 0 ), "ui-state-focus", "first tab is no longer focused" ); + } assert.equal( tabs.eq( 1 ).attr( "aria-selected" ), "true", "second tab has aria-selected=true" ); assert.equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" ); assert.ok( panels.eq( 1 ).is( ":hidden" ), "second panel is still hidden" ); @@ -247,6 +256,9 @@ // Left, home, space function step2() { + if ( !isFocusoutImmediate ) { + assert.lacksClasses( tabs.eq( 0 ), "ui-state-focus", "first tab is no longer focused" ); + } assert.equal( tabs.eq( 2 ).attr( "aria-selected" ), "true", "third tab has aria-selected=true" ); assert.equal( tabs.eq( 0 ).attr( "aria-selected" ), "false", "first tab has aria-selected=false" ); assert.ok( panels.eq( 2 ).is( ":visible" ), "third panel is visible" ); @@ -663,4 +675,56 @@ state( assert, element, 1 ); } ); + +QUnit.test( "extra listeners created when tabs are added/removed (trac-15136)", function( assert ) { + assert.expect( 3 ); + + var origRemoveListenersCount; + var element = $( "#tabs1" ).tabs(); + var tabCounter = 10; + + function addTab() { + var label = "Tab " + tabCounter; + var id = "tabs-" + tabCounter; + var li = $( + "
  • " + + " " + label + " " + + " Remove Tab" + + "
  • " + ); + var tabContentHtml = "Tab " + tabCounter + " content."; + + element.find( ".ui-tabs-nav" ).append( li ); + element.append( "

    " + tabContentHtml + "

    " ); + element.tabs( "refresh" ); + tabCounter++; + } + + function removeLastTab() { + element.find( ".ui-icon-close" ).last().trigger( "click" ); + } + + origRemoveListenersCount = jQuery._data( element[ 0 ], "events" ).remove.length; + + addTab(); + assert.equal( jQuery._data( element[ 0 ], "events" ).remove.length, + origRemoveListenersCount, + "No extra listeners after adding a new tab" ); + + addTab(); + addTab(); + addTab(); + assert.equal( jQuery._data( element[ 0 ], "events" ).remove.length, + origRemoveListenersCount, + "No extra listeners after adding multiple tabs" ); + + removeLastTab(); + removeLastTab(); + removeLastTab(); + removeLastTab(); + assert.equal( jQuery._data( element[ 0 ], "events" ).remove.length, + origRemoveListenersCount, + "No extra listeners after removing all the extra tabs" ); +} ); + } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tabs/events.js jqueryui-1.13.1+dfsg/tests/unit/tabs/events.js --- jqueryui-1.12.1+dfsg/tests/unit/tabs/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tabs/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,13 +1,15 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/tabs" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var state = testHelper.state; -QUnit.module( "tabs: events" ); +QUnit.module( "tabs: events", { afterEach: helper.moduleAfterEach } ); QUnit.test( "create", function( assert ) { assert.expect( 10 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tabs/methods.js jqueryui-1.13.1+dfsg/tests/unit/tabs/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/tabs/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tabs/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,14 +1,16 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/tabs" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var disabled = testHelper.disabled, state = testHelper.state; -QUnit.module( "tabs: methods" ); +QUnit.module( "tabs: methods", { afterEach: helper.moduleAfterEach } ); QUnit.test( "destroy", function( assert ) { assert.expect( 2 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tabs/options.js jqueryui-1.13.1+dfsg/tests/unit/tabs/options.js --- jqueryui-1.12.1+dfsg/tests/unit/tabs/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tabs/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,15 +1,17 @@ define( [ "qunit", "jquery", + "lib/helper", "./helper", "ui/widgets/tabs" -], function( QUnit, $, testHelper ) { +], function( QUnit, $, helper, testHelper ) { +"use strict"; var disabled = testHelper.disabled, equalHeight = testHelper.equalHeight, state = testHelper.state; -QUnit.module( "tabs: options" ); +QUnit.module( "tabs: options", { afterEach: helper.moduleAfterEach } ); QUnit.test( "{ active: default }", function( assert ) { assert.expect( 6 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tooltip/core.js jqueryui-1.13.1+dfsg/tests/unit/tooltip/core.js --- jqueryui-1.12.1+dfsg/tests/unit/tooltip/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tooltip/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,14 @@ define( [ "qunit", "jquery", + "./helper", "ui/widgets/tooltip" -], function( QUnit, $ ) { +], function( QUnit, $, testHelper ) { +"use strict"; -QUnit.module( "tooltip: core" ); +var beforeAfterEach = testHelper.beforeAfterEach; + +QUnit.module( "tooltip: core", beforeAfterEach() ); QUnit.test( "markup structure", function( assert ) { assert.expect( 7 ); @@ -250,4 +254,74 @@ .tooltip( "open" ); } ); +// gh-1990 +QUnit.test( "don't crash on empty tooltip content", function( assert ) { + var ready = assert.async(); + assert.expect( 1 ); + + var anchor = $( "#tooltipped1" ), + input = anchor.next(), + actions = []; + + $( document ).tooltip( { + show: false, + hide: false, + content: function() { + var title = $( this ).attr( "title" ); + if ( title === "inputtitle" ) { + return ""; + } + return title; + }, + open: function( event, ui ) { + actions.push( "open:" + ui.tooltip.text() ); + }, + close: function( event, ui ) { + actions.push( "close:" + ui.tooltip.text() ); + } + } ); + + function step1() { + anchor.simulate( "mouseover" ); + setTimeout( step2 ); + } + + function step2() { + anchor.simulate( "mouseout" ); + setTimeout( step3 ); + } + + function step3() { + input.simulate( "focus" ); + setTimeout( step4 ); + } + + function step4() { + input.simulate( "blur" ); + setTimeout( step5 ); + } + + function step5() { + anchor.simulate( "mouseover" ); + setTimeout( step6 ); + } + + function step6() { + anchor.simulate( "mouseout" ); + setTimeout( step7 ); + } + + function step7() { + assert.deepEqual( actions, [ + "open:anchortitle", + "close:anchortitle", + "open:anchortitle", + "close:anchortitle" + ], "Tooltip opens and closes without crashing" ); + ready(); + } + + step1(); +} ); + } ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tooltip/deprecated.js jqueryui-1.13.1+dfsg/tests/unit/tooltip/deprecated.js --- jqueryui-1.12.1+dfsg/tests/unit/tooltip/deprecated.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tooltip/deprecated.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,14 @@ define( [ "qunit", "jquery", + "./helper", "ui/widgets/tooltip" -], function( QUnit, $ ) { +], function( QUnit, $, testHelper ) { +"use strict"; -QUnit.module( "tooltip: (deprecated) options" ); +var beforeAfterEach = testHelper.beforeAfterEach; + +QUnit.module( "tooltip: (deprecated) options", beforeAfterEach() ); QUnit.test( "tooltipClass", function( assert ) { assert.expect( 1 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tooltip/events.js jqueryui-1.13.1+dfsg/tests/unit/tooltip/events.js --- jqueryui-1.12.1+dfsg/tests/unit/tooltip/events.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tooltip/events.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,14 @@ define( [ "qunit", "jquery", + "./helper", "ui/widgets/tooltip" -], function( QUnit, $ ) { +], function( QUnit, $, testHelper ) { +"use strict"; -QUnit.module( "tooltip: events" ); +var beforeAfterEach = testHelper.beforeAfterEach; + +QUnit.module( "tooltip: events", beforeAfterEach() ); QUnit.test( "programmatic triggers", function( assert ) { assert.expect( 4 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tooltip/helper.js jqueryui-1.13.1+dfsg/tests/unit/tooltip/helper.js --- jqueryui-1.12.1+dfsg/tests/unit/tooltip/helper.js 1970-01-01 00:00:00.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tooltip/helper.js 2022-01-20 12:59:41.000000000 +0000 @@ -0,0 +1,30 @@ +define( [ + "qunit", + "jquery", + "lib/helper", + "ui/widgets/tooltip" +], function( QUnit, $, helper ) { + "use strict"; + + return $.extend( helper, { + beforeAfterEach: function() { + return { + afterEach: function() { + var index, timer, + timers = jQuery.timers; + + jQuery.fx.stop(); + + for ( index = timers.length; index--; ) { + timer = timers[ index ]; + timer.anim.stop(); + timers.splice( index, 1 ); + } + + return helper.moduleAfterEach.apply( this, arguments ); + } + }; + } + } ); + +} ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tooltip/methods.js jqueryui-1.13.1+dfsg/tests/unit/tooltip/methods.js --- jqueryui-1.12.1+dfsg/tests/unit/tooltip/methods.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tooltip/methods.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,14 @@ define( [ "qunit", "jquery", + "./helper", "ui/widgets/tooltip" -], function( QUnit, $ ) { +], function( QUnit, $, testHelper ) { +"use strict"; -QUnit.module( "tooltip: methods" ); +var beforeAfterEach = testHelper.beforeAfterEach; + +QUnit.module( "tooltip: methods", beforeAfterEach() ); QUnit.test( "destroy", function( assert ) { assert.expect( 3 ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/tooltip/options.js jqueryui-1.13.1+dfsg/tests/unit/tooltip/options.js --- jqueryui-1.12.1+dfsg/tests/unit/tooltip/options.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/tooltip/options.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,10 +1,14 @@ define( [ "qunit", "jquery", + "./helper", "ui/widgets/tooltip" -], function( QUnit, $ ) { +], function( QUnit, $, testHelper ) { +"use strict"; -QUnit.module( "tooltip: options" ); +var beforeAfterEach = testHelper.beforeAfterEach; + +QUnit.module( "tooltip: options", beforeAfterEach() ); QUnit.test( "disabled: true", function( assert ) { assert.expect( 1 ); @@ -100,7 +104,7 @@ } ); QUnit.test( "content: change while open", function( assert ) { - assert.expect( 2 ) ; + assert.expect( 2 ); var element = $( "#tooltipped1" ).tooltip( { content: function() { return "old"; diff -Nru jqueryui-1.12.1+dfsg/tests/unit/widget/animation.js jqueryui-1.13.1+dfsg/tests/unit/widget/animation.js --- jqueryui-1.12.1+dfsg/tests/unit/widget/animation.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/widget/animation.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,8 +1,10 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widget" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "widget animation", ( function() { var show = $.fn.show, @@ -26,9 +28,10 @@ $.fn.show = show; $.fn.fadeIn = fadeIn; $.fn.slideDown = slideDown; + return helper.moduleAfterEach.apply( this, arguments ); } }; -}() ) ); +} )() ); QUnit.test( "show: null", function( assert ) { var ready = assert.async(); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/widget/classes.js jqueryui-1.13.1+dfsg/tests/unit/widget/classes.js --- jqueryui-1.12.1+dfsg/tests/unit/widget/classes.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/widget/classes.js 2022-01-20 12:59:41.000000000 +0000 @@ -1,8 +1,10 @@ define( [ "qunit", "jquery", + "lib/helper", "ui/widget" -], function( QUnit, $ ) { +], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "widget factory classes", { beforeEach: function() { @@ -50,6 +52,7 @@ _destroy: function() { this.span.remove(); this.element.unwrap(); + return helper.moduleAfterEach.apply( this, arguments ); } } ); }, diff -Nru jqueryui-1.12.1+dfsg/tests/unit/widget/core.js jqueryui-1.13.1+dfsg/tests/unit/widget/core.js --- jqueryui-1.12.1+dfsg/tests/unit/widget/core.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/widget/core.js 2022-01-20 12:59:41.000000000 +0000 @@ -2,8 +2,10 @@ "qunit", "jquery", "lib/common", + "lib/helper", "ui/widget" -], function( QUnit, $, common ) { +], function( QUnit, $, common, helper ) { +"use strict"; QUnit.module( "widget factory", { afterEach: function() { @@ -11,11 +13,10 @@ delete $.ui.testWidget; delete $.fn.testWidget; } + return helper.moduleAfterEach.apply( this, arguments ); } } ); -common.testJshint( "widget" ); - QUnit.test( "widget creation", function( assert ) { assert.expect( 5 ); var method, @@ -29,7 +30,7 @@ }; $.widget( "ui.testWidget", myPrototype ); - assert.ok( $.isFunction( $.ui.testWidget ), "constructor was created" ); + assert.ok( typeof $.ui.testWidget === "function", "constructor was created" ); assert.equal( typeof $.ui.testWidget.prototype, "object", "prototype was created" ); method = "_create"; $.ui.testWidget.prototype._create(); @@ -91,6 +92,18 @@ $.ui.testWidget(); } ); +QUnit.test( "contextless construction", function( assert ) { + assert.expect( 1 ); + var testWidget, + elem = $( "
    " ); + + $.widget( "ui.testWidget", {} ); + testWidget = $.ui.testWidget; + + testWidget( {}, elem ); + assert.ok( true, "No crash" ); +} ); + QUnit.test( "custom selector expression", function( assert ) { assert.expect( 1 ); var elem = $( "
    " ).appendTo( "#qunit-fixture" ); @@ -947,7 +960,7 @@ this.element = { on: function( event, handler ) { assert.equal( event, "click.testWidget" + uuid ); - assert.ok( $.isFunction( handler ) ); + assert.ok( typeof handler === "function" ); }, trigger: $.noop }; @@ -956,7 +969,7 @@ on: function( event, selector, handler ) { assert.equal( selector, "a" ); assert.equal( event, "click.testWidget" + uuid ); - assert.ok( $.isFunction( handler ) ); + assert.ok( typeof handler === "function" ); } }; }; @@ -969,7 +982,7 @@ on: function( event, selector, handler ) { assert.equal( selector, "form fieldset > input" ); assert.equal( event, "change.testWidget" + uuid ); - assert.ok( $.isFunction( handler ) ); + assert.ok( typeof handler === "function" ); } }; }; @@ -1441,7 +1454,7 @@ .trigger( "remove" ); } ); } ); -}() ); +} )(); QUnit.test( "redefine", function( assert ) { assert.expect( 4 ); @@ -1608,7 +1621,7 @@ $.widget.bridge( "testWidget", TestWidget ); - assert.ok( $.isFunction( $.fn.testWidget ), "jQuery plugin was created" ); + assert.ok( typeof $.fn.testWidget === "function", "jQuery plugin was created" ); assert.strictEqual( elem.testWidget( { foo: "bar" } ), elem, "plugin returns original jQuery object" ); instance = elem.data( "testWidget" ); diff -Nru jqueryui-1.12.1+dfsg/tests/unit/widget/extend.js jqueryui-1.13.1+dfsg/tests/unit/widget/extend.js --- jqueryui-1.12.1+dfsg/tests/unit/widget/extend.js 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/unit/widget/extend.js 2022-01-20 12:59:41.000000000 +0000 @@ -3,9 +3,10 @@ "jquery", "ui/widget" ], function( QUnit, $ ) { +"use strict"; QUnit.test( "$.widget.extend()", function( assert ) { - assert.expect( 27 ); + assert.expect( 28 ); var ret, empty, optionsWithLength, optionsWithDate, myKlass, customObject, optionsWithCustomObject, nullUndef, target, recursive, obj, input, output, @@ -75,7 +76,7 @@ assert.strictEqual( nullUndef.xnumber0, null, "Check to make sure null values are inserted" ); target = {}; - recursive = { foo:target, bar:5 }; + recursive = { foo: target, bar: 5 }; $.widget.extend( target, recursive ); assert.deepEqual( target, { foo: {}, bar: 5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" ); @@ -92,7 +93,7 @@ assert.strictEqual( ret.foo, null, "Make sure a null value doesn't crash with deep extend, for #1908" ); obj = { foo: null }; - $.widget.extend( obj, { foo:"notnull" } ); + $.widget.extend( obj, { foo: "notnull" } ); assert.equal( obj.foo, "notnull", "Make sure a null value can be overwritten" ); settings = $.widget.extend( {}, defaults, options1, options2 ); @@ -108,6 +109,11 @@ assert.deepEqual( input, output, "don't clone arrays" ); input.key[ 0 ] = 10; assert.deepEqual( input, output, "don't clone arrays" ); + + input = Object.create( null ); + input.foo = "f"; + output = $.widget.extend( {}, input ); + assert.deepEqual( input, output, "Object with no prototype" ); } ); } ); diff -Nru jqueryui-1.12.1+dfsg/tests/visual/compound/draggable_resizable.html jqueryui-1.13.1+dfsg/tests/visual/compound/draggable_resizable.html --- jqueryui-1.12.1+dfsg/tests/visual/compound/draggable_resizable.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/visual/compound/draggable_resizable.html 2022-01-20 12:59:41.000000000 +0000 @@ -27,7 +27,7 @@ minHeight: 13, handles: "s" }); - $( ".draggable:last" ).addClass( "absolute" ); + $( ".draggable" ).last().addClass( "absolute" ); diff -Nru jqueryui-1.12.1+dfsg/tests/visual/dialog/performance.html jqueryui-1.13.1+dfsg/tests/visual/dialog/performance.html --- jqueryui-1.12.1+dfsg/tests/visual/dialog/performance.html 2016-09-14 16:31:37.000000000 +0000 +++ jqueryui-1.13.1+dfsg/tests/visual/dialog/performance.html 2022-01-20 12:59:41.000000000 +0000 @@ -7,7 +7,7 @@