From bae45a3a08fb41d86725c51512c761a40ba305a2 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 10 Sep 2013 17:49:30 +0100 Subject: Add computed style accessor for writing-mode and and writing-mode to the property handler table. --- src/select/computed.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/select/computed.c') diff --git a/src/select/computed.c b/src/select/computed.c index 9f21d4a..059c76f 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -479,6 +479,27 @@ uint8_t css_computed_word_spacing( #undef CSS_WORD_SPACING_SHIFT #undef CSS_WORD_SPACING_INDEX +#define CSS_WRITING_MODE_INDEX 4 +#define CSS_WRITING_MODE_SHIFT 1 +#define CSS_WRITING_MODE_MASK 0x6 +uint8_t css_computed_writing_mode( + const css_computed_style *style) +{ + if (style->uncommon != NULL) { + uint8_t bits = style->uncommon->bits[CSS_WRITING_MODE_INDEX]; + bits &= CSS_WRITING_MODE_MASK; + bits >>= CSS_WRITING_MODE_SHIFT; + + /* 2bits: type */ + return bits; + } + + return CSS_WRITING_MODE_HORIZONTAL_TB; +} +#undef CSS_WRITING_MODE_MASK +#undef CSS_WRITING_MODE_SHIFT +#undef CSS_WRITING_MODE_INDEX + #define CSS_COUNTER_INCREMENT_INDEX 3 #define CSS_COUNTER_INCREMENT_SHIFT 1 #define CSS_COUNTER_INCREMENT_MASK 0x2 -- cgit v1.2.3