Skip to content

Commit d737f95

Browse files
committed
Core: Remove obsolete workarounds, update support comments
1 parent 667321e commit d737f95

File tree

10 files changed

+30
-74
lines changed

10 files changed

+30
-74
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/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)

test/unit/support.js

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,10 @@ testIframe(
8484
cssHas: true,
8585
reliableTrDimensions: false
8686
},
87-
chrome_111: {
88-
cssHas: false,
89-
reliableTrDimensions: true
90-
},
9187
chrome: {
9288
cssHas: true,
9389
reliableTrDimensions: true
9490
},
95-
safari_16_3: {
96-
cssHas: false,
97-
reliableTrDimensions: true
98-
},
9991
safari: {
10092
cssHas: true,
10193
reliableTrDimensions: true
@@ -104,11 +96,7 @@ testIframe(
10496
cssHas: true,
10597
reliableTrDimensions: false
10698
},
107-
ios_14_15_3: {
108-
cssHas: true,
109-
reliableTrDimensions: true
110-
},
111-
ios_15_4_16_3: {
99+
ios_16_3: {
112100
cssHas: false,
113101
reliableTrDimensions: true
114102
},
@@ -127,22 +115,16 @@ testIframe(
127115

128116
if ( document.documentMode ) {
129117
expected = expectedMap.ie_11;
130-
} else if ( /\b(?:headless)?chrome\/(?:10\d|11[01])\b/i.test( userAgent ) ) {
131-
expected = expectedMap.chrome_111;
132118
} else if ( /\b(?:headless)?chrome\//i.test( userAgent ) ) {
133119

134120
// Catches Edge, Chrome on Android & Opera as well.
135121
expected = expectedMap.chrome;
136122
} else if ( /\bfirefox\//i.test( userAgent ) ) {
137123
expected = expectedMap.firefox;
138-
} else if ( /\biphone os (?:14_|15_[0123])/i.test( userAgent ) ) {
139-
expected = expectedMap.ios_14_15_3;
140-
} else if ( /\biphone os (?:15_|16_[0123])/i.test( userAgent ) ) {
141-
expected = expectedMap.ios_15_4_16_3;
124+
} else if ( /\biphone os 16_[0123]/i.test( userAgent ) ) {
125+
expected = expectedMap.ios_16_3;
142126
} else if ( /\b(?:iphone|ipad);.*(?:iphone)? os \d+_/i.test( userAgent ) ) {
143127
expected = expectedMap.ios;
144-
} else if ( /\bversion\/(?:15|16\.[0123])(?:\.\d+)* safari/i.test( userAgent ) ) {
145-
expected = expectedMap.safari_16_3;
146128
} else if ( /\bversion\/\d+(?:\.\d+)+ safari/i.test( userAgent ) ) {
147129
expected = expectedMap.safari;
148130
}

0 commit comments

Comments
 (0)