summaryrefslogtreecommitdiff
path: root/src/select/propget.h
diff options
context:
space:
mode:
authorCaitlin Potter <snowball@defpixel.com>2013-09-10 17:44:53 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2013-09-10 17:44:53 +0100
commitbc9c80c2dbf21d805f5372aea3df14d310a1512c (patch)
tree990fab4a6a72e7ddea5f12da20329412da5006b6 /src/select/propget.h
parent2234cab352b0ef702b32aaa7ef433c4793086824 (diff)
downloadlibcss-bc9c80c2dbf21d805f5372aea3df14d310a1512c.tar.gz
libcss-bc9c80c2dbf21d805f5372aea3df14d310a1512c.tar.bz2
Add support for parsing the writing-mode property. Thanks to Caitlin Potter.
Diffstat (limited to 'src/select/propget.h')
-rw-r--r--src/select/propget.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h
index 41f6315..16b8fc2 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -174,6 +174,25 @@ static inline uint8_t get_word_spacing(
#undef WORD_SPACING_SHIFT
#undef WORD_SPACING_INDEX
+#define WRITING_MODE_INDEX 4
+#define WRITING_MODE_MASK 0x6
+#define WRITING_MODE_SHIFT 1
+static inline uint8_t get_writing_mode(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[WRITING_MODE_INDEX];
+ bits &= WRITING_MODE_MASK;
+ bits >>= WRITING_MODE_SHIFT;
+ return bits;
+ }
+
+ return CSS_WRITING_MODE_HORIZONTAL_TB;
+}
+#undef WRITING_MODE_INDEX
+#undef WRITING_MODE_MASK
+#undef WRITING_MODE_SHIFT
+
#define COUNTER_INCREMENT_INDEX 3
#define COUNTER_INCREMENT_SHIFT 1
#define COUNTER_INCREMENT_MASK 0x2