diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-12-06 15:34:27 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-12-06 16:45:34 +0000 |
commit | 0cab24ffcbe59104967362219f3c831c84681f7e (patch) | |
tree | 95ea3ae0ad34f8af7aa1d0468c46a8a4c9525492 /src/select/propset.h | |
parent | 2bbbe9050fb449276e6230ce0c2b0353d04b587c (diff) | |
download | libcss-0cab24ffcbe59104967362219f3c831c84681f7e.tar.gz libcss-0cab24ffcbe59104967362219f3c831c84681f7e.tar.bz2 |
Add column-width property to computed styles.
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 baac10b..769d3b3 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -30,7 +30,7 @@ static const css_computed_uncommon default_uncommon = { (CSS_COLUMN_RULE_STYLE_NONE << 0), (CSS_COLUMN_GAP_NORMAL << 2) | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR), (CSS_COLUMN_RULE_WIDTH_MEDIUM << 1), - (CSS_COLUMN_SPAN_NONE << 6) + (CSS_COLUMN_SPAN_NONE << 6) | CSS_COLUMN_WIDTH_AUTO }, { 0, 0 }, { 0, 0, 0, 0 }, @@ -42,6 +42,7 @@ static const css_computed_uncommon default_uncommon = { 0, 0, 0, + 0, NULL, NULL, NULL, @@ -578,6 +579,31 @@ static inline css_error set_column_span( #undef COLUMN_SPAN_SHIFT #undef COLUMN_SPAN_INDEX +#define COLUMN_WIDTH_INDEX 11 +#define COLUMN_WIDTH_SHIFT 0 +#define COLUMN_WIDTH_MASK 0x3f +static inline css_error set_column_width( + css_computed_style *style, uint8_t type, + css_fixed length, css_unit unit) +{ + uint8_t *bits; + + ENSURE_UNCOMMON; + + bits = &style->uncommon->bits[COLUMN_WIDTH_INDEX]; + + /* 6bits: uuuutt : units | type */ + *bits = (*bits & ~COLUMN_WIDTH_MASK) | + (((type & 0x3) | (unit << 2)) << COLUMN_WIDTH_SHIFT); + + style->uncommon->column_width = length; + + return CSS_OK; +} +#undef COLUMN_WIDTH_MASK +#undef COLUMN_WIDTH_SHIFT +#undef COLUMN_WIDTH_INDEX + #define CONTENT_INDEX 7 #define CONTENT_SHIFT 0 #define CONTENT_MASK 0x3 |