diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-10-04 17:36:48 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-10-04 20:38:32 +0100 |
commit | 441735a225e7826615669a754b6bccf2b7d46ef4 (patch) | |
tree | 8234049cf11043b3218506df69a605ed52f329d1 /src/select/propget.h | |
parent | 55d72b3ce74fba72710076fb0cef53aa06b2cf65 (diff) | |
download | libcss-441735a225e7826615669a754b6bccf2b7d46ef4.tar.gz libcss-441735a225e7826615669a754b6bccf2b7d46ef4.tar.bz2 |
Cascade and compose column-count property into computed style.
Diffstat (limited to 'src/select/propget.h')
-rw-r--r-- | src/select/propget.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h index b124cfe..a9b8edc 100644 --- a/src/select/propget.h +++ b/src/select/propget.h @@ -342,6 +342,29 @@ static inline uint8_t get_clip( #undef CLIP_SHIFT #undef CLIP_INDEX +#define COLUMN_COUNT_INDEX 8 +#define COLUMN_COUNT_SHIFT 6 +#define COLUMN_COUNT_MASK 0xc0 +static inline uint8_t get_column_count( + const css_computed_style *style, int32_t *count) +{ + if (style->uncommon != NULL) { + uint8_t bits = style->uncommon->bits[COLUMN_COUNT_INDEX]; + bits &= COLUMN_COUNT_MASK; + bits >>= COLUMN_COUNT_SHIFT; + + /* 2bits: tt : type */ + *count = style->uncommon->column_count; + + return bits; + } + + return CSS_COLUMN_COUNT_AUTO; +} +#undef COLUMN_COUNT_MASK +#undef COLUMN_COUNT_SHIFT +#undef COLUMN_COUNT_INDEX + #define CONTENT_INDEX 7 #define CONTENT_SHIFT 0 #define CONTENT_MASK 0x3 |