Skip to content

Commit e2fe97b

Browse files
authored
Core: Remove obsolete workarounds, update support comments
Closes jquerygh-5625
1 parent 7c123de commit e2fe97b

File tree

11 files changed

+30
-97
lines changed

11 files changed

+30
-97
lines changed

src/css.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ function getWidthOrHeight( elem, dimension, extra ) {
151151
// Support: IE 10 - 11+
152152
// IE misreports `getComputedStyle` of table rows with width/height
153153
// set in CSS while `offset*` properties report correct values.
154-
// Support: Firefox 70+
154+
// Support: Firefox 70 - 135+
155155
// Firefox includes border widths
156156
// in computed dimensions for table rows. (gh-4529)
157157
( !support.reliableTrDimensions() && nodeName( elem, "tr" ) ) ) &&

src/css/curCSS.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@ export function curCSS( elem, name, computed ) {
3030

3131
if ( isCustomProp && ret ) {
3232

33-
// Support: Firefox 105+, Chrome <=105+
33+
// Support: Firefox 105 - 135+
3434
// Spec requires trimming whitespace for custom properties (gh-4926).
35-
// Firefox only trims leading whitespace. Chrome just collapses
36-
// both leading & trailing whitespace to a single space.
35+
// Firefox only trims leading whitespace.
3736
//
3837
// Fall back to `undefined` if empty string returned.
3938
// This collapses a missing definition with property defined

src/css/support.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ support.reliableTrDimensions = function() {
2525
tr = document.createElement( "tr" );
2626

2727
table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
28-
tr.style.cssText = "box-sizing:content-box;border:1px solid";
29-
30-
// Support: Chrome 86+
31-
// Height set through cssText does not get applied.
32-
// Computed height then comes back as 0.
33-
tr.style.height = "1px";
28+
tr.style.cssText = "box-sizing:content-box;border:1px solid;height:1px";
3429
div.style.height = "9px";
3530

3631
// Support: Android Chrome 86+

src/selector/rbuggyQSA.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ if ( isIE ) {
2525

2626
if ( !support.cssHas ) {
2727

28-
// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
2928
// Our regular `try-catch` mechanism fails to detect natively-unsupported
3029
// pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`)
3130
// in browsers that parse the `:has()` argument as a forgiving selector list.

test/unit/css.js

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ testIframe(
13791379
function( assert, jQuery, window, document, widthBeforeSet, widthAfterSet ) {
13801380
assert.expect( 2 );
13811381

1382-
// Support: Firefox 126+
1382+
// Support: Firefox 126 - 135+
13831383
// Newer Firefox implements CSS zoom in a way it affects
13841384
// those values slightly.
13851385
assert.ok( /^100(?:|\.0\d*)px$/.test( widthBeforeSet ), "elem.css('width') works correctly with browser zoom" );
@@ -1812,14 +1812,9 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
18121812

18131813
var div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ),
18141814
$elem = jQuery( "<div>" ).addClass( "test__customProperties" )
1815-
.appendTo( "#qunit-fixture" ),
1816-
webkitOrBlink = /webkit\b/i.test( navigator.userAgent ),
1817-
expected = 20;
1815+
.appendTo( "#qunit-fixture" );
18181816

1819-
if ( webkitOrBlink ) {
1820-
expected -= 2;
1821-
}
1822-
assert.expect( expected );
1817+
assert.expect( 20 );
18231818

18241819
div.css( "--color", "blue" );
18251820
assert.equal( div.css( "--color" ), "blue", "Modified CSS custom property using string" );
@@ -1848,13 +1843,15 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
18481843
assert.equal( $elem.css( "--prop5" ), "val5", "Multiple Following whitespace trimmed" );
18491844
assert.equal( $elem.css( "--prop6" ), "val6", "Preceding and Following whitespace trimmed" );
18501845
assert.equal( $elem.css( "--prop7" ), "val7", "Multiple preceding and following whitespace trimmed" );
1846+
assert.equal( $elem.css( "--prop8" ), "\"val8\"", "Works with double quotes" );
18511847

1852-
// Support: Chrome <=49 - 73+, Safari <=9.1 - 12.1+
1853-
// Chrome treats single quotes as double ones.
1854-
// Safari treats double quotes as single ones.
1855-
if ( !webkitOrBlink ) {
1856-
assert.equal( $elem.css( "--prop8" ), "\"val8\"", "Works with double quotes" );
1848+
// Support: Safari <=9.1 - 18.1+
1849+
// Safari converts single quotes to double ones.
1850+
if ( !/\bapplewebkit\/605\.1\.15\b/i.test( navigator.userAgent ) ) {
18571851
assert.equal( $elem.css( "--prop9" ), "'val9'", "Works with single quotes" );
1852+
} else {
1853+
assert.equal( $elem.css( "--prop9" ).replace( /"/g, "'" ), "'val9'",
1854+
"Works with single quotes, but they may be changed to double ones" );
18581855
}
18591856

18601857
assert.equal( $elem.css( "--prop10" ), "val10", "Multiple preceding and following escaped unicode whitespace trimmed" );

test/unit/dimensions.js

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -345,29 +345,6 @@ QUnit.test( "child of a hidden elem (or unconnected node) has accurate inner/out
345345
$divNormal.remove();
346346
} );
347347

348-
QUnit.test( "getting dimensions shouldn't modify runtimeStyle see trac-9233", function( assert ) {
349-
assert.expect( 1 );
350-
351-
var $div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ),
352-
div = $div.get( 0 ),
353-
runtimeStyle = div.runtimeStyle;
354-
355-
if ( runtimeStyle ) {
356-
div.runtimeStyle.marginLeft = "12em";
357-
div.runtimeStyle.left = "11em";
358-
}
359-
360-
$div.outerWidth( true );
361-
362-
if ( runtimeStyle ) {
363-
assert.equal( div.runtimeStyle.left, "11em", "getting dimensions modifies runtimeStyle, see trac-9233" );
364-
} else {
365-
assert.ok( true, "this browser doesn't support runtimeStyle, see trac-9233" );
366-
}
367-
368-
$div.remove();
369-
} );
370-
371348
QUnit.test( "table dimensions", function( assert ) {
372349
assert.expect( 2 );
373350

test/unit/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ QUnit.test( "Submit event can be stopped (trac-11049)", function( assert ) {
14381438
form.remove();
14391439
} );
14401440

1441-
// Support: iOS <=7 - 12+
1441+
// Support: iOS <=7 - 18+
14421442
// iOS has the window.onbeforeunload field but doesn't support the beforeunload
14431443
// handler making it impossible to feature-detect the support.
14441444
QUnit[ /(ipad|iphone|ipod)/i.test( navigator.userAgent ) ? "skip" : "test" ](

test/unit/manipulation.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,8 +3020,7 @@ QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {
30203020

30213021
var container,
30223022
counter = 0,
3023-
oldIos = /iphone os (?:8|9|10|11|12)_/i.test( navigator.userAgent ),
3024-
assertCount = oldIos ? 12 : 13,
3023+
assertCount = 13,
30253024
done = assert.async( assertCount );
30263025

30273026
assert.expect( assertCount );
@@ -3065,12 +3064,7 @@ QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {
30653064

30663065
test( "<option><style></option></select><img src=url404 onerror=xss(11)></style>" );
30673066

3068-
// Support: iOS 8 - 12 only.
3069-
// Old iOS parses `<noembed>` tags differently, executing this code. This is no
3070-
// different to native behavior on that OS, though, so just accept it.
3071-
if ( !oldIos ) {
3072-
test( "<noembed><noembed/><img src=url404 onerror=xss(12)>" );
3073-
}
3067+
test( "<noembed><noembed/><img src=url404 onerror=xss(12)>" );
30743068
} );
30753069

30763070
QUnit.test( "Works with invalid attempts to close the table wrapper", function( assert ) {

test/unit/offset.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -752,25 +752,15 @@ QUnit.test( "iframe scrollTop/Left (see gh-1945)", function( assert ) {
752752

753753
var ifDoc = jQuery( "#iframe" )[ 0 ].contentDocument;
754754

755-
// Support: iOS <=8 - 12+
756-
// Mobile Safari resizes the iframe by its content meaning it's not possible to scroll
757-
// the iframe but only its parent element.
758-
if ( /iphone os|ipad/i.test( navigator.userAgent ) ) {
759-
assert.equal( true, true, "Can't scroll iframes in this environment" );
760-
assert.equal( true, true, "Can't scroll iframes in this environment" );
755+
// Tests scrollTop/Left with iframes
756+
jQuery( "#iframe" ).css( "width", "50px" ).css( "height", "50px" );
757+
ifDoc.write( "<div style='width: 1000px; height: 1000px;'></div>" );
761758

762-
} else {
759+
jQuery( ifDoc ).scrollTop( 200 );
760+
jQuery( ifDoc ).scrollLeft( 500 );
763761

764-
// Tests scrollTop/Left with iframes
765-
jQuery( "#iframe" ).css( "width", "50px" ).css( "height", "50px" );
766-
ifDoc.write( "<div style='width: 1000px; height: 1000px;'></div>" );
767-
768-
jQuery( ifDoc ).scrollTop( 200 );
769-
jQuery( ifDoc ).scrollLeft( 500 );
770-
771-
assert.equal( jQuery( ifDoc ).scrollTop(), 200, "$($('#iframe')[0].contentDocument).scrollTop()" );
772-
assert.equal( jQuery( ifDoc ).scrollLeft(), 500, "$($('#iframe')[0].contentDocument).scrollLeft()" );
773-
}
762+
assert.equal( jQuery( ifDoc ).scrollTop(), 200, "$($('#iframe')[0].contentDocument).scrollTop()" );
763+
assert.equal( jQuery( ifDoc ).scrollLeft(), 500, "$($('#iframe')[0].contentDocument).scrollLeft()" );
774764
} );
775765

776766
} )();

test/unit/selector.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ QUnit.test( "pseudo - nth-child", function( assert ) {
858858
);
859859
} else {
860860

861-
// Support: Chrome 75+, Firefox 67+
861+
// Support: Chrome 75 - 133+, Firefox 67 - 135+
862862
// Some browsers mark disconnected elements as matching `:nth-child(n)`
863863
// so let's skip the test.
864864
assert.ok( "skip", "disconnected elements match ':nth-child(n)' in Chrome/Firefox" );
@@ -912,7 +912,7 @@ QUnit.test( "pseudo - nth-last-child", function( assert ) {
912912
);
913913
} else {
914914

915-
// Support: Chrome 75+, Firefox 67+
915+
// Support: Chrome 75 - 133+, Firefox 67 - 135+
916916
// Some browsers mark disconnected elements as matching `:nth-last-child(n)`
917917
// so let's skip the test.
918918
assert.ok( "skip", "disconnected elements match ':nth-last-child(n)' in Chrome/Firefox" );
@@ -954,7 +954,7 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "pseudo - has", function( asse
954954
"div:has(div:has(div:not([id])))",
955955
[ "moretests", "t2037", "fx-test-group", "fx-queue" ] );
956956

957-
// Support: Safari 15.4+, Chrome 105+
957+
// Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only
958958
// `qSA` in Safari/Chrome throws for `:has()` with only unsupported arguments
959959
// but if you add a supported arg to the list, it will run and just potentially
960960
// return no results. Make sure this is accounted for. (gh-5098)

0 commit comments

Comments
 (0)