From ed306c0261ab63746040e5d58bb4477c3069a427 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 19 Sep 2022 14:08:12 -0700 Subject: CSS: Don’t trim whitespace of undefined custom property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes gh-5105 Closes gh-5106 Signed-off-by: Anders Kaseorg --- src/css/curCSS.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 15d624bbb..25b4630a5 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -15,7 +15,7 @@ function curCSS( elem, name, computed ) { ret = computed.getPropertyValue( name ) || computed[ name ]; // trim whitespace for custom property (issue gh-4926) - if ( isCustomProp ) { + if ( isCustomProp && ret !== undefined ) { // rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED // as whitespace while CSS does not, but this is not a problem -- cgit v1.2.3