From 76468365779c2d07c7f25ded141e99bad97f78a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Wed, 25 Apr 2018 09:55:38 +0200 Subject: [PATCH 001/441] Build: Test on Node 10, stop testing on Node 4 & 9 Node.js 4 & 9 are ending their life, Node.js 10 has just been released. Closes gh-4057 --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4fa82ae7ac..4de56ec5f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,9 @@ language: node_js sudo: false node_js: -- "4" - "6" - "8" -- "9" +- "10" addons: chrome: stable env: From f5e36bd8f2c2b28231bbed926c6c3dead94db545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Mon, 30 Apr 2018 18:52:39 +0200 Subject: [PATCH 002/441] CSS: Skip the px-appending logic for animations of non-element props Without this change animating properties from jQuery.cssNumber on non-elements throws an error. Ref gh-4055 Closes gh-4061 --- src/css/adjustCSS.js | 3 ++- test/unit/effects.js | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/css/adjustCSS.js b/src/css/adjustCSS.js index 626ec74758..8898789a7b 100644 --- a/src/css/adjustCSS.js +++ b/src/css/adjustCSS.js @@ -19,7 +19,8 @@ function adjustCSS( elem, prop, valueParts, tween ) { unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches - initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { diff --git a/test/unit/effects.js b/test/unit/effects.js index 462524ef37..e297273e46 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -607,6 +607,17 @@ QUnit.test( "animate non-element", function( assert ) { this.clock.tick( 200 ); } ); +QUnit.test( "animate non-element's zIndex without appending \"px\"", function( assert ) { + assert.expect( 1 ); + + var obj = { zIndex: 0 }; + + jQuery( obj ).animate( { zIndex: 200 }, 200, function() { + assert.equal( obj.zIndex, 200, "The custom property should be modified without appending \"px\"." ); + } ); + this.clock.tick( 200 ); +} ); + QUnit.test( "stop()", function( assert ) { assert.expect( 4 ); From f8c1e9020c8fd0f0bb83019bfb12e9a7099599b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski-Owczarek?= Date: Wed, 2 May 2018 17:08:20 +0200 Subject: [PATCH 003/441] CSS: Ensure camel- vs kebab-cased names are not collapsed for CSS vars Closes gh-4062 --- test/unit/css.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/css.js b/test/unit/css.js index 29fa709067..fbb42c3011 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1632,10 +1632,12 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function( assert.equal( div.css( "--color" ), "red", "Modified CSS custom property using object" ); div.css( { "--mixedCase": "green" } ); + div.css( { "--mixed-case": "red" } ); assert.equal( div.css( "--mixedCase" ), "green", "Modified CSS custom property with mixed case" ); div.css( { "--theme-dark": "purple" } ); + div.css( { "--themeDark": "red" } ); assert.equal( div.css( "--theme-dark" ), "purple", "Modified CSS custom property with dashed name" ); From 821bf34353a6baf97f7944379a6459afb16badae Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 7 May 2018 09:28:18 -0400 Subject: [PATCH 004/441] CSS: Correctly detect scrollbox support with non-default zoom Fixes gh-4029 Closes gh-4030 --- src/css.js | 16 +++++++++------- src/css/support.js | 4 +++- test/data/css/cssWidthBrowserZoom.html | 6 +++++- test/unit/css.js | 7 ++++--- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/css.js b/src/css.js index ea73020121..e936c8f30e 100644 --- a/src/css.js +++ b/src/css.js @@ -352,13 +352,15 @@ jQuery.each( [ "height", "width" ], function( i, dimension ) { boxSizingNeeded = scrollBoxSize || extra, isBorderBox = boxSizingNeeded && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", - subtract = extra && boxModelAdjustment( - elem, - dimension, - extra, - isBorderBox, - styles - ); + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; // Account for unreliable border-box dimensions by comparing offset* to computed and // faking a content-box to get border and padding (gh-3699) diff --git a/src/css/support.js b/src/css/support.js index dbb7ef7ce1..12706f7e9a 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -43,8 +43,10 @@ define( [ // Support: IE 9 only // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) div.style.position = "absolute"; - scrollboxSizeVal = div.offsetWidth === 36 || "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12 || "absolute"; documentElement.removeChild( container ); diff --git a/test/data/css/cssWidthBrowserZoom.html b/test/data/css/cssWidthBrowserZoom.html index 99f87ea292..133daf6220 100644 --- a/test/data/css/cssWidthBrowserZoom.html +++ b/test/data/css/cssWidthBrowserZoom.html @@ -7,6 +7,7 @@ zoom: 1.1; } #test { + position: absolute; width: 100px; height: 100px; padding: 10px; @@ -20,7 +21,10 @@ diff --git a/test/unit/css.js b/test/unit/css.js index fbb42c3011..626981b7d8 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1167,9 +1167,10 @@ testIframe( testIframe( "css('width') should work correctly with browser zooming", "css/cssWidthBrowserZoom.html", - function( assert, jQuery, window, document, cssWidthBrowserZoom ) { - assert.expect( 1 ); - assert.strictEqual( cssWidthBrowserZoom, "100px", "elem.css('width') works correctly with browser zoom" ); + function( assert, jQuery, window, document, widthBeforeSet, widthAfterSet ) { + assert.expect( 2 ); + assert.strictEqual( widthBeforeSet, "100px", "elem.css('width') works correctly with browser zoom" ); + assert.strictEqual( widthAfterSet, "100px", "elem.css('width', val) works correctly with browser zoom" ); } ); From 0ba8e38d0c4ab4a4fb9054e7a713630be9743aff Mon Sep 17 00:00:00 2001 From: Luis Emilio Velasco Sanchez Date: Mon, 14 May 2018 13:36:30 -0400 Subject: [PATCH 005/441] Traversing: $.fn.contents() support for object Fixes gh-4045 Closes gh-4046 --- Gruntfile.js | 2 +- src/traversing.js | 24 ++++----- test/data/1x1.svg | 6 +++ test/data/frame.html | 9 ++++ test/unit/traversing.js | 106 ++++++++++++++++++++++++++-------------- 5 files changed, 96 insertions(+), 51 deletions(-) create mode 100644 test/data/1x1.svg create mode 100644 test/data/frame.html diff --git a/Gruntfile.js b/Gruntfile.js index fbf9b56717..ed2bd77537 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -209,7 +209,7 @@ module.exports = function( grunt ) { { pattern: "dist/*.map", included: false, served: true }, { pattern: "external/qunit/qunit.css", included: false, served: true }, { - pattern: "test/**/*.@(js|css|jpg|html|xml)", + pattern: "test/**/*.@(js|css|jpg|html|xml|svg)", included: false, served: true } diff --git a/src/traversing.js b/src/traversing.js index 64c7252b9f..426d5b6ea3 100644 --- a/src/traversing.js +++ b/src/traversing.js @@ -145,18 +145,18 @@ jQuery.each( { return siblings( elem.firstChild ); }, contents: function( elem ) { - if ( nodeName( elem, "iframe" ) ) { - return elem.contentDocument; - } - - // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only - // Treat the template element as a regular one in browsers that - // don't support it. - if ( nodeName( elem, "template" ) ) { - elem = elem.content || elem; - } - - return jQuery.merge( [], elem.childNodes ); + if ( typeof elem.contentDocument !== "undefined" ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { diff --git a/test/data/1x1.svg b/test/data/1x1.svg new file mode 100644 index 0000000000..70b3e7412b --- /dev/null +++ b/test/data/1x1.svg @@ -0,0 +1,6 @@ + + + + diff --git a/test/data/frame.html b/test/data/frame.html new file mode 100644 index 0000000000..98107be1d8 --- /dev/null +++ b/test/data/frame.html @@ -0,0 +1,9 @@ + + + frame + + + + + + diff --git a/test/unit/traversing.js b/test/unit/traversing.js index dd05541378..9ba66959e6 100644 --- a/test/unit/traversing.js +++ b/test/unit/traversing.js @@ -744,56 +744,86 @@ QUnit.test( "contents()", function( assert ) { } ); QUnit.test( "contents() for