summaryrefslogtreecommitdiff
path: root/src/select/propget.h
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-12-29 18:20:48 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2014-12-29 19:06:20 +0000
commit24207928eb8ba5cc40db4ddd60c60866ec8af684 (patch)
tree76dc8a7402a6cc4613cef5c2d61c2f5377a8c89e /src/select/propget.h
parent30833a1ad59bc1f20a4995b23d2794be17227b51 (diff)
downloadlibcss-24207928eb8ba5cc40db4ddd60c60866ec8af684.tar.gz
libcss-24207928eb8ba5cc40db4ddd60c60866ec8af684.tar.bz2
Add break-before 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 756a7b3..93d96da 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -166,6 +166,28 @@ static inline uint8_t get_break_after(
#undef BREAK_AFTER_SHIFT
#undef BREAK_AFTER_INDEX
+#define BREAK_BEFORE_INDEX 12
+#define BREAK_BEFORE_SHIFT 4
+#define BREAK_BEFORE_MASK (0xf << 4)
+static inline uint8_t get_break_before(
+ const css_computed_style *style)
+{
+ if (style->uncommon != NULL) {
+ uint8_t bits = style->uncommon->bits[BREAK_BEFORE_INDEX];
+ bits &= BREAK_BEFORE_MASK;
+ bits >>= BREAK_BEFORE_SHIFT;
+
+ /* 4bits: type */
+ return bits;
+ }
+
+ /* Not inherited; initial value */
+ return CSS_BREAK_BEFORE_AUTO;
+}
+#undef BREAK_BEFORE_MASK
+#undef BREAK_BEFORE_SHIFT
+#undef BREAK_BEFORE_INDEX
+
#define WORD_SPACING_INDEX 3
#define WORD_SPACING_SHIFT 2
#define WORD_SPACING_MASK 0xfc