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/propset.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/propset.h')
-rw-r--r-- | src/select/propset.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/select/propset.h b/src/select/propset.h index b7da5a6..52d9d8a 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -25,7 +25,8 @@ static const css_computed_uncommon default_uncommon = { (CSS_CURSOR_INHERIT << 3) | (CSS_WRITING_MODE_INHERIT << 1) | 0, 0, 0, - (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL + (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL, + (CSS_COLUMN_COUNT_AUTO << 6) }, { 0, 0 }, { 0, 0, 0, 0 }, @@ -33,6 +34,7 @@ static const css_computed_uncommon default_uncommon = { 0, 0, 0, + 0, NULL, NULL, NULL, @@ -404,6 +406,30 @@ static inline css_error set_clip( #undef CLIP_SHIFT #undef CLIP_INDEX +#define COLUMN_COUNT_INDEX 8 +#define COLUMN_COUNT_SHIFT 6 +#define COLUMN_COUNT_MASK 0xc0 +static inline css_error set_column_count( + css_computed_style *style, uint8_t type, int32_t count) +{ + uint8_t *bits; + + ENSURE_UNCOMMON; + + bits = &style->uncommon->bits[COLUMN_COUNT_INDEX]; + + /* 2bits: tt : type */ + *bits = (*bits & ~COLUMN_COUNT_MASK) | + ((type & 0x3) << COLUMN_COUNT_SHIFT); + + style->uncommon->column_count = count; + + return CSS_OK; +} +#undef COLUMN_COUNT_MASK +#undef COLUMN_COUNT_SHIFT +#undef COLUMN_COUNT_INDEX + #define CONTENT_INDEX 7 #define CONTENT_SHIFT 0 #define CONTENT_MASK 0x3 |