summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnode.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/gtkcssnode.c')
-rw-r--r--gtk/gtkcssnode.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 0b88b916dd..8f1e4d9df5 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -741,27 +741,35 @@ gtk_css_node_set_parent (GtkCssNode *node,
}
void
-gtk_css_node_set_after (GtkCssNode *cssnode,
- GtkCssNode *previous_sibling)
+gtk_css_node_insert_after (GtkCssNode *parent,
+ GtkCssNode *cssnode,
+ GtkCssNode *previous_sibling)
{
- if (cssnode->previous_sibling == previous_sibling)
+ g_return_if_fail (previous_sibling == NULL || previous_sibling->parent == parent);
+
+ if (cssnode->previous_sibling == previous_sibling &&
+ cssnode->parent == parent)
return;
gtk_css_node_reposition (cssnode,
- previous_sibling->parent,
+ parent,
previous_sibling);
}
void
-gtk_css_node_set_before (GtkCssNode *cssnode,
- GtkCssNode *next_sibling)
+gtk_css_node_insert_before (GtkCssNode *parent,
+ GtkCssNode *cssnode,
+ GtkCssNode *next_sibling)
{
- if (cssnode->next_sibling == next_sibling)
+ g_return_if_fail (next_sibling == NULL || next_sibling->parent == parent);
+
+ if (cssnode->next_sibling == next_sibling &&
+ cssnode->parent == parent)
return;
gtk_css_node_reposition (cssnode,
- next_sibling->parent,
- next_sibling->previous_sibling);
+ parent,
+ next_sibling ? next_sibling->previous_sibling : parent->last_child);
}
GtkCssNode *