@@ -1738,9 +1738,16 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
1738
1738
" .test__customProperties {\n" +
1739
1739
" --prop1:val1;\n" +
1740
1740
" --prop2: val2;\n" +
1741
- " --prop3:val3 ;\n" +
1742
- " --prop4:\"val4\";\n" +
1743
- " --prop5:'val5';\n" +
1741
+ " --prop3: val3;\n" +
1742
+ " --prop4:val4 ;\n" +
1743
+ " --prop5:val5 ;\n" +
1744
+ " --prop6: val6 ;\n" +
1745
+ " --prop7: val7 ;\n" +
1746
+ " --prop8:\"val8\";\n" +
1747
+ " --prop9:'val9';\n" +
1748
+ " --prop10:\f\r\n\t val10 \f\r\n\t;\n" +
1749
+ " --prop11:\u000C\u000D\u000A\u0009\u0020val11\u0020\u0009\u000A\u000D\u000C;\n" +
1750
+ " --prop12:\u000Bval12\u000B;\n" +
1744
1751
" }\n" +
1745
1752
"</style>"
1746
1753
) ;
@@ -1749,7 +1756,7 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
1749
1756
$elem = jQuery ( "<div>" ) . addClass ( "test__customProperties" )
1750
1757
. appendTo ( "#qunit-fixture" ) ,
1751
1758
webkitOrBlink = / \b s a f a r i \b / i. test ( navigator . userAgent ) ,
1752
- expected = 10 ;
1759
+ expected = 17 ;
1753
1760
1754
1761
if ( webkitOrBlink ) {
1755
1762
expected -= 2 ;
@@ -1777,16 +1784,24 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
1777
1784
1778
1785
assert . equal ( $elem . css ( "--prop1" ) , "val1" , "Basic CSS custom property" ) ;
1779
1786
1780
- assert . equal ( $elem . css ( "--prop2" ) , " val2" , "Preceding whitespace maintained" ) ;
1781
- assert . equal ( $elem . css ( "--prop3" ) , "val3 " , "Following whitespace maintained" ) ;
1787
+ assert . equal ( $elem . css ( "--prop2" ) , "val2" , "Preceding whitespace trimmed" ) ;
1788
+ assert . equal ( $elem . css ( "--prop3" ) , "val3" , "Multiple preceding whitespace trimmed" ) ;
1789
+ assert . equal ( $elem . css ( "--prop4" ) , "val4" , "Following whitespace trimmed" ) ;
1790
+ assert . equal ( $elem . css ( "--prop5" ) , "val5" , "Multiple Following whitespace trimmed" ) ;
1791
+ assert . equal ( $elem . css ( "--prop6" ) , "val6" , "Preceding and Following whitespace trimmed" ) ;
1792
+ assert . equal ( $elem . css ( "--prop7" ) , "val7" , "Multiple preceding and following whitespace trimmed" ) ;
1782
1793
1783
1794
// Support: Chrome <=49 - 73+, Safari <=9.1 - 12.1+
1784
1795
// Chrome treats single quotes as double ones.
1785
1796
// Safari treats double quotes as single ones.
1786
1797
if ( ! webkitOrBlink ) {
1787
- assert . equal ( $elem . css ( "--prop4 " ) , "\"val4 \"" , "Works with double quotes" ) ;
1788
- assert . equal ( $elem . css ( "--prop5 " ) , "'val5 '" , "Works with single quotes" ) ;
1798
+ assert . equal ( $elem . css ( "--prop8 " ) , "\"val8 \"" , "Works with double quotes" ) ;
1799
+ assert . equal ( $elem . css ( "--prop9 " ) , "'val9 '" , "Works with single quotes" ) ;
1789
1800
}
1801
+
1802
+ assert . equal ( $elem . css ( "--prop10" ) , "val10" , "Multiple preceding and following escaped unicode whitespace trimmed" ) ;
1803
+ assert . equal ( $elem . css ( "--prop11" ) , "val11" , "Multiple preceding and following unicode whitespace trimmed" ) ;
1804
+ assert . equal ( $elem . css ( "--prop12" ) , "\u000Bval12\u000B" , "Multiple preceding and following non-CSS whitespace reserved" ) ;
1790
1805
} ) ;
1791
1806
1792
1807
// IE doesn't support CSS variables.
0 commit comments