File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -618,19 +618,27 @@ static bool parse_hsl(
618618 consumeWhitespace (vector , ctx );
619619
620620 token = parserutils_vector_iterate (vector , ctx );
621- if ((token == NULL ) || (token -> type != CSS_TOKEN_NUMBER ))
621+ if ((token == NULL ) ||
622+ (token -> type != CSS_TOKEN_NUMBER &&
623+ token -> type != CSS_TOKEN_PERCENTAGE )) {
622624 return false;
625+ }
623626
624627 alpha = css__number_from_lwc_string (token -> idata , false, & consumed );
625- if (consumed != lwc_string_length (token -> idata ))
626- return false; /* failed to consume the whole string as a number */
628+ if (consumed != lwc_string_length (token -> idata )) {
629+ /* failed to consume the whole string as a number */
630+ return false;
631+ }
627632
628- alpha = FIXTOINT (FMUL (alpha , F_255 ));
633+ if (token -> type != CSS_TOKEN_NUMBER ) {
634+ alpha = FIXTOINT (FMUL (alpha , F_255 ));
635+ } else {
636+ alpha = FIXTOINT (FDIV (FMUL (alpha , F_255 ), F_100 ));
637+ }
629638
630639 consumeWhitespace (vector , ctx );
631640
632641 token = parserutils_vector_iterate (vector , ctx );
633-
634642 }
635643
636644 if (!tokenIsChar (token , ')' ))
You can’t perform that action at this time.
0 commit comments