Commit cadf6a9d authored by Benjamin Otte's avatar Benjamin Otte

cssnode: Add gtk_css_node_invalidate_style_provider()

This function not just invalidates the current node, but also all
children.
parent 16b8972b
......@@ -438,6 +438,9 @@ gtk_css_node_reposition (GtkCssNode *node,
{
gtk_css_node_parent_was_unset (node);
}
if (gtk_css_node_get_style_provider_or_null (node) == NULL)
gtk_css_node_invalidate_style_provider (node);
}
if (parent)
......@@ -736,6 +739,22 @@ gtk_css_node_get_declaration (GtkCssNode *cssnode)
return cssnode->decl;
}
void
gtk_css_node_invalidate_style_provider (GtkCssNode *cssnode)
{
GtkCssNode *child;
gtk_css_node_invalidate (cssnode, GTK_CSS_CHANGE_SOURCE);
for (child = cssnode->first_child;
child;
child = child->next_sibling)
{
if (gtk_css_node_get_style_provider_or_null (child) == NULL)
gtk_css_node_invalidate_style_provider (child);
}
}
void
gtk_css_node_invalidate (GtkCssNode *cssnode,
GtkCssChange change)
......
......@@ -139,6 +139,8 @@ void gtk_css_node_set_style (GtkCssNode *
GtkCssStyle *style);
GtkCssStyle * gtk_css_node_create_style (GtkCssNode *cssnode);
void gtk_css_node_invalidate_style_provider
(GtkCssNode *cssnode);
void gtk_css_node_invalidate (GtkCssNode *cssnode,
GtkCssChange change);
void gtk_css_node_validate (GtkCssNode *cssnode,
......
......@@ -289,7 +289,7 @@ static void
gtk_style_context_cascade_changed (GtkStyleCascade *cascade,
GtkStyleContext *context)
{
gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_SOURCE);
gtk_css_node_invalidate_style_provider (gtk_style_context_get_root (context));
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment