cssshadowvalue: Add a parsing function

Add a variant of the parse function that parses
just a single (non-box) shadow, as required for
the drop-shadow filter.
This commit is contained in:
Matthias Clasen 2021-02-05 21:36:22 -05:00
parent 5b8896f1db
commit be3f352b59

View File

@ -514,19 +514,14 @@ fail:
} }
GtkCssValue * GtkCssValue *
_gtk_css_shadow_value_parse_filter (GtkCssParser *parser) gtk_css_shadow_value_parse_filter (GtkCssParser *parser)
{ {
GtkCssValue *result; ShadowValue shadow;
result = _gtk_css_shadow_value_parse (parser, FALSE); if (gtk_css_shadow_value_parse_one (parser, FALSE, &shadow))
return gtk_css_shadow_value_new (&shadow, 1);
if (result && result->n_shadows != 1) else
{ return NULL;
gtk_css_parser_error_syntax (parser, "A single shadow is required");
g_clear_pointer (&result, gtk_css_value_unref);
}
return result;
} }
void void