[gtk+/parser] css: Don't query type for regions



commit 2efdc471eb96bf5507564c90e9d152af088cac73
Author: Benjamin Otte <otte redhat com>
Date:   Mon May 16 04:31:07 2011 +0200

    css: Don't query type for regions
    
    Regions are regions and don't match by type.

 gtk/gtkcssselector.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index 799f3a0..3850a9e 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -21,6 +21,8 @@
 
 #include "gtkcssselectorprivate.h"
 
+#include "gtkstylecontextprivate.h"
+
 struct _GtkCssSelector
 {
   GtkCssSelector *  previous;        /* link to next element in selector or NULL if last */
@@ -48,7 +50,7 @@ _gtk_css_selector_new (GtkCssSelector         *previous,
   selector->previous = previous;
   selector->combine = combine;
   selector->name = name ? g_quark_to_string (g_quark_from_string (name)) : NULL;
-  selector->type = G_TYPE_INVALID;
+  selector->type = !name || _gtk_style_context_check_region_name (name) ? G_TYPE_NONE : G_TYPE_INVALID;
   selector->ids = ids;
   selector->classes = classes;
   selector->pseudo_classes = pseudo_classes;
@@ -190,6 +192,9 @@ gtk_css_selector_matches_type (const GtkCssSelector      *selector,
   if (selector->pseudo_classes)
     return FALSE;
 
+  if (selector->type == G_TYPE_NONE)
+    return FALSE;
+
   /* ugh, assigning to a const variable */
   if (selector->type == G_TYPE_INVALID)
     ((GtkCssSelector *) selector)->type = g_type_from_name (selector->name);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]