summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-07 03:02:15 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-07 03:02:15 +0000
commit9a34b393f0581b04da414196237a912efabad652 (patch)
treeb5abe527d10927c3c4e4d0eb45ec52906d125c33
parent81a449399607a98b7c87890aea4a2eff03498050 (diff)
downloadlibcss-9a34b393f0581b04da414196237a912efabad652.tar.gz
libcss-9a34b393f0581b04da414196237a912efabad652.tar.bz2
Fix build.
Sketch out a struct containing the state needed during selection. We need to know the specificity, origin, and importance of the source of the current property value. We also need to know whether the property has been set at all (as this is not available by simply inspecting the computed style struct). svn path=/trunk/libcss/; revision=6391
-rw-r--r--src/select/select.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/select/select.c b/src/select/select.c
index dbf5d01..5f9da4a 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -7,10 +7,10 @@
#include <string.h>
+#include <libcss/computed.h>
#include <libcss/select.h>
#include "stylesheet.h"
-#include "select/computed.h"
#include "select/hash.h"
#include "select/propset.h"
#include "utils/utils.h"
@@ -28,6 +28,23 @@ struct css_select_ctx {
};
/**
+ * State for each property during selection
+ */
+struct css_select_state {
+/** \todo We need a better way of knowing the number of properties
+ * Bytecode opcodes cover 84 properties, then there's a
+ * further 15 generated from the side bits */
+#define N_PROPS (99)
+ struct {
+ uint32_t specificity; /* Specificity of property in result */
+ uint32_t set : 1, /* Whether property is set in result */
+ origin : 2, /* Origin of property in result */
+ important : 1; /* Importance of property in result */
+ } props[N_PROPS];
+#undef N_PROPS
+};
+
+/**
* Create a selection context
*
* \param alloc Memory (de)allocation function