summaryrefslogtreecommitdiff
path: root/src/select/propget.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/propget.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/propget.h')
-rw-r--r--src/select/propget.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h
index 5552e39..6719443 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -1268,6 +1268,23 @@ static inline uint8_t get_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 uint8_t get_box_sizing(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->i.bits[BOX_SIZING_INDEX];
+ bits &= BOX_SIZING_MASK;
+ bits >>= BOX_SIZING_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+}
+#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