summaryrefslogtreecommitdiff
path: root/src/select/propset.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-08-22 09:33:04 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-08-22 09:33:04 +0000
commit758b01f92c0d8e1cdd966a5127e267efd0fe6391 (patch)
treeadcb0d6e0a09c2745630ac2520416da513d1eb03 /src/select/propset.h
parent64ffb54faffc493ff1cd35943a89d62d08183317 (diff)
downloadlibcss-758b01f92c0d8e1cdd966a5127e267efd0fe6391.tar.gz
libcss-758b01f92c0d8e1cdd966a5127e267efd0fe6391.tar.bz2
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
Diffstat (limited to 'src/select/propset.h')
-rw-r--r--src/select/propset.h40
1 files changed, 11 insertions, 29 deletions
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