From 2cf6bb98e8a36c45d540c59446b2f727e5417759 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 7 Feb 2009 23:11:22 +0000 Subject: Further tweaks. We need to know the 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 --- src/select/select.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3