From 24207928eb8ba5cc40db4ddd60c60866ec8af684 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 29 Dec 2014 18:20:48 +0000 Subject: Add break-before property support. --- src/select/propget.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/select/propget.h') diff --git a/src/select/propget.h b/src/select/propget.h index 756a7b3..93d96da 100644 --- a/src/select/propget.h +++ b/src/select/propget.h @@ -166,6 +166,28 @@ static inline uint8_t get_break_after( #undef BREAK_AFTER_SHIFT #undef BREAK_AFTER_INDEX +#define BREAK_BEFORE_INDEX 12 +#define BREAK_BEFORE_SHIFT 4 +#define BREAK_BEFORE_MASK (0xf << 4) +static inline uint8_t get_break_before( + const css_computed_style *style) +{ + if (style->uncommon != NULL) { + uint8_t bits = style->uncommon->bits[BREAK_BEFORE_INDEX]; + bits &= BREAK_BEFORE_MASK; + bits >>= BREAK_BEFORE_SHIFT; + + /* 4bits: type */ + return bits; + } + + /* Not inherited; initial value */ + return CSS_BREAK_BEFORE_AUTO; +} +#undef BREAK_BEFORE_MASK +#undef BREAK_BEFORE_SHIFT +#undef BREAK_BEFORE_INDEX + #define WORD_SPACING_INDEX 3 #define WORD_SPACING_SHIFT 2 #define WORD_SPACING_MASK 0xfc -- cgit v1.2.3