From 3b1a80cbb138c9c714efc0f32729506060c78c81 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 4 Jul 2009 13:21:28 +0000 Subject: Move quotes property into common style block. svn path=/trunk/libcss/; revision=8307 --- src/select/computed.c | 8 ++++---- src/select/dispatch.c | 2 +- src/select/properties.c | 4 +--- src/select/propset.h | 46 +++++++++++++++++++++------------------------- 4 files changed, 27 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/select/computed.c b/src/select/computed.c index 7829b23..d8007c1 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -65,10 +65,7 @@ css_error css_computed_style_destroy(css_computed_style *style) style->alloc(style->uncommon->counter_reset, 0, style->pw); } - - if (style->uncommon->quotes != NULL) - style->alloc(style->uncommon->quotes, 0, style->pw); - + if (style->uncommon->cursor != NULL) style->alloc(style->uncommon->cursor, 0, style->pw); @@ -86,6 +83,9 @@ css_error css_computed_style_destroy(css_computed_style *style) if (style->font_family != NULL) style->alloc(style->font_family, 0, style->pw); + if (style->quotes != NULL) + style->alloc(style->quotes, 0, style->pw); + style->alloc(style, 0, style->pw); return CSS_OK; diff --git a/src/select/dispatch.c b/src/select/dispatch.c index 10eb0ed..c15465b 100644 --- a/src/select/dispatch.c +++ b/src/select/dispatch.c @@ -610,7 +610,7 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = { initial_quotes, compose_quotes, 1, - GROUP_UNCOMMON + GROUP_NORMAL }, { cascade_richness, diff --git a/src/select/properties.c b/src/select/properties.c index c607bf0..cb9ed02 100644 --- a/src/select/properties.c +++ b/src/select/properties.c @@ -4126,9 +4126,7 @@ css_error compose_quotes(const css_computed_style *parent, css_error error; lwc_string **quotes = NULL; - if ((child->uncommon == NULL && parent->uncommon != NULL) || - css_computed_quotes(child, "es) == - CSS_QUOTES_INHERIT) { + if (css_computed_quotes(child, "es) == CSS_QUOTES_INHERIT) { uint8_t p = css_computed_quotes(parent, "es); size_t n_quotes = 0; lwc_string **copy = NULL; diff --git a/src/select/propset.h b/src/select/propset.h index 743297b..c98d47b 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -241,31 +241,6 @@ static inline css_error set_cursor( #undef CURSOR_SHIFT #undef CURSOR_INDEX -#define QUOTES_INDEX 4 -#define QUOTES_SHIFT 2 -#define QUOTES_MASK 0x4 -static inline css_error set_quotes( - css_computed_style *style, uint8_t type, - lwc_string **quotes) -{ - uint8_t *bits; - - ENSURE_UNCOMMON; - - bits = &style->uncommon->bits[QUOTES_INDEX]; - - /* 1bit: type */ - *bits = (*bits & ~QUOTES_MASK) | - ((type & 0x1) << QUOTES_SHIFT); - - style->uncommon->quotes = quotes; - - return CSS_OK; -} -#undef QUOTES_MASK -#undef QUOTES_SHIFT -#undef QUOTES_INDEX - #define CLIP_INDEX 7 #define CLIP_SHIFT 2 #define CLIP_MASK 0xfc @@ -548,6 +523,27 @@ static inline css_error set_list_style_image( #undef LIST_STYLE_IMAGE_SHIFT #undef LIST_STYLE_IMAGE_INDEX +#define QUOTES_INDEX 5 +#define QUOTES_SHIFT 0 +#define QUOTES_MASK 0x1 +static inline css_error set_quotes( + css_computed_style *style, uint8_t type, + lwc_string **quotes) +{ + uint8_t *bits = &style->bits[QUOTES_INDEX]; + + /* 1bit: type */ + *bits = (*bits & ~QUOTES_MASK) | + ((type & 0x1) << QUOTES_SHIFT); + + style->quotes = quotes; + + return CSS_OK; +} +#undef QUOTES_MASK +#undef QUOTES_SHIFT +#undef QUOTES_INDEX + #define TOP_INDEX 6 #define TOP_SHIFT 2 #define TOP_MASK 0xfc -- cgit v1.2.3