[gtk+/gtk-style-context: 171/191] GtkCssProvider: Don't jump too eagerly to the next element when comparing selectors.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 171/191] GtkCssProvider: Don't jump too eagerly to the next element when comparing selectors.
- Date: Tue, 17 Aug 2010 14:02:34 +0000 (UTC)
commit e18be212d8af4d7a8062bfc96d07d4b063cbf0e1
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Aug 4 11:43:18 2010 +0200
GtkCssProvider: Don't jump too eagerly to the next element when comparing selectors.
gtk/gtkcssprovider.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 798ef26..ebff9f3 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -442,7 +442,20 @@ compare_selector (GtkWidgetPath *path,
elem = elements->data;
match = compare_selector_element (path, i, elem, &elem_score);
- i++;
+
+ /* Only move on to the next index if there is no match
+ * with the current element (whether to continue or not
+ * handled right after in the combinator check), or a
+ * GType or glob has just been matched.
+ *
+ * Region and widget names do not trigger this because
+ * the next element in the selector path could also be
+ * related to the same index.
+ */
+ if (!match ||
+ (elem->elem_type == SELECTOR_GTYPE ||
+ elem->elem_type == SELECTOR_GLOB))
+ i++;
if (!match &&
elem->elem_type != SELECTOR_TYPE_NAME &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]