summaryrefslogtreecommitdiff
path: root/src/select/propset.h
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-04-27 11:57:37 +0100
committerMichael Drake <michael.drake@codethink.co.uk>2017-04-27 11:57:37 +0100
commit8d583fbe94b801353faec8e3a5a6729e3fe767a5 (patch)
tree76f7e72bbf31a9adf3271f0d95672e41eec2802a /src/select/propset.h
parent24f23765517bd02445835dd543a07b1a883ca316 (diff)
downloadlibcss-8d583fbe94b801353faec8e3a5a6729e3fe767a5.tar.gz
libcss-8d583fbe94b801353faec8e3a5a6729e3fe767a5.tar.bz2
Selection: Add support for the CSS3 box-sizing property.
Diffstat (limited to 'src/select/propset.h')
-rw-r--r--src/select/propset.h18
1 files changed, 18 insertions, 0 deletions
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