summaryrefslogtreecommitdiff
path: root/src/select/propget.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-12-06 15:34:27 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-12-06 16:45:34 +0000
commit0cab24ffcbe59104967362219f3c831c84681f7e (patch)
tree95ea3ae0ad34f8af7aa1d0468c46a8a4c9525492 /src/select/propget.h
parent2bbbe9050fb449276e6230ce0c2b0353d04b587c (diff)
downloadlibcss-0cab24ffcbe59104967362219f3c831c84681f7e.tar.gz
libcss-0cab24ffcbe59104967362219f3c831c84681f7e.tar.bz2
Add column-width property to computed styles.
Diffstat (limited to 'src/select/propget.h')
-rw-r--r--src/select/propget.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h
index 7be323e..08ed0f4 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -507,6 +507,33 @@ static inline uint8_t get_column_span(
#undef COLUMN_SPAN_SHIFT
#undef COLUMN_SPAN_INDEX
+#define COLUMN_WIDTH_INDEX 11
+#define COLUMN_WIDTH_SHIFT 0
+#define COLUMN_WIDTH_MASK 0x3f
+static inline uint8_t get_column_width(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_WIDTH_INDEX];
+ bits &= COLUMN_WIDTH_MASK;
+ bits >>= COLUMN_WIDTH_SHIFT;
+
+ /* 6bits: uuuutt : units | type */
+ if ((bits & 0x3) == CSS_COLUMN_WIDTH_SET) {
+ *length = style->uncommon->column_width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ return CSS_COLUMN_WIDTH_AUTO;
+}
+#undef COLUMN_WIDTH_MASK
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3