From: Michał Gołębiowski-Owczarek Date: Mon, 15 Nov 2021 17:40:58 +0000 (+0100) Subject: Tests: Disable CSS Custom Properties tests in old Safari/iOS X-Git-Tag: 3.6.1~22 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e9f77267d00f5d323a8d52bbacdd8d31b265154a;p=jquery.git Tests: Disable CSS Custom Properties tests in old Safari/iOS Safari 9.1 & iOS 9.3 support CSS custom properties but that support is buggy which crashes our tests. Disable those tests there. See https://caniuse.com/css-variables Closes gh-4966 --- diff --git a/test/unit/css.js b/test/unit/css.js index 84f8c381c..e0bff5868 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1732,6 +1732,8 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function( ( function() { var supportsCssVars, + oldSafari = /iphone os 9_/i.test( navigator.userAgent ) || + /\b9\.\d+(\.\d+)* safari/i.test( navigator.userAgent ), elem = jQuery( "
" ).appendTo( document.body ), div = elem[ 0 ]; @@ -1739,7 +1741,15 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function( supportsCssVars = !!getComputedStyle( div ).getPropertyValue( "--prop" ); elem.remove(); - QUnit[ supportsCssVars ? "test" : "skip" ]( "css(--customProperty)", function( assert ) { + QUnit[ + + // Support: iOS 9.3 only, Safari 9.1 only + // Safari 9.1 & iOS 9.3 support CSS custom properties but that support + // is buggy which crashes our tests. + supportsCssVars && !oldSafari ? + "test" : + "skip" + ]( "css(--customProperty)", function( assert ) { jQuery( "#qunit-fixture" ).append( "