mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
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
This commit is contained in:
parent
a51eec7484
commit
e9f77267d0
@ -1732,6 +1732,8 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
|
|||||||
|
|
||||||
( function() {
|
( function() {
|
||||||
var supportsCssVars,
|
var supportsCssVars,
|
||||||
|
oldSafari = /iphone os 9_/i.test( navigator.userAgent ) ||
|
||||||
|
/\b9\.\d+(\.\d+)* safari/i.test( navigator.userAgent ),
|
||||||
elem = jQuery( "<div>" ).appendTo( document.body ),
|
elem = jQuery( "<div>" ).appendTo( document.body ),
|
||||||
div = elem[ 0 ];
|
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" );
|
supportsCssVars = !!getComputedStyle( div ).getPropertyValue( "--prop" );
|
||||||
elem.remove();
|
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(
|
jQuery( "#qunit-fixture" ).append(
|
||||||
"<style>\n" +
|
"<style>\n" +
|
||||||
" .test__customProperties {\n" +
|
" .test__customProperties {\n" +
|
||||||
|
Loading…
Reference in New Issue
Block a user