diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-04-29 22:56:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-29 22:56:09 +0200 |
commit | cf84696fd1d7fe314a11492606529b5a658ee9e3 (patch) | |
tree | 8fd4a45dd755e5f1215adbc82e7870727c8164e8 /test/unit/css.js | |
parent | bde53edcf4bd6c975d068eed4eb16c5ba09c1cff (diff) | |
download | jquery-cf84696fd1d7fe314a11492606529b5a658ee9e3.tar.gz jquery-cf84696fd1d7fe314a11492606529b5a658ee9e3.zip |
Core: Drop support for IE <11, iOS <11, Firefox <65, Android Browser & PhantomJS
Also, update support comments format to match format described in:
https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
with the change from:
https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-448998379
(open-ended ranges end with `+`).
Fixes gh-3950
Fixes gh-4299
Closes gh-4347
Diffstat (limited to 'test/unit/css.js')
-rw-r--r-- | test/unit/css.js | 79 |
1 files changed, 21 insertions, 58 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index 74daa2b2d..75b1cc7ef 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -641,7 +641,7 @@ QUnit.test( "show/hide detached nodes", function( assert ) { span.remove(); } ); -QUnit[ document.body.attachShadow ? "test" : "skip" ]( "show/hide shadow child nodes", function( assert ) { +QUnit[ document.body.getRootNode ? "test" : "skip" ]( "show/hide shadow child nodes", function( assert ) { assert.expect( 28 ); jQuery( "<div id='shadowHost'></div>" ).appendTo( "#qunit-fixture" ); var shadowHost = document.querySelector( "#shadowHost" ); @@ -1023,7 +1023,7 @@ QUnit[ jQuery.find.compile && jQuery.fn.toggle ? "test" : "skip" ]( "detached to "cascade-hidden element in detached tree" ); } ); -QUnit[ jQuery.find.compile && jQuery.fn.toggle && document.body.attachShadow ? "test" : "skip" ]( "shadow toggle()", function( assert ) { +QUnit[ jQuery.find.compile && jQuery.fn.toggle && document.body.getRootNode ? "test" : "skip" ]( "shadow toggle()", function( assert ) { assert.expect( 4 ); jQuery( "<div id='shadowHost'></div>" ).appendTo( "#qunit-fixture" ); var shadowHost = document.querySelector( "#shadowHost" ); @@ -1420,16 +1420,6 @@ QUnit.test( "certain css values of 'normal' should be convertable to a number, s assert.equal( typeof el.css( "fontWeight" ), "string", ".css() returns a string" ); } ); -// Support: IE 9 only -// Only run this test in IE9 -if ( document.documentMode === 9 ) { - QUnit.test( ".css('filter') returns a string in IE9, see #12537", function( assert ) { - assert.expect( 1 ); - - assert.equal( jQuery( "<div style='-ms-filter:\"progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)\";'></div>" ).css( "filter" ), "progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFFFFF, endColorstr=#ECECEC)", "IE9 returns the correct value from css('filter')." ); - } ); -} - QUnit.test( "cssHooks - expand", function( assert ) { assert.expect( 15 ); var result, @@ -1489,9 +1479,9 @@ QUnit.test( "css opacity consistency across browsers (#12685)", function( assert } ); QUnit[ jQuery.find.compile ? "test" : "skip" ]( ":visible/:hidden selectors", function( assert ) { - assert.expect( 17 ); + assert.expect( 18 ); - var $div, $table, $a; + var $div, $table, $a, $br; assert.ok( jQuery( "#nothiddendiv" ).is( ":visible" ), "Modifying CSS display: Assert element is visible" ); jQuery( "#nothiddendiv" ).css( { display: "none" } ); @@ -1513,10 +1503,8 @@ QUnit[ jQuery.find.compile ? "test" : "skip" ]( ":visible/:hidden selectors", fu $div.css( { width: 0, height: 0, overflow: "hidden" } ); assert.ok( $div.is( ":visible" ), "Div with width and height of 0 is still visible (gh-2227)" ); - // Safari 6-7 and iOS 6-7 report 0 width for br elements - // When newer browsers propagate, re-enable this test - // $br = jQuery( "<br/>" ).appendTo( "#qunit-fixture" ); - // assert.ok( $br.is( ":visible" ), "br element is visible" ); + $br = jQuery( "<br/>" ).appendTo( "#qunit-fixture" ); + assert.ok( $br.is( ":visible" ), "br element is visible" ); $table = jQuery( "#table" ); $table.html( "<tr><td style='display:none'>cell</td><td>cell</td></tr>" ); @@ -1539,11 +1527,7 @@ QUnit.test( "Keep the last style if the new one isn't recognized by the browser assert.equal( el.css( "position" ), "absolute", "The old style is kept when setting an unrecognized value" ); } ); -// Support: Edge 14 - 16 only -// Edge collapses whitespace-only values when setting a style property and -// there is no easy way for us to work around it. Just skip the test there -// and hope for the better future. -QUnit[ /\bedge\/16\./i.test( navigator.userAgent ) ? "skip" : "test" ]( +QUnit.test( "Keep the last style if the new one is a non-empty whitespace (gh-3204)", function( assert ) { assert.expect( 1 ); @@ -1648,25 +1632,14 @@ QUnit.test( } ); -// Support: IE <=10 only -// We have to jump through the hoops here in order to test work with "order" CSS property, -// that some browsers do not support. This test is not, strictly speaking, correct, -// but it's the best that we can do. -( function() { - var style = document.createElement( "div" ).style, - exist = "order" in style || "WebkitOrder" in style; - - if ( exist ) { - QUnit.test( "Don't append px to CSS \"order\" value (#14049)", function( assert ) { - assert.expect( 1 ); +QUnit.test( "Don't append px to CSS \"order\" value (#14049)", function( assert ) { + assert.expect( 1 ); - var $elem = jQuery( "<div/>" ); + var $elem = jQuery( "<div/>" ); - $elem.css( "order", 2 ); - assert.equal( $elem.css( "order" ), "2", "2 on order" ); - } ); - } -} )(); + $elem.css( "order", 2 ); + assert.equal( $elem.css( "order" ), "2", "2 on order" ); +} ); QUnit.test( "Do not throw on frame elements from css method (#15098)", function( assert ) { assert.expect( 1 ); @@ -1788,18 +1761,12 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function( var div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ), $elem = jQuery( "<div>" ).addClass( "test__customProperties" ) .appendTo( "#qunit-fixture" ), - webkit = /\bsafari\b/i.test( navigator.userAgent ) && - !/\firefox\b/i.test( navigator.userAgent ) && - !/\edge\b/i.test( navigator.userAgent ), - oldSafari = webkit && ( /\b9\.\d(\.\d+)* safari/i.test( navigator.userAgent ) || - /\b10\.0(\.\d+)* safari/i.test( navigator.userAgent ) || - /iphone os (?:9|10)_/i.test( navigator.userAgent ) ), + webkitOrBlink = /\bsafari\b/i.test( navigator.userAgent ) && + !/\bfirefox\b/i.test( navigator.userAgent ) && + !/\bedge\b/i.test( navigator.userAgent ), expected = 10; - if ( webkit ) { - expected -= 2; - } - if ( oldSafari ) { + if ( webkitOrBlink ) { expected -= 2; } assert.expect( expected ); @@ -1825,17 +1792,13 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function( assert.equal( $elem.css( "--prop1" ), "val1", "Basic CSS custom property" ); - // Support: Safari 9.1-10.0 only - // Safari collapses whitespaces & quotes. Ignore it. - if ( !oldSafari ) { - assert.equal( $elem.css( "--prop2" ), " val2", "Preceding whitespace maintained" ); - assert.equal( $elem.css( "--prop3" ), "val3 ", "Following whitespace maintained" ); - } + assert.equal( $elem.css( "--prop2" ), " val2", "Preceding whitespace maintained" ); + assert.equal( $elem.css( "--prop3" ), "val3 ", "Following whitespace maintained" ); - // Support: Chrome 49-55, Safari 9.1-10.0 + // Support: Chrome <=49 - 73+, Safari <=9.1 - 12.1+ // Chrome treats single quotes as double ones. // Safari treats double quotes as single ones. - if ( !webkit ) { + if ( !webkitOrBlink ) { assert.equal( $elem.css( "--prop4" ), "\"val4\"", "Works with double quotes" ); assert.equal( $elem.css( "--prop5" ), "'val5'", "Works with single quotes" ); } |