summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-07 23:11:22 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-07 23:11:22 +0000
commit2cf6bb98e8a36c45d540c59446b2f727e5417759 (patch)
tree329a073adf930b8fb89a179b9f060dcbd81447e6 /src
parent48d148e03f8033c88c733db9c5ff3f5aa2788c09 (diff)
downloadlibcss-2cf6bb98e8a36c45d540c59446b2f727e5417759.tar.gz
libcss-2cf6bb98e8a36c45d540c59446b2f727e5417759.tar.bz2
Further tweaks. We need to know the <sheet,rule> pair from which a property got set so that we can determine whether a subsequently defined rule overrides it.
svn path=/trunk/libcss/; revision=6395
Diffstat (limited to 'src')
-rw-r--r--src/select/select.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/select/select.c b/src/select/select.c
index 4719377..aa112e4 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -40,12 +40,18 @@ typedef 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 */
+/* Stylesheet identity is a monotonically increasing number based at 1 and
+ * increasing by 1 for every stylesheet encountered, including imports.
+ * Imported sheets' identities are below that of the sheet that imported
+ * them. */
#define N_PROPS (99)
struct {
uint32_t specificity; /* Specificity of property in result */
+ uint32_t sheet; /* Identity of applicable stylesheet */
uint32_t set : 1, /* Whether property is set in result */
origin : 2, /* Origin of property in result */
- important : 1; /* Importance of property in result */
+ important : 1, /* Importance of property in result */
+ index : 16;/* Index of corresponding rule */
} props[N_PROPS];
#undef N_PROPS
} css_select_state;
@@ -319,7 +325,7 @@ css_error select_from_sheet(css_select_ctx *ctx, const css_stylesheet *sheet,
rule = rule->next;
}
- /** \todo Finally, process the rest of the rules */
+ /** \todo Finally, process the selectors in this sheet */
return CSS_OK;
}