summaryrefslogtreecommitdiff
path: root/src/select/propget.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-12-29 18:21:21 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-12-29 19:06:20 +0000
commit4729e025decd4d92ceeeb40659decf6183594ac6 (patch)
tree0e6499556d4bb8a6d22c4219fcc13d49272b69dd /src/select/propget.h
parent24207928eb8ba5cc40db4ddd60c60866ec8af684 (diff)
downloadlibcss-4729e025decd4d92ceeeb40659decf6183594ac6.tar.gz
libcss-4729e025decd4d92ceeeb40659decf6183594ac6.tar.bz2
Add break-inside property support.
Diffstat (limited to 'src/select/propget.h')
-rw-r--r--src/select/propget.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/select/propget.h b/src/select/propget.h
index 93d96da..45c773f 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -188,6 +188,28 @@ static inline uint8_t get_break_before(
#undef BREAK_BEFORE_SHIFT
#undef BREAK_BEFORE_INDEX
+#define BREAK_INSIDE_INDEX 13
+#define BREAK_INSIDE_SHIFT 4
+#define BREAK_INSIDE_MASK (0xf << 4)
+static inline uint8_t get_break_inside(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[BREAK_INSIDE_INDEX];
+ bits &= BREAK_INSIDE_MASK;
+ bits >>= BREAK_INSIDE_SHIFT;
+
+ /* 4bits: type */
+ return bits;
+ }
+
+ /* Not inherited; initial value */
+ return CSS_BREAK_INSIDE_AUTO;
+}
+#undef BREAK_INSIDE_MASK
+#undef BREAK_INSIDE_SHIFT
+#undef BREAK_INSIDE_INDEX
+
#define WORD_SPACING_INDEX 3
#define WORD_SPACING_SHIFT 2
#define WORD_SPACING_MASK 0xfc