diff --git a/src/render/background.ts b/src/render/background.ts index 3fed4d3..6e0e877 100644 --- a/src/render/background.ts +++ b/src/render/background.ts @@ -91,6 +91,10 @@ export const calculateBackgroundSize = ( ): [number, number] => { const [first, second] = size; + if (!first) { + return [0, 0]; + } + if (isLengthPercentage(first) && second && isLengthPercentage(second)) { return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)]; } diff --git a/tests/reftests/background/size.html b/tests/reftests/background/size.html index d551136..48b7463 100644 --- a/tests/reftests/background/size.html +++ b/tests/reftests/background/size.html @@ -61,6 +61,7 @@
+