[gtk/matthiasc/css-matching-4: 5/7] css: Add a root to the selector tree
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/css-matching-4: 5/7] css: Add a root to the selector tree
- Date: Tue, 21 Jan 2020 01:10:58 +0000 (UTC)
commit beae47edb1cf88d9e38e4d214988eee11cc319f6
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 19 23:29:47 2020 -0500
css: Add a root to the selector tree
Add a virtual root to the selector tree, and give
it an ANY selector in order to not affect matches.
This will make some of the following changes easier.
gtk/gtkcssselector.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index aabffb3e3e..9213298096 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -2249,9 +2249,18 @@ _gtk_css_selector_tree_builder_build (GtkCssSelectorTreeBuilder *builder)
guint len;
GList *l;
GtkCssSelectorRuleSetInfo *info;
+ gint32 tree_offset;
+ gint32 offset;
array = g_byte_array_new ();
- subdivide_infos (array, builder->infos, GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET);
+
+ tree = alloc_tree (array, &tree_offset);
+ tree->parent_offset = GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET;
+ tree->sibling_offset = GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET;
+ tree->matches_offset = GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET;
+ tree->selector.class = >K_CSS_SELECTOR_ANY;
+ offset = subdivide_infos (array, builder->infos, tree_offset);
+ get_tree (array, tree_offset)->previous_offset = offset;
len = array->len;
data = g_byte_array_free (array, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]