diff options
author | Anders Kaseorg <andersk@mit.edu> | 2022-09-19 14:08:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-19 23:08:12 +0200 |
commit | ed306c0261ab63746040e5d58bb4477c3069a427 (patch) | |
tree | 23b332d2a7df5794d2b98ce39ec26db53df37742 /test | |
parent | d153c375e67f2c2dba82c2fb079c36b8d795e66a (diff) | |
download | jquery-ed306c0261ab63746040e5d58bb4477c3069a427.tar.gz jquery-ed306c0261ab63746040e5d58bb4477c3069a427.zip |
CSS: Don’t trim whitespace of undefined custom property
Fixes gh-5105
Closes gh-5106
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/css.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/css.js b/test/unit/css.js index a3e44bb44..b692caac9 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -1748,6 +1748,7 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) { " --prop10:\f\r\n\t val10 \f\r\n\t;\n" + " --prop11:\u000C\u000D\u000A\u0009\u0020val11\u0020\u0009\u000A\u000D\u000C;\n" + " --prop12:\u000Bval12\u000B;\n" + + " --empty:;\n" + " }\n" + "</style>" ); @@ -1756,7 +1757,7 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) { $elem = jQuery( "<div>" ).addClass( "test__customProperties" ) .appendTo( "#qunit-fixture" ), webkitOrBlink = /\bsafari\b/i.test( navigator.userAgent ), - expected = 17; + expected = 19; if ( webkitOrBlink ) { expected -= 2; @@ -1802,6 +1803,8 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) { assert.equal( $elem.css( "--prop10" ), "val10", "Multiple preceding and following escaped unicode whitespace trimmed" ); assert.equal( $elem.css( "--prop11" ), "val11", "Multiple preceding and following unicode whitespace trimmed" ); assert.equal( $elem.css( "--prop12" ), "\u000Bval12\u000B", "Multiple preceding and following non-CSS whitespace reserved" ); + assert.equal( $elem.css( "--empty" ), undefined ); + assert.equal( $elem.css( "--nonexistent" ), undefined ); } ); // IE doesn't support CSS variables. |