From 758b01f92c0d8e1cdd966a5127e267efd0fe6391 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 22 Aug 2009 09:33:04 +0000 Subject: It turns out that using magic values for text-align is simpler than having an entirely new property for html alignment. svn path=/trunk/libcss/; revision=9387 --- src/select/propset.h | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) (limited to 'src/select/propset.h') diff --git a/src/select/propset.h b/src/select/propset.h index cc4121a..69dba45 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -1290,24 +1290,6 @@ static inline css_error set_position( #undef POSITION_SHIFT #undef POSITION_INDEX -#define TEXT_ALIGN_INDEX 23 -#define TEXT_ALIGN_SHIFT 0 -#define TEXT_ALIGN_MASK 0x7 -static inline css_error set_text_align( - css_computed_style *style, uint8_t type) -{ - uint8_t *bits = &style->bits[TEXT_ALIGN_INDEX]; - - /* 3bits: type */ - *bits = (*bits & ~TEXT_ALIGN_MASK) | - ((type & 0x7) << TEXT_ALIGN_SHIFT); - - return CSS_OK; -} -#undef TEXT_ALIGN_MASK -#undef TEXT_ALIGN_SHIFT -#undef TEXT_ALIGN_INDEX - #define TEXT_TRANSFORM_INDEX 24 #define TEXT_TRANSFORM_SHIFT 0 #define TEXT_TRANSFORM_MASK 0x7 @@ -1679,22 +1661,22 @@ static inline css_error set_list_style_position( #undef LIST_STYLE_POSITION_SHIFT #undef LIST_STYLE_POSITION_INDEX -#define LIBCSS_ALIGN_INDEX 33 -#define LIBCSS_ALIGN_SHIFT 1 -#define LIBCSS_ALIGN_MASK 0xe -static inline uint8_t set_libcss_align( +#define TEXT_ALIGN_INDEX 33 +#define TEXT_ALIGN_SHIFT 0 +#define TEXT_ALIGN_MASK 0xf +static inline uint8_t set_text_align( css_computed_style *style, uint8_t type) { - uint8_t *bits = &style->bits[LIBCSS_ALIGN_INDEX]; + uint8_t *bits = &style->bits[TEXT_ALIGN_INDEX]; - /* 3bits: type */ - *bits = (*bits & ~LIBCSS_ALIGN_MASK) | - ((type & 0x7) << LIBCSS_ALIGN_SHIFT); + /* 4bits: type */ + *bits = (*bits & ~TEXT_ALIGN_MASK) | + ((type & 0xf) << TEXT_ALIGN_SHIFT); return CSS_OK; } -#undef LIBCSS_ALIGN_MASK -#undef LIBCSS_ALIGN_SHIFT -#undef LIBCSS_ALIGN_INDEX +#undef TEXT_ALIGN_MASK +#undef TEXT_ALIGN_SHIFT +#undef TEXT_ALIGN_INDEX #endif -- cgit v1.2.3