From 8d583fbe94b801353faec8e3a5a6729e3fe767a5 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 27 Apr 2017 11:57:37 +0100 Subject: Selection: Add support for the CSS3 box-sizing property. --- src/select/propset.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/select/propset.h') diff --git a/src/select/propset.h b/src/select/propset.h index 76e4fe6..3f4038c 100644 --- a/src/select/propset.h +++ b/src/select/propset.h @@ -1361,6 +1361,24 @@ static inline css_error set_background_attachment( #undef BACKGROUND_ATTACHMENT_SHIFT #undef BACKGROUND_ATTACHMENT_INDEX +#define BOX_SIZING_INDEX 34 +#define BOX_SIZING_SHIFT 0 +#define BOX_SIZING_MASK 0x3 +static inline css_error set_box_sizing( + css_computed_style *style, uint8_t type) +{ + uint8_t *bits = &style->i.bits[BOX_SIZING_INDEX]; + + /* 2bits: type */ + *bits = (*bits & ~BOX_SIZING_MASK) | + ((type & 0x3) << BOX_SIZING_SHIFT); + + return CSS_OK; +} +#undef BOX_SIZING_MASK +#undef BOX_SIZING_SHIFT +#undef BOX_SIZING_INDEX + #define BORDER_COLLAPSE_INDEX 13 #define BORDER_COLLAPSE_SHIFT 0 #define BORDER_COLLAPSE_MASK 0x3 -- cgit v1.2.3