summaryrefslogtreecommitdiff
path: root/include/libcss
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-08-21 09:45:13 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-08-21 09:45:13 +0000
commit5c20bde8b544d23fd024dad7ace9b46849336ebf (patch)
tree07dc508d51d281b7553e471a42ba3684018fe512 /include/libcss
parent5bd907c74151d0bbe1859c37cb2bde898ab72e2f (diff)
downloadlibcss-5c20bde8b544d23fd024dad7ace9b46849336ebf.tar.gz
libcss-5c20bde8b544d23fd024dad7ace9b46849336ebf.tar.bz2
-libcss-align
svn path=/trunk/libcss/; revision=9378
Diffstat (limited to 'include/libcss')
-rw-r--r--include/libcss/computed.h24
-rw-r--r--include/libcss/properties.h13
2 files changed, 33 insertions, 4 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index 8e662e5..cbda9a1 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -173,8 +173,9 @@ struct css_computed_style {
* unicode_bidi 2
* visibility 2
* white_space 3
+ * -libcss_align 3
* ---
- * 83 bits
+ * 86 bits
*
* Colours are 32bits of RRGGBBAA
* Dimensions are encoded as a fixed point value + 4 bits of unit data
@@ -232,7 +233,7 @@ struct css_computed_style {
* 1 bit sizeof(ptr) bytes
*
* ___ ___
- * 268 bits 140 + 4sizeof(ptr) bytes
+ * 271 bits 140 + 4sizeof(ptr) bytes
*
* 34 bytes 140 + 4sizeof(ptr) bytes
* ===================
@@ -274,7 +275,7 @@ struct css_computed_style {
* 31 bbbbllll border-bottom-style | border-left-style
* 32 ffffllll font-weight | list-style-type
* 33 oooottuu outline-style | table-layout | unicode-bidi
- * 34 vvll.... visibility | list-style-position | <unused>
+ * 34 vvllaaa. visibility | list-style-position | -libcss-align | <unused>
*/
uint8_t bits[34];
@@ -2176,4 +2177,21 @@ static inline uint8_t css_computed_list_style_position(
#undef LIST_STYLE_POSITION_SHIFT
#undef LIST_STYLE_POSITION_INDEX
+#define LIBCSS_ALIGN_INDEX 33
+#define LIBCSS_ALIGN_SHIFT 1
+#define LIBCSS_ALIGN_MASK 0xe
+static inline uint8_t css_computed_libcss_align(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[LIBCSS_ALIGN_INDEX];
+ bits &= LIBCSS_ALIGN_MASK;
+ bits >>= LIBCSS_ALIGN_SHIFT;
+
+ /* 3bits: type */
+ return bits;
+}
+#undef LIBCSS_ALIGN_MASK
+#undef LIBCSS_ALIGN_SHIFT
+#undef LIBCSS_ALIGN_INDEX
+
#endif
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index e0ace18..38b264e 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -109,7 +109,9 @@ enum css_properties_e {
CSS_PROP_WORD_SPACING = 0x061,
CSS_PROP_Z_INDEX = 0x062,
- CSS_N_PROPERTIES = CSS_PROP_Z_INDEX + 1
+ CSS_PROP_LIBCSS_ALIGN = 0x063,
+
+ CSS_N_PROPERTIES = CSS_PROP_LIBCSS_ALIGN + 1
};
@@ -595,4 +597,13 @@ enum css_z_index_e {
CSS_Z_INDEX_AUTO = 0x2
};
+enum css_libcss_align_e {
+ CSS_LIBCSS_ALIGN_INHERIT = 0x0,
+ CSS_LIBCSS_ALIGN_LEFT = 0x1,
+ CSS_LIBCSS_ALIGN_RIGHT = 0x2,
+ CSS_LIBCSS_ALIGN_CENTER = 0x3,
+ CSS_LIBCSS_ALIGN_JUSTIFY = 0x4,
+ CSS_LIBCSS_ALIGN_DEFAULT = 0x5
+};
+
#endif