cssnode: Treat transient nodes as invisible nodes

Making transient nodes invisible allows us to remove special cases
without any bad side effects and they continue working just like they
did before.
This commit is contained in:
Benjamin Otte 2015-02-13 12:44:04 +01:00
parent 2670ae4436
commit 9b73b39f9a
2 changed files with 1 additions and 11 deletions

View File

@ -20,7 +20,6 @@
#include "gtkcssnodeprivate.h" #include "gtkcssnodeprivate.h"
#include "gtkcssanimatedstyleprivate.h" #include "gtkcssanimatedstyleprivate.h"
#include "gtkcsstransientnodeprivate.h"
#include "gtkdebug.h" #include "gtkdebug.h"
#include "gtksettingsprivate.h" #include "gtksettingsprivate.h"
@ -37,9 +36,6 @@ gtk_css_node_set_invalid (GtkCssNode *node,
if (node->invalid == invalid) if (node->invalid == invalid)
return; return;
if (GTK_IS_CSS_TRANSIENT_NODE (node))
return;
node->invalid = invalid; node->invalid = invalid;
if (node->parent) if (node->parent)
@ -56,7 +52,6 @@ gtk_css_node_set_invalid (GtkCssNode *node,
} }
} }
static void static void
gtk_css_node_dispose (GObject *object) gtk_css_node_dispose (GObject *object)
{ {
@ -364,9 +359,6 @@ gtk_css_node_parent_will_be_set (GtkCssNode *node)
static void static void
gtk_css_node_unlink_from_siblings (GtkCssNode *node) gtk_css_node_unlink_from_siblings (GtkCssNode *node)
{ {
if (GTK_IS_CSS_TRANSIENT_NODE (node))
return;
if (node->previous_sibling) if (node->previous_sibling)
node->previous_sibling->next_sibling = node->next_sibling; node->previous_sibling->next_sibling = node->next_sibling;
else else
@ -385,9 +377,6 @@ static void
gtk_css_node_link_to_siblings (GtkCssNode *node, gtk_css_node_link_to_siblings (GtkCssNode *node,
GtkCssNode *new_previous) GtkCssNode *new_previous)
{ {
if (GTK_IS_CSS_TRANSIENT_NODE (node))
return;
if (new_previous) if (new_previous)
{ {
node->previous_sibling = new_previous; node->previous_sibling = new_previous;

View File

@ -64,6 +64,7 @@ gtk_css_transient_node_class_init (GtkCssTransientNodeClass *klass)
static void static void
gtk_css_transient_node_init (GtkCssTransientNode *cssnode) gtk_css_transient_node_init (GtkCssTransientNode *cssnode)
{ {
gtk_css_node_set_visible (GTK_CSS_NODE (cssnode), FALSE);
} }
GtkCssNode * GtkCssNode *