summaryrefslogtreecommitdiff
path: root/include/libcss/computed.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-11 17:46:32 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-11 17:46:32 +0000
commit1617f3813486071779fe3ff6c724dcd6ae3f6223 (patch)
tree2692d0d051773ef6f9a81d93caf838c7074654f0 /include/libcss/computed.h
parent95106ec57637a13990f644f2a0c574164ac9a20a (diff)
downloadlibcss-1617f3813486071779fe3ff6c724dcd6ae3f6223.tar.gz
libcss-1617f3813486071779fe3ff6c724dcd6ae3f6223.tar.bz2
Change encoding of font-family
Move list-style-position to make room for it. svn path=/trunk/libcss/; revision=6440
Diffstat (limited to 'include/libcss/computed.h')
-rw-r--r--include/libcss/computed.h76
1 files changed, 38 insertions, 38 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index df7a004..7f5ab34 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -193,12 +193,12 @@ struct css_computed_style {
* Encode font family as an array of string objects, terminated with a
* blank entry.
*
- * font_family 1 sizeof(ptr)
+ * font_family 3 sizeof(ptr)
* --- ---
- * 1 bit sizeof(ptr)
+ * 3 bits sizeof(ptr)
*
* ___ ___
- * 265 bits 140 + 2sizeof(css_string) +
+ * 267 bits 140 + 2sizeof(css_string) +
* sizeof(ptr) bytes
*
* 34 bytes 140 + 2sizeof(css_string) +
@@ -214,7 +214,7 @@ struct css_computed_style {
* 3 ttttttti border-top-width | background-image
* 4 rrrrrrrc border-right-width | color
* 5 bbbbbbbl border-bottom-width | list-style-image
- * 6 lllllllf border-left-width | font-family
+ * 6 lllllll. border-left-width | <unused>
* 7 ttttttcc top | border-top-color
* 8 rrrrrrcc right | border-right-color
* 9 bbbbbbcc bottom | border-bottom-color
@@ -237,12 +237,12 @@ struct css_computed_style {
* 26 tttttwww text-indent | white-space
* 27 bbbbbbbb background-position
* 28 bdddddff background-position | display | font-variant
- * 29 tttttll. text-decoration | list-style-position | <unused>
+ * 29 tttttfff text-decoration | font-family
* 30 ttttrrrr border-top-style | border-right-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 vv...... visibility | <unused>
+ * 34 vvll.... visibility | list-style-position | <unused>
*/
uint8_t bits[34];
@@ -820,26 +820,6 @@ static inline uint8_t css_computed_list_style_image(
#undef LIST_STYLE_IMAGE_SHIFT
#undef LIST_STYLE_IMAGE_INDEX
-#define FONT_FAMILY_INDEX 5
-#define FONT_FAMILY_SHIFT 0
-#define FONT_FAMILY_MASK 0x1
-static inline uint8_t css_computed_font_family(
- const css_computed_style *style,
- const css_string **names)
-{
- uint8_t bits = style->bits[FONT_FAMILY_INDEX];
- bits &= FONT_FAMILY_MASK;
- bits >>= FONT_FAMILY_SHIFT;
-
- /* 1bit: type */
- *names = style->font_family;
-
- return bits;
-}
-#undef FONT_FAMILY_MASK
-#undef FONT_FAMILY_SHIFT
-#undef FONT_FAMILY_INDEX
-
#define TOP_INDEX 6
#define TOP_SHIFT 2
#define TOP_MASK 0xfc
@@ -1751,22 +1731,25 @@ static inline uint8_t css_computed_text_decoration(
#undef TEXT_DECORATION_SHIFT
#undef TEXT_DECORATION_INDEX
-#define LIST_STYLE_POSITION_INDEX 28
-#define LIST_STYLE_POSITION_SHIFT 1
-#define LIST_STYLE_POSITION_MASK 0x3
-static inline uint8_t css_computed_list_style_position(
- const css_computed_style *style)
+#define FONT_FAMILY_INDEX 28
+#define FONT_FAMILY_SHIFT 0
+#define FONT_FAMILY_MASK 0x7
+static inline uint8_t css_computed_font_family(
+ const css_computed_style *style,
+ const css_string **names)
{
- uint8_t bits = style->bits[LIST_STYLE_POSITION_INDEX];
- bits &= LIST_STYLE_POSITION_MASK;
- bits >>= LIST_STYLE_POSITION_SHIFT;
+ uint8_t bits = style->bits[FONT_FAMILY_INDEX];
+ bits &= FONT_FAMILY_MASK;
+ bits >>= FONT_FAMILY_SHIFT;
+
+ /* 3bits: type */
+ *names = style->font_family;
- /* 2bits: type */
return bits;
}
-#undef LIST_STYLE_POSITION_MASK
-#undef LIST_STYLE_POSITION_SHIFT
-#undef LIST_STYLE_POSITION_INDEX
+#undef FONT_FAMILY_MASK
+#undef FONT_FAMILY_SHIFT
+#undef FONT_FAMILY_INDEX
#define BORDER_TOP_STYLE_INDEX 29
#define BORDER_TOP_STYLE_SHIFT 4
@@ -1938,4 +1921,21 @@ static inline uint8_t css_computed_visibility(
#undef VISIBILITY_SHIFT
#undef VISIBILITY_INDEX
+#define LIST_STYLE_POSITION_INDEX 33
+#define LIST_STYLE_POSITION_SHIFT 4
+#define LIST_STYLE_POSITION_MASK 0x30
+static inline uint8_t css_computed_list_style_position(
+ const css_computed_style *style)
+{
+ uint8_t bits = style->bits[LIST_STYLE_POSITION_INDEX];
+ bits &= LIST_STYLE_POSITION_MASK;
+ bits >>= LIST_STYLE_POSITION_SHIFT;
+
+ /* 2bits: type */
+ return bits;
+}
+#undef LIST_STYLE_POSITION_MASK
+#undef LIST_STYLE_POSITION_SHIFT
+#undef LIST_STYLE_POSITION_INDEX
+
#endif