summaryrefslogtreecommitdiff
path: root/gtk/gtkcssselectorprivate.h
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-01-26 04:37:17 +0100
committerBenjamin Otte <otte@redhat.com>2020-01-28 02:17:03 +0100
commit170130f1d9c15e4274a24b9327fe01d36ad84290 (patch)
tree0a07692fba8a8b378ed08095480b7e5885fc3dd1 /gtk/gtkcssselectorprivate.h
parent6aac56e144e1088565db7d29591fc0bd9e3e509d (diff)
downloadgtk+-170130f1d9c15e4274a24b9327fe01d36ad84290.tar.gz
css: Add fast-path for parent selector matching
Add a fast path for parent selector matching that uses a bloom filter to quickly discard selectors that can't possibly match. Keep in mind that we match using a bloom filter, so we might accidentally include too many selectors when hash/bucket collisions occur. That's not a correctness problem though, because we'll do a real check afterwards. The idea for this change is taken from browsers, in particular WebKit.
Diffstat (limited to 'gtk/gtkcssselectorprivate.h')
-rw-r--r--gtk/gtkcssselectorprivate.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gtk/gtkcssselectorprivate.h b/gtk/gtkcssselectorprivate.h
index 64a05b63f7..a1e265d5d2 100644
--- a/gtk/gtkcssselectorprivate.h
+++ b/gtk/gtkcssselectorprivate.h
@@ -18,6 +18,7 @@
#ifndef __GTK_CSS_SELECTOR_PRIVATE_H__
#define __GTK_CSS_SELECTOR_PRIVATE_H__
+#include "gtk/gtkcountingbloomfilterprivate.h"
#include "gtk/gtkcsstypesprivate.h"
#include "gtk/gtkcssparserprivate.h"
@@ -42,6 +43,7 @@ int _gtk_css_selector_compare (const GtkCssSelector *a,
void _gtk_css_selector_tree_free (GtkCssSelectorTree *tree);
GPtrArray * _gtk_css_selector_tree_match_all (const GtkCssSelectorTree *tree,
+ const GtkCountingBloomFilter *filter,
GtkCssNode *node);
GtkCssChange _gtk_css_selector_tree_get_change_all (const GtkCssSelectorTree *tree,
GtkCssNode *node);