@@ -1745,28 +1745,27 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
1745
1745
" .test__customProperties {\n" +
1746
1746
" --prop1:val1;\n" +
1747
1747
" --prop2: val2;\n" +
1748
- " --prop3:val3 ;\n" +
1749
- " --prop4:\"val4\";\n" +
1750
- " --prop5:'val5';\n" +
1748
+ " --prop3: val3;\n" +
1749
+ " --prop4:val4 ;\n" +
1750
+ " --prop5:val5 ;\n" +
1751
+ " --prop6: val6 ;\n" +
1752
+ " --prop7: val7 ;\n" +
1753
+ " --prop8:\"val8\";\n" +
1754
+ " --prop9:'val9';\n" +
1755
+ " --prop10:\f\r\n\t val10 \f\r\n\t;\n" +
1756
+ " --prop11:\u000C\u000D\u000A\u0009\u0020val11\u0020\u0009\u000A\u000D\u000C;\n" +
1757
+ " --prop12:\u000Bval12\u000B;\n" +
1751
1758
" }\n" +
1752
1759
"</style>"
1753
1760
) ;
1754
1761
1755
1762
var div = jQuery ( "<div>" ) . appendTo ( "#qunit-fixture" ) ,
1756
1763
$elem = jQuery ( "<div>" ) . addClass ( "test__customProperties" )
1757
1764
. appendTo ( "#qunit-fixture" ) ,
1758
- webkit = / \b s a f a r i \b / i. test ( navigator . userAgent ) &&
1759
- ! / \f i r e f o x \b / i. test ( navigator . userAgent ) &&
1760
- ! / \e d g e \b / i. test ( navigator . userAgent ) ,
1761
- oldSafari = webkit && ( / \b 9 \. \d ( \. \d + ) * s a f a r i / i. test ( navigator . userAgent ) ||
1762
- / \b 1 0 \. 0 ( \. \d + ) * s a f a r i / i. test ( navigator . userAgent ) ||
1763
- / i p h o n e o s (?: 9 | 1 0 ) _ / i. test ( navigator . userAgent ) ) ,
1764
- expected = 10 ;
1765
-
1766
- if ( webkit ) {
1767
- expected -= 2 ;
1768
- }
1769
- if ( oldSafari ) {
1765
+ webkitOrBlink = / \b s a f a r i \b / i. test ( navigator . userAgent ) ,
1766
+ expected = 17 ;
1767
+
1768
+ if ( webkitOrBlink ) {
1770
1769
expected -= 2 ;
1771
1770
}
1772
1771
assert . expect ( expected ) ;
@@ -1792,20 +1791,24 @@ QUnit.test( "Do not throw on frame elements from css method (#15098)", function(
1792
1791
1793
1792
assert . equal ( $elem . css ( "--prop1" ) , "val1" , "Basic CSS custom property" ) ;
1794
1793
1795
- // Support: Safari 9.1-10.0 only
1796
- // Safari collapses whitespaces & quotes. Ignore it.
1797
- if ( ! oldSafari ) {
1798
- assert . equal ( $elem . css ( "--prop2 " ) , " val2 " , "Preceding whitespace maintained " ) ;
1799
- assert . equal ( $elem . css ( "--prop3 " ) , "val3 " , "Following whitespace maintained " ) ;
1800
- }
1794
+ assert . equal ( $elem . css ( "--prop2" ) , "val2" , "Preceding whitespace trimmed" ) ;
1795
+ assert . equal ( $elem . css ( "--prop3" ) , "val3" , "Multiple preceding whitespace trimmed" ) ;
1796
+ assert . equal ( $elem . css ( "--prop4" ) , "val4" , "Following whitespace trimmed" ) ;
1797
+ assert . equal ( $elem . css ( "--prop5 " ) , "val5 " , "Multiple Following whitespace trimmed " ) ;
1798
+ assert . equal ( $elem . css ( "--prop6 " ) , "val6 " , "Preceding and Following whitespace trimmed " ) ;
1799
+ assert . equal ( $elem . css ( "--prop7" ) , "val7" , "Multiple preceding and following whitespace trimmed" ) ;
1801
1800
1802
- // Support: Chrome 49-55 , Safari 9.1-10.0
1801
+ // Support: Chrome <=49 - 73+ , Safari <= 9.1 - 12.1+
1803
1802
// Chrome treats single quotes as double ones.
1804
1803
// Safari treats double quotes as single ones.
1805
- if ( ! webkit ) {
1806
- assert . equal ( $elem . css ( "--prop4 " ) , "\"val4 \"" , "Works with double quotes" ) ;
1807
- assert . equal ( $elem . css ( "--prop5 " ) , "'val5 '" , "Works with single quotes" ) ;
1804
+ if ( ! webkitOrBlink ) {
1805
+ assert . equal ( $elem . css ( "--prop8 " ) , "\"val8 \"" , "Works with double quotes" ) ;
1806
+ assert . equal ( $elem . css ( "--prop9 " ) , "'val9 '" , "Works with single quotes" ) ;
1808
1807
}
1808
+
1809
+ assert . equal ( $elem . css ( "--prop10" ) , "val10" , "Multiple preceding and following escaped unicode whitespace trimmed" ) ;
1810
+ assert . equal ( $elem . css ( "--prop11" ) , "val11" , "Multiple preceding and following unicode whitespace trimmed" ) ;
1811
+ assert . equal ( $elem . css ( "--prop12" ) , "\u000Bval12\u000B" , "Multiple preceding and following non-CSS whitespace reserved" ) ;
1809
1812
} ) ;
1810
1813
1811
1814
QUnit [ supportsCssVars ? "test" : "skip" ] ( "Don't append px to CSS vars" , function ( assert ) {
0 commit comments