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/propset.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/select/propset.h') diff --git a/src/select/propset.h b/src/select/propset.h index c202ce7..d5db8e0 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -220,6 +220,28 @@ static inline css_error set_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 css_error set_break_before( + css_computed_style *style, uint8_t type) +{ + uint8_t *bits; + + ENSURE_UNCOMMON; + + bits = &style->uncommon->bits[BREAK_BEFORE_INDEX]; + + /* 4bits: type */ + *bits = (*bits & ~BREAK_BEFORE_MASK) | + ((type & 0xf) << BREAK_BEFORE_SHIFT); + + return CSS_OK; +} +#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