[gtk/matthiasc/css-change: 15/15] css: Small cleanup for the superset matcher



commit 81ac5e1f1fda2c45bd48428dfecad6a0cc61e39f
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 15 17:40:34 2020 -0500

    css: Small cleanup for the superset matcher
    
    Don't lump name and id together here, we have separate
    change flags, after all. Update the only caller to
    pass GTK_CSS_CHANGE_ID as well.

 gtk/gtkcssmatcher.c  | 9 +++++++--
 gtk/gtkcssprovider.c | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c
index 536adf8b6b..d9cfc30567 100644
--- a/gtk/gtkcssmatcher.c
+++ b/gtk/gtkcssmatcher.c
@@ -532,7 +532,12 @@ _gtk_css_matcher_superset_init (GtkCssMatcher       *matcher,
                                 GtkCssChange         relevant)
 {
   g_return_if_fail (subset != NULL);
-  g_return_if_fail ((relevant & ~(GTK_CSS_CHANGE_CLASS | GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_POSITION | 
GTK_CSS_CHANGE_STATE | GTK_CSS_CHANGE_HOVER)) == 0);
+  g_return_if_fail ((relevant & ~(GTK_CSS_CHANGE_CLASS |
+                                  GTK_CSS_CHANGE_NAME |
+                                  GTK_CSS_CHANGE_ID |
+                                  GTK_CSS_CHANGE_POSITION |
+                                  GTK_CSS_CHANGE_STATE |
+                                  GTK_CSS_CHANGE_HOVER)) == 0);
 
   switch (subset->klass->type)
     {
@@ -556,7 +561,7 @@ _gtk_css_matcher_superset_init (GtkCssMatcher       *matcher,
     klass->has_class = subset->klass->has_class;
   if (relevant & GTK_CSS_CHANGE_NAME)
     klass->has_name = subset->klass->has_name;
-  if (relevant & GTK_CSS_CHANGE_NAME)
+  if (relevant & GTK_CSS_CHANGE_ID)
     klass->has_id = subset->klass->has_id;
   if (relevant & GTK_CSS_CHANGE_POSITION)
     klass->has_position = subset->klass->has_position;
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 077b14f71c..13bdc6479c 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -537,7 +537,7 @@ gtk_css_style_provider_lookup (GtkStyleProvider    *provider,
       GtkCssMatcher change_matcher;
       GtkCssMatcherClass matcher_class;
 
-      _gtk_css_matcher_superset_init (&change_matcher, matcher, &matcher_class, GTK_CSS_CHANGE_CLASS | 
GTK_CSS_CHANGE_NAME);
+      _gtk_css_matcher_superset_init (&change_matcher, matcher, &matcher_class, GTK_CSS_CHANGE_CLASS | 
GTK_CSS_CHANGE_NAME | GTK_CSS_CHANGE_ID);
 
       *change = get_change (css_provider, &change_matcher);
     }


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