summaryrefslogtreecommitdiff
path: root/src/select/propget.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-11-06 14:39:07 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-11-07 12:24:25 +0000
commitad85983173b7cf21c5b46f7fb3798afdb38e9fea (patch)
tree439979631b3b4de50be4eb7c93835030d75c54c0 /src/select/propget.h
parenta5c3cbf24c7112238643b58b346d6169ef904881 (diff)
downloadlibcss-ad85983173b7cf21c5b46f7fb3798afdb38e9fea.tar.gz
libcss-ad85983173b7cf21c5b46f7fb3798afdb38e9fea.tar.bz2
Implement selection for column-gap property.
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 7085eba..c450a45 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -386,6 +386,33 @@ static inline uint8_t get_column_fill(
#undef COLUMN_FILL_SHIFT
#undef COLUMN_FILL_INDEX
+#define COLUMN_GAP_INDEX 9
+#define COLUMN_GAP_SHIFT 2
+#define COLUMN_GAP_MASK 0xfc
+static inline uint8_t get_column_gap(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[COLUMN_GAP_INDEX];
+ bits &= COLUMN_GAP_MASK;
+ bits >>= COLUMN_GAP_SHIFT;
+
+ /* 6bits: uuuutt : units | type */
+ if ((bits & 0x3) == CSS_COLUMN_GAP_SET) {
+ *length = style->uncommon->column_gap;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ return CSS_COLUMN_GAP_NORMAL;
+}
+#undef COLUMN_GAP_MASK
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_INDEX
+
#define CONTENT_INDEX 7
#define CONTENT_SHIFT 0
#define CONTENT_MASK 0x3