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 @@ -617,19 +617,27 @@ static bool parse_hsl(
617617 consumeWhitespace (vector , ctx );
618618
619619 token = parserutils_vector_iterate (vector , ctx );
620- if ((token == NULL ) || (token -> type != CSS_TOKEN_NUMBER ))
620+ if ((token == NULL ) ||
621+ (token -> type != CSS_TOKEN_NUMBER &&
622+ token -> type != CSS_TOKEN_PERCENTAGE )) {
621623 return false;
624+ }
622625
623626 alpha = css__number_from_lwc_string (token -> idata , false, & consumed );
624- if (consumed != lwc_string_length (token -> idata ))
625- return false; /* failed to consume the whole string as a number */
627+ if (consumed != lwc_string_length (token -> idata )) {
628+ /* failed to consume the whole string as a number */
629+ return false;
630+ }
626631
627- alpha = FIXTOINT (FMUL (alpha , F_255 ));
632+ if (token -> type != CSS_TOKEN_NUMBER ) {
633+ alpha = FIXTOINT (FMUL (alpha , F_255 ));
634+ } else {
635+ alpha = FIXTOINT (FDIV (FMUL (alpha , F_255 ), F_100 ));
636+ }
628637
629638 consumeWhitespace (vector , ctx );
630639
631640 token = parserutils_vector_iterate (vector , ctx );
632-
633641 }
634642
635643 if (!tokenIsChar (token , ')' ))
You can’t perform that action at this time.
0 commit comments