[gtk+] cssselector: Redo change verification
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssselector: Redo change verification
- Date: Wed, 10 Dec 2014 03:05:55 +0000 (UTC)
commit e2dddd62cf28edefddb5d2d2585d16a75e392c56
Author: Benjamin Otte <otte redhat com>
Date: Tue Dec 9 03:21:13 2014 +0100
cssselector: Redo change verification
Instead of walking the selector tree, we walk the selectors.
gtk/gtkcssprovider.c | 2 +-
gtk/gtkcssselector.c | 25 ++++++++-----------------
gtk/gtkcssselectorprivate.h | 2 +-
3 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index daadf04..6b02bef 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1646,7 +1646,7 @@ verify_tree_get_change_results (GtkCssProvider *provider,
ruleset = tree_rules->pdata[i];
- verify_change |= _gtk_css_selector_tree_match_get_change (ruleset->selector_match);
+ verify_change |= _gtk_css_selector_get_change (ruleset->selector);
}
if (change != verify_change)
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index 9d629dd..fb2b7c2 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -1744,23 +1744,6 @@ _gtk_css_selector_to_string (const GtkCssSelector *selector)
return g_string_free (string, FALSE);
}
-
-GtkCssChange
-_gtk_css_selector_tree_match_get_change (const GtkCssSelectorTree *tree)
-{
- GtkCssChange change = 0;
-
- update_type_references ();
-
- while (tree)
- {
- change = tree->selector.class->get_change (&tree->selector, change);
- tree = gtk_css_selector_tree_get_parent (tree);
- }
-
- return change;
-}
-
static gboolean
gtk_css_selector_foreach_match (const GtkCssSelector *selector,
const GtkCssMatcher *matcher,
@@ -1843,6 +1826,14 @@ _gtk_css_selector_compare (const GtkCssSelector *a,
return a_elements - b_elements;
}
+GtkCssChange
+_gtk_css_selector_get_change (const GtkCssSelector *selector)
+{
+ if (selector == NULL)
+ return 0;
+
+ return selector->class->get_change (selector, _gtk_css_selector_get_change (gtk_css_selector_previous
(selector)));
+}
/******************** SelectorTree handling *****************/
diff --git a/gtk/gtkcssselectorprivate.h b/gtk/gtkcssselectorprivate.h
index af95b54..e23ae09 100644
--- a/gtk/gtkcssselectorprivate.h
+++ b/gtk/gtkcssselectorprivate.h
@@ -36,6 +36,7 @@ void _gtk_css_selector_print (const GtkCssSelector *sel
gboolean _gtk_css_selector_matches (const GtkCssSelector *selector,
const GtkCssMatcher *matcher);
+GtkCssChange _gtk_css_selector_get_change (const GtkCssSelector *selector);
int _gtk_css_selector_compare (const GtkCssSelector *a,
const GtkCssSelector *b);
@@ -46,7 +47,6 @@ GtkCssChange _gtk_css_selector_tree_get_change_all (const GtkCssSelectorTree *
const GtkCssMatcher *matcher);
void _gtk_css_selector_tree_match_print (const GtkCssSelectorTree *tree,
GString *str);
-GtkCssChange _gtk_css_selector_tree_match_get_change (const GtkCssSelectorTree *tree);
GtkCssSelectorTreeBuilder *_gtk_css_selector_tree_builder_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]