summaryrefslogtreecommitdiff
path: root/include/libcss
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-06 19:21:35 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-06 19:21:35 +0000
commit37329b9a60636a419e4b0cd3fa24c89fe0d00e3b (patch)
treed143954c05d853d3c69afb900ea20e01acc9ce99 /include/libcss
parent37752d15cce7456089c8f16ec87b20762382bdc4 (diff)
downloadlibcss-37329b9a60636a419e4b0cd3fa24c89fe0d00e3b.tar.gz
libcss-37329b9a60636a419e4b0cd3fa24c89fe0d00e3b.tar.bz2
More accessors
svn path=/trunk/libcss/; revision=6382
Diffstat (limited to 'include/libcss')
-rw-r--r--include/libcss/computed.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 76f7862..f89d434 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -1615,4 +1615,44 @@ static inline uint8_t css_computed_text_transform(
#undef TEXT_TRANSFORM_SHIFT
#undef TEXT_TRANSFORM_INDEX
+#define TEXT_INDENT_INDEX 25
+#define TEXT_INDENT_SHIFT 3
+#define TEXT_INDENT_MASK 0xf8
+static inline uint8_t css_computed_text_indent(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint8_t bits = style->bits[TEXT_INDENT_INDEX];
+ bits &= TEXT_INDENT_MASK;
+ bits >>= TEXT_INDENT_SHIFT;
+
+ /* 5bits: uuuut : units | type */
+ if ((bits & 0x1) == CSS_TEXT_INDENT_SET) {
+ *length = style->text_indent;
+ *unit = bits >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef TEXT_INDENT_MASK
+#undef TEXT_INDENT_SHIFT
+#undef TEXT_INDENT_INDEX
+
+#define WHITE_SPACE_INDEX 25
+#define WHITE_SPACE_SHIFT 0
+#define WHITE_SPACE_MASK 0x7
+static inline uint8_t css_computed_white_space(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[WHITE_SPACE_INDEX];
+ bits &= WHITE_SPACE_MASK;
+ bits >>= WHITE_SPACE_SHIFT;
+
+ /* 3bits: type */
+ return bits;
+}
+#undef WHITE_SPACE_MASK
+#undef WHITE_SPACE_SHIFT
+#undef WHITE_SPACE_INDEX
+
#endif