Commit d3c60cc8 authored by Benjamin Otte's avatar Benjamin Otte

css: Don't query type for regions

Regions are regions and don't match by type.
parent 14006440
......@@ -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);
......
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