From 34271c0f32bca359af8f7a6c40f166d402b78eb6 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 16 Nov 2014 15:18:00 +0000 Subject: Add column-rule-width to computed styles. --- src/select/propget.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/select/propget.h') diff --git a/src/select/propget.h b/src/select/propget.h index 4ced8bb..423e299 100644 --- a/src/select/propget.h +++ b/src/select/propget.h @@ -459,6 +459,33 @@ static inline uint8_t get_column_rule_style( #undef COLUMN_RULE_STYLE_SHIFT #undef COLUMN_RULE_STYLE_INDEX +#define COLUMN_RULE_WIDTH_INDEX 10 +#define COLUMN_RULE_WIDTH_SHIFT 1 +#define COLUMN_RULE_WIDTH_MASK 0xfe +static inline uint8_t get_column_rule_width( + const css_computed_style *style, + css_fixed *length, css_unit *unit) +{ + if (style->uncommon != NULL) { + uint8_t bits = style->uncommon->bits[COLUMN_RULE_WIDTH_INDEX]; + bits &= COLUMN_RULE_WIDTH_MASK; + bits >>= COLUMN_RULE_WIDTH_SHIFT; + + /* 7bits: uuuuttt : units | type */ + if ((bits & 0x7) == CSS_COLUMN_RULE_WIDTH_WIDTH) { + *length = style->uncommon->column_rule_width; + *unit = bits >> 3; + } + + return (bits & 0x7); + } + + return CSS_COLUMN_RULE_WIDTH_MEDIUM; +} +#undef COLUMN_RULE_WIDTH_MASK +#undef COLUMN_RULE_WIDTH_SHIFT +#undef COLUMN_RULE_WIDTH_INDEX + #define CONTENT_INDEX 7 #define CONTENT_SHIFT 0 #define CONTENT_MASK 0x3 -- cgit v1.2.3