diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-11-06 14:39:07 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-11-07 12:24:25 +0000 |
commit | ad85983173b7cf21c5b46f7fb3798afdb38e9fea (patch) | |
tree | 439979631b3b4de50be4eb7c93835030d75c54c0 /src/select/propset.h | |
parent | a5c3cbf24c7112238643b58b346d6169ef904881 (diff) | |
download | libcss-ad85983173b7cf21c5b46f7fb3798afdb38e9fea.tar.gz libcss-ad85983173b7cf21c5b46f7fb3798afdb38e9fea.tar.bz2 |
Implement selection for column-gap property.
Diffstat (limited to 'src/select/propset.h')
-rw-r--r-- | src/select/propset.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/select/propset.h b/src/select/propset.h index 23d8076..acb2817 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -26,7 +26,8 @@ static const css_computed_uncommon default_uncommon = { 0, 0, (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL, - (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4) + (CSS_COLUMN_COUNT_AUTO << 6) | (CSS_COLUMN_FILL_BALANCE << 4), + (CSS_COLUMN_GAP_NORMAL << 2) }, { 0, 0 }, { 0, 0, 0, 0 }, @@ -35,6 +36,7 @@ static const css_computed_uncommon default_uncommon = { 0, 0, 0, + 0, NULL, NULL, NULL, @@ -452,6 +454,31 @@ static inline css_error set_column_fill( #undef COLUMN_FILL_SHIFT #undef COLUMN_FILL_INDEX +#define COLUMN_GAP_INDEX 9 +#define COLUMN_GAP_SHIFT 2 +#define COLUMN_GAP_MASK 0xfc +static inline css_error set_column_gap( + css_computed_style *style, uint8_t type, + css_fixed length, css_unit unit) +{ + uint8_t *bits; + + ENSURE_UNCOMMON; + + bits = &style->uncommon->bits[COLUMN_GAP_INDEX]; + + /* 6bits: uuuutt : units | type */ + *bits = (*bits & ~COLUMN_GAP_MASK) | + (((type & 0x3) | (unit << 2)) << COLUMN_GAP_SHIFT); + + style->uncommon->column_gap = length; + + return CSS_OK; +} +#undef COLUMN_GAP_MASK +#undef COLUMN_GAP_SHIFT +#undef COLUMN_GAP_INDEX + #define CONTENT_INDEX 7 #define CONTENT_SHIFT 0 #define CONTENT_MASK 0x3 |