summaryrefslogtreecommitdiff
path: root/src/select/select.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2011-11-04 20:04:16 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2011-11-04 20:04:16 +0000
commit38655376dbf2e3b6d91e70bb67f9ea1db00a533e (patch)
tree5cdbbd3708a5e0ed56aaf3a0bae326e828271c2b /src/select/select.h
parent041ad8f5ae9d25242a6d39ea8bfc860bc55b0167 (diff)
downloadlibcss-38655376dbf2e3b6d91e70bb67f9ea1db00a533e.tar.gz
libcss-38655376dbf2e3b6d91e70bb67f9ea1db00a533e.tar.bz2
Cache rejected ancestor class/ID selectors to improve selection efficiency
svn path=/trunk/libcss/; revision=13118
Diffstat (limited to 'src/select/select.h')
-rw-r--r--src/select/select.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/select/select.h b/src/select/select.h
index 3cdeae3..36e2eda 100644
--- a/src/select/select.h
+++ b/src/select/select.h
@@ -15,6 +15,14 @@
#include "stylesheet.h"
+/**
+ * Item in the reject cache (only class and id types are valid)
+ */
+typedef struct reject_item {
+ lwc_string *value;
+ css_selector_type type;
+} reject_item;
+
typedef struct prop_state {
uint32_t specificity; /* Specificity of property in result */
unsigned int set : 1, /* Whether property is set in result */
@@ -47,6 +55,9 @@ typedef struct css_select_state {
lwc_string **classes; /* Node classes, if any */
uint32_t n_classes; /* Number of classes */
+ reject_item reject_cache[128]; /* Reject cache */
+ reject_item *next_reject; /* Next free slot in reject cache */
+
prop_state props[CSS_N_PROPERTIES][CSS_PSEUDO_ELEMENT_COUNT];
} css_select_state;