cssprovider: Don't add empty rulesets

This change was lost during the parser changes, but the newly added test
exposes it.

And fix the expected error, the syntax has changed.
This commit is contained in:
Benjamin Otte 2019-11-23 19:01:28 +01:00
parent fd1630e049
commit 7523a3f2f2
2 changed files with 7 additions and 1 deletions

View File

@ -631,6 +631,12 @@ css_provider_commit (GtkCssProvider *css_provider,
GtkCssProviderPrivate *priv = gtk_css_provider_get_instance_private (css_provider);
GSList *l;
if (ruleset->styles == NULL)
{
g_slist_free_full (selectors, (GDestroyNotify) _gtk_css_selector_free);
return;
}
for (l = selectors; l; l = l->next)
{
GtkCssRuleset new;

View File

@ -1 +1 @@
border-crash-3.24.css:3: error: GTK_CSS_PROVIDER_ERROR_SYNTAX
border-crash-3.24.css:3:3-10: error: GTK_CSS_PARSER_ERROR_SYNTAX