summaryrefslogtreecommitdiff
path: root/src/select/select.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-10 17:54:04 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-10 17:54:04 +0000
commitc5e6ed5429156f34a51434581e1639e5ebf182db (patch)
tree44b0f3b440bf5f154cec953ab12fe0d860128b74 /src/select/select.c
parent3caf569a9db0c852d7f149cf796d77ce3858cf32 (diff)
downloadlibcss-c5e6ed5429156f34a51434581e1639e5ebf182db.tar.gz
libcss-c5e6ed5429156f34a51434581e1639e5ebf182db.tar.bz2
Purge side bits. These cause more trouble than they're worth, and it's not as if there's a dearth of opcode space.
svn path=/trunk/libcss/; revision=6410
Diffstat (limited to 'src/select/select.c')
-rw-r--r--src/select/select.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/select/select.c b/src/select/select.c
index 21f3770..74db52f 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -50,14 +50,11 @@ typedef struct css_select_state {
uint32_t current_rule_index; /* Index of current rule */
uint32_t current_specificity; /* Specificity of current rule */
-/** \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 applicable stylesheet encountered, including
- * imports. Imported sheets' identities are below that of the sheet that
- * imported them. */
-#define N_PROPS (99)
+ /* Stylesheet identity is a monotonically increasing number based at 1
+ * and increasing by 1 for every applicable stylesheet encountered,
+ * including imports. Imported sheets' identities are below that of
+ * the sheet that imported them.
+ */
struct {
uint32_t specificity; /* Specificity of property in result */
uint32_t sheet; /* Identity of applicable stylesheet */
@@ -65,8 +62,7 @@ typedef struct css_select_state {
origin : 2, /* Origin of property in result */
important : 1, /* Importance of property in result */
index : 16;/* Index of corresponding rule */
- } props[N_PROPS];
-#undef N_PROPS
+ } props[N_OPCODES];
} css_select_state;
static css_error select_from_sheet(css_select_ctx *ctx,
@@ -104,7 +100,7 @@ static struct prop_table {
css_error (*initial)(css_computed_style *style);
uint32_t inherited : 1;
-} properties[] = {
+} properties[N_OPCODES] = {
{ cascade_azimuth, initial_azimuth, 1 },
{ cascade_background_attachment, initial_background_attachment, 0 },
{ cascade_background_color, initial_background_color, 0 },
@@ -113,9 +109,18 @@ static struct prop_table {
{ cascade_background_repeat, initial_background_repeat, 0 },
{ cascade_border_collapse, initial_border_collapse, 1 },
{ cascade_border_spacing, initial_border_spacing, 1 },
- { cascade_border_color, initial_border_color, 0 },
- { cascade_border_style, initial_border_style, 0 },
- { cascade_border_width, initial_border_width, 0 },
+ { cascade_border_top_color, initial_border_top_color, 0 },
+ { cascade_border_right_color, initial_border_right_color, 0 },
+ { cascade_border_bottom_color, initial_border_bottom_color, 0 },
+ { cascade_border_left_color, initial_border_left_color, 0 },
+ { cascade_border_top_style, initial_border_top_style, 0 },
+ { cascade_border_right_style, initial_border_right_style, 0 },
+ { cascade_border_bottom_style, initial_border_bottom_style, 0 },
+ { cascade_border_left_style, initial_border_left_style, 0 },
+ { cascade_border_top_width, initial_border_top_width, 0 },
+ { cascade_border_right_width, initial_border_right_width, 0 },
+ { cascade_border_bottom_width, initial_border_bottom_width, 0 },
+ { cascade_border_left_width, initial_border_left_width, 0 },
{ cascade_bottom, initial_bottom, 0 },
{ cascade_caption_side, initial_caption_side, 1 },
{ cascade_clear, initial_clear, 0 },
@@ -144,7 +149,10 @@ static struct prop_table {
{ cascade_list_style_image, initial_list_style_image, 1 },
{ cascade_list_style_position, initial_list_style_position, 1 },
{ cascade_list_style_type, initial_list_style_type, 1 },
- { cascade_margin, initial_margin, 0 },
+ { cascade_margin_top, initial_margin_top, 0 },
+ { cascade_margin_right, initial_margin_right, 0 },
+ { cascade_margin_bottom, initial_margin_bottom, 0 },
+ { cascade_margin_left, initial_margin_left, 0 },
{ cascade_max_height, initial_max_height, 0 },
{ cascade_max_width, initial_max_width, 0 },
{ cascade_min_height, initial_min_height, 0 },
@@ -154,7 +162,10 @@ static struct prop_table {
{ cascade_outline_style, initial_outline_style, 0 },
{ cascade_outline_width, initial_outline_width, 0 },
{ cascade_overflow, initial_overflow, 0 },
- { cascade_padding, initial_padding, 0 },
+ { cascade_padding_top, initial_padding_top, 0 },
+ { cascade_padding_right, initial_padding_right, 0 },
+ { cascade_padding_bottom, initial_padding_bottom, 0 },
+ { cascade_padding_left, initial_padding_left, 0 },
{ cascade_page_break_after, initial_page_break_after, 0 },
{ cascade_page_break_before, initial_page_break_before, 0 },
{ cascade_page_break_inside, initial_page_break_inside, 1 },