css: Give each style its own variable set

gtk_css_style_print relies on this to limit printing of custom
variables to each styles' own variables. Without this, :root
variables get printed for every single style that doesn't define
its own.
This commit is contained in:
Matthias Clasen 2024-05-19 23:11:29 -04:00
parent 858a3cbde5
commit f7a5cada1f

View File

@ -865,7 +865,9 @@ gtk_css_lookup_resolve (GtkCssLookup *lookup,
else if (parent_style && parent_style->variables)
{
g_clear_pointer (&style->variables, gtk_css_variable_set_unref);
style->variables = gtk_css_variable_set_ref (parent_style->variables);
style->variables = gtk_css_variable_set_new ();
gtk_css_variable_set_set_parent (style->variables,
parent_style->variables);
}
context.provider = provider;