summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-08-24 19:00:49 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-08-24 19:00:49 +0000
commit969324103791a79a0c8202958acd5f8bbf993406 (patch)
tree1fa2163ab4547020271c3b643cbe1d759f2edccd
parent4f62d5af8c93e063bf0d9a9f0eaeffb3c451f56f (diff)
downloadlibcss-969324103791a79a0c8202958acd5f8bbf993406.tar.gz
libcss-969324103791a79a0c8202958acd5f8bbf993406.tar.bz2
Namespace preprocessor macros. I'm not entirely sure why I didn't do this in the first place.
svn path=/trunk/libcss/; revision=9437
-rw-r--r--include/libcss/computed.h1479
1 files changed, 740 insertions, 739 deletions
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index c7b9c34..2428fce 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -358,17 +358,17 @@ static inline uint8_t css_computed_line_height(const css_computed_style *style,
static inline uint8_t css_computed_position(const css_computed_style *style);
-#define LETTER_SPACING_INDEX 0
-#define LETTER_SPACING_SHIFT 2
-#define LETTER_SPACING_MASK 0xfc
+#define CSS_LETTER_SPACING_INDEX 0
+#define CSS_LETTER_SPACING_SHIFT 2
+#define CSS_LETTER_SPACING_MASK 0xfc
static inline uint8_t css_computed_letter_spacing(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[LETTER_SPACING_INDEX];
- bits &= LETTER_SPACING_MASK;
- bits >>= LETTER_SPACING_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_LETTER_SPACING_INDEX];
+ bits &= CSS_LETTER_SPACING_MASK;
+ bits >>= CSS_LETTER_SPACING_SHIFT;
/* 6bits: uuuutt : unit | type */
@@ -382,20 +382,20 @@ static inline uint8_t css_computed_letter_spacing(
return CSS_LETTER_SPACING_NORMAL;
}
-#undef LETTER_SPACING_MASK
-#undef LETTER_SPACING_SHIFT
-#undef LETTER_SPACING_INDEX
+#undef CSS_LETTER_SPACING_MASK
+#undef CSS_LETTER_SPACING_SHIFT
+#undef CSS_LETTER_SPACING_INDEX
-#define OUTLINE_COLOR_INDEX 0
-#define OUTLINE_COLOR_SHIFT 0
-#define OUTLINE_COLOR_MASK 0x3
+#define CSS_OUTLINE_COLOR_INDEX 0
+#define CSS_OUTLINE_COLOR_SHIFT 0
+#define CSS_OUTLINE_COLOR_MASK 0x3
static inline uint8_t css_computed_outline_color(
const css_computed_style *style, css_color *color)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[OUTLINE_COLOR_INDEX];
- bits &= OUTLINE_COLOR_MASK;
- bits >>= OUTLINE_COLOR_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_OUTLINE_COLOR_INDEX];
+ bits &= CSS_OUTLINE_COLOR_MASK;
+ bits >>= CSS_OUTLINE_COLOR_SHIFT;
/* 2bits: tt : type */
@@ -408,21 +408,21 @@ static inline uint8_t css_computed_outline_color(
return CSS_OUTLINE_COLOR_INVERT;
}
-#undef OUTLINE_COLOR_MASK
-#undef OUTLINE_COLOR_SHIFT
-#undef OUTLINE_COLOR_INDEX
+#undef CSS_OUTLINE_COLOR_MASK
+#undef CSS_OUTLINE_COLOR_SHIFT
+#undef CSS_OUTLINE_COLOR_INDEX
-#define OUTLINE_WIDTH_INDEX 1
-#define OUTLINE_WIDTH_SHIFT 1
-#define OUTLINE_WIDTH_MASK 0xfe
+#define CSS_OUTLINE_WIDTH_INDEX 1
+#define CSS_OUTLINE_WIDTH_SHIFT 1
+#define CSS_OUTLINE_WIDTH_MASK 0xfe
static inline uint8_t css_computed_outline_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[OUTLINE_WIDTH_INDEX];
- bits &= OUTLINE_WIDTH_MASK;
- bits >>= OUTLINE_WIDTH_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_OUTLINE_WIDTH_INDEX];
+ bits &= CSS_OUTLINE_WIDTH_MASK;
+ bits >>= CSS_OUTLINE_WIDTH_SHIFT;
/* 7bits: uuuuttt : unit | type */
@@ -439,32 +439,32 @@ static inline uint8_t css_computed_outline_width(
return CSS_OUTLINE_WIDTH_WIDTH;
}
-#undef OUTLINE_WIDTH_MASK
-#undef OUTLINE_WIDTH_SHIFT
-#undef OUTLINE_WIDTH_INDEX
+#undef CSS_OUTLINE_WIDTH_MASK
+#undef CSS_OUTLINE_WIDTH_SHIFT
+#undef CSS_OUTLINE_WIDTH_INDEX
-#define BORDER_SPACING_INDEX 1
-#define BORDER_SPACING_SHIFT 0
-#define BORDER_SPACING_MASK 0x1
-#define BORDER_SPACING_INDEX1 2
-#define BORDER_SPACING_SHIFT1 0
-#define BORDER_SPACING_MASK1 0xff
+#define CSS_BORDER_SPACING_INDEX 1
+#define CSS_BORDER_SPACING_SHIFT 0
+#define CSS_BORDER_SPACING_MASK 0x1
+#define CSS_BORDER_SPACING_INDEX1 2
+#define CSS_BORDER_SPACING_SHIFT1 0
+#define CSS_BORDER_SPACING_MASK1 0xff
static inline uint8_t css_computed_border_spacing(
const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[BORDER_SPACING_INDEX];
- bits &= BORDER_SPACING_MASK;
- bits >>= BORDER_SPACING_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_BORDER_SPACING_INDEX];
+ bits &= CSS_BORDER_SPACING_MASK;
+ bits >>= CSS_BORDER_SPACING_SHIFT;
/* 1 bit: type */
if (bits == CSS_BORDER_SPACING_SET) {
uint8_t bits1 =
- style->uncommon->bits[BORDER_SPACING_INDEX1];
- bits1 &= BORDER_SPACING_MASK1;
- bits1 >>= BORDER_SPACING_SHIFT1;
+ style->uncommon->bits[CSS_BORDER_SPACING_INDEX1];
+ bits1 &= CSS_BORDER_SPACING_MASK1;
+ bits1 >>= CSS_BORDER_SPACING_SHIFT1;
/* 8bits: hhhhvvvv : hunit | vunit */
@@ -483,24 +483,24 @@ static inline uint8_t css_computed_border_spacing(
return CSS_BORDER_SPACING_SET;
}
-#undef BORDER_SPACING_MASK1
-#undef BORDER_SPACING_SHIFT1
-#undef BORDER_SPACING_INDEX1
-#undef BORDER_SPACING_MASK
-#undef BORDER_SPACING_SHIFT
-#undef BORDER_SPACING_INDEX
+#undef CSS_BORDER_SPACING_MASK1
+#undef CSS_BORDER_SPACING_SHIFT1
+#undef CSS_BORDER_SPACING_INDEX1
+#undef CSS_BORDER_SPACING_MASK
+#undef CSS_BORDER_SPACING_SHIFT
+#undef CSS_BORDER_SPACING_INDEX
-#define WORD_SPACING_INDEX 3
-#define WORD_SPACING_SHIFT 2
-#define WORD_SPACING_MASK 0xfc
+#define CSS_WORD_SPACING_INDEX 3
+#define CSS_WORD_SPACING_SHIFT 2
+#define CSS_WORD_SPACING_MASK 0xfc
static inline uint8_t css_computed_word_spacing(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[WORD_SPACING_INDEX];
- bits &= WORD_SPACING_MASK;
- bits >>= WORD_SPACING_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_WORD_SPACING_INDEX];
+ bits &= CSS_WORD_SPACING_MASK;
+ bits >>= CSS_WORD_SPACING_SHIFT;
/* 6bits: uuuutt : unit | type */
@@ -514,21 +514,22 @@ static inline uint8_t css_computed_word_spacing(
return CSS_WORD_SPACING_NORMAL;
}
-#undef WORD_SPACING_MASK
-#undef WORD_SPACING_SHIFT
-#undef WORD_SPACING_INDEX
+#undef CSS_WORD_SPACING_MASK
+#undef CSS_WORD_SPACING_SHIFT
+#undef CSS_WORD_SPACING_INDEX
-#define COUNTER_INCREMENT_INDEX 3
-#define COUNTER_INCREMENT_SHIFT 1
-#define COUNTER_INCREMENT_MASK 0x2
+#define CSS_COUNTER_INCREMENT_INDEX 3
+#define CSS_COUNTER_INCREMENT_SHIFT 1
+#define CSS_COUNTER_INCREMENT_MASK 0x2
static inline uint8_t css_computed_counter_increment(
const css_computed_style *style,
const css_computed_counter **counters)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[COUNTER_INCREMENT_INDEX];
- bits &= COUNTER_INCREMENT_MASK;
- bits >>= COUNTER_INCREMENT_SHIFT;
+ uint8_t bits =
+ style->uncommon->bits[CSS_COUNTER_INCREMENT_INDEX];
+ bits &= CSS_COUNTER_INCREMENT_MASK;
+ bits >>= CSS_COUNTER_INCREMENT_SHIFT;
/* 1bit: type */
*counters = style->uncommon->counter_increment;
@@ -538,21 +539,21 @@ static inline uint8_t css_computed_counter_increment(
return CSS_COUNTER_INCREMENT_NONE;
}
-#undef COUNTER_INCREMENT_MASK
-#undef COUNTER_INCREMENT_SHIFT
-#undef COUNTER_INCREMENT_INDEX
+#undef CSS_COUNTER_INCREMENT_MASK
+#undef CSS_COUNTER_INCREMENT_SHIFT
+#undef CSS_COUNTER_INCREMENT_INDEX
-#define COUNTER_RESET_INDEX 3
-#define COUNTER_RESET_SHIFT 0
-#define COUNTER_RESET_MASK 0x1
+#define CSS_COUNTER_RESET_INDEX 3
+#define CSS_COUNTER_RESET_SHIFT 0
+#define CSS_COUNTER_RESET_MASK 0x1
static inline uint8_t css_computed_counter_reset(
const css_computed_style *style,
const css_computed_counter **counters)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[COUNTER_RESET_INDEX];
- bits &= COUNTER_RESET_MASK;
- bits >>= COUNTER_RESET_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_COUNTER_RESET_INDEX];
+ bits &= CSS_COUNTER_RESET_MASK;
+ bits >>= CSS_COUNTER_RESET_SHIFT;
/* 1bit: type */
*counters = style->uncommon->counter_reset;
@@ -562,21 +563,21 @@ static inline uint8_t css_computed_counter_reset(
return CSS_COUNTER_RESET_NONE;
}
-#undef COUNTER_RESET_MASK
-#undef COUNTER_RESET_SHIFT
-#undef COUNTER_RESET_INDEX
+#undef CSS_COUNTER_RESET_MASK
+#undef CSS_COUNTER_RESET_SHIFT
+#undef CSS_COUNTER_RESET_INDEX
-#define CURSOR_INDEX 4
-#define CURSOR_SHIFT 3
-#define CURSOR_MASK 0xf8
+#define CSS_CURSOR_INDEX 4
+#define CSS_CURSOR_SHIFT 3
+#define CSS_CURSOR_MASK 0xf8
static inline uint8_t css_computed_cursor(
const css_computed_style *style,
lwc_string ***urls)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[CURSOR_INDEX];
- bits &= CURSOR_MASK;
- bits >>= CURSOR_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_CURSOR_INDEX];
+ bits &= CSS_CURSOR_MASK;
+ bits >>= CSS_CURSOR_SHIFT;
/* 5bits: type */
*urls = style->uncommon->cursor;
@@ -586,27 +587,27 @@ static inline uint8_t css_computed_cursor(
return CSS_CURSOR_AUTO;
}
-#undef CURSOR_MASK
-#undef CURSOR_SHIFT
-#undef CURSOR_INDEX
-
-#define CLIP_INDEX 7
-#define CLIP_SHIFT 2
-#define CLIP_MASK 0xfc
-#define CLIP_INDEX1 5
-#define CLIP_SHIFT1 0
-#define CLIP_MASK1 0xff
-#define CLIP_INDEX2 6
-#define CLIP_SHIFT2 0
-#define CLIP_MASK2 0xff
+#undef CSS_CURSOR_MASK
+#undef CSS_CURSOR_SHIFT
+#undef CSS_CURSOR_INDEX
+
+#define CSS_CLIP_INDEX 7
+#define CSS_CLIP_SHIFT 2
+#define CSS_CLIP_MASK 0xfc
+#define CSS_CLIP_INDEX1 5
+#define CSS_CLIP_SHIFT1 0
+#define CSS_CLIP_MASK1 0xff
+#define CSS_CLIP_INDEX2 6
+#define CSS_CLIP_SHIFT2 0
+#define CSS_CLIP_MASK2 0xff
static inline uint8_t css_computed_clip(
const css_computed_style *style,
css_computed_clip_rect *rect)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[CLIP_INDEX];
- bits &= CLIP_MASK;
- bits >>= CLIP_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_CLIP_INDEX];
+ bits &= CSS_CLIP_MASK;
+ bits >>= CSS_CLIP_SHIFT;
/* 6bits: trblyy : top | right | bottom | left | type */
if ((bits & 0x3) == CSS_CLIP_RECT) {
@@ -620,9 +621,9 @@ static inline uint8_t css_computed_clip(
if (rect->top_auto == false ||
rect->right_auto == false) {
/* 8bits: ttttrrrr : top | right */
- bits1 = style->uncommon->bits[CLIP_INDEX1];
- bits1 &= CLIP_MASK1;
- bits1 >>= CLIP_SHIFT1;
+ bits1 = style->uncommon->bits[CSS_CLIP_INDEX1];
+ bits1 &= CSS_CLIP_MASK1;
+ bits1 >>= CSS_CLIP_SHIFT1;
} else {
bits1 = 0;
}
@@ -636,9 +637,9 @@ static inline uint8_t css_computed_clip(
if (rect->bottom_auto == false ||
rect->left_auto == false) {
/* 8bits: bbbbllll : bottom | left */
- bits1 = style->uncommon->bits[CLIP_INDEX2];
- bits1 &= CLIP_MASK2;
- bits1 >>= CLIP_SHIFT2;
+ bits1 = style->uncommon->bits[CSS_CLIP_INDEX2];
+ bits1 &= CSS_CLIP_MASK2;
+ bits1 >>= CSS_CLIP_SHIFT2;
} else {
bits1 = 0;
}
@@ -655,27 +656,27 @@ static inline uint8_t css_computed_clip(
return CSS_CLIP_AUTO;
}
-#undef CLIP_MASK2
-#undef CLIP_SHIFT2
-#undef CLIP_INDEX2
-#undef CLIP_MASK1
-#undef CLIP_SHIFT1
-#undef CLIP_INDEX1
-#undef CLIP_MASK
-#undef CLIP_SHIFT
-#undef CLIP_INDEX
-
-#define CONTENT_INDEX 7
-#define CONTENT_SHIFT 0
-#define CONTENT_MASK 0x3
+#undef CSS_CLIP_MASK2
+#undef CSS_CLIP_SHIFT2
+#undef CSS_CLIP_INDEX2
+#undef CSS_CLIP_MASK1
+#undef CSS_CLIP_SHIFT1
+#undef CSS_CLIP_INDEX1
+#undef CSS_CLIP_MASK
+#undef CSS_CLIP_SHIFT
+#undef CSS_CLIP_INDEX
+
+#define CSS_CONTENT_INDEX 7
+#define CSS_CONTENT_SHIFT 0
+#define CSS_CONTENT_MASK 0x3
static inline uint8_t css_computed_content(
const css_computed_style *style,
const css_computed_content_item **content)
{
if (style->uncommon != NULL) {
- uint8_t bits = style->uncommon->bits[CONTENT_INDEX];
- bits &= CONTENT_MASK;
- bits >>= CONTENT_SHIFT;
+ uint8_t bits = style->uncommon->bits[CSS_CONTENT_INDEX];
+ bits &= CSS_CONTENT_MASK;
+ bits >>= CSS_CONTENT_SHIFT;
/* 2bits: type */
*content = style->uncommon->content;
@@ -685,20 +686,20 @@ static inline uint8_t css_computed_content(
return CSS_CONTENT_NORMAL;
}
-#undef CONTENT_MASK
-#undef CONTENT_SHIFT
-#undef CONTENT_INDEX
+#undef CSS_CONTENT_MASK
+#undef CSS_CONTENT_SHIFT
+#undef CSS_CONTENT_INDEX
-#define VERTICAL_ALIGN_INDEX 0
-#define VERTICAL_ALIGN_SHIFT 0
-#define VERTICAL_ALIGN_MASK 0xff
+#define CSS_VERTICAL_ALIGN_INDEX 0
+#define CSS_VERTICAL_ALIGN_SHIFT 0
+#define CSS_VERTICAL_ALIGN_MASK 0xff
static inline uint8_t css_computed_vertical_align(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[VERTICAL_ALIGN_INDEX];
- bits &= VERTICAL_ALIGN_MASK;
- bits >>= VERTICAL_ALIGN_SHIFT;
+ uint8_t bits = style->bits[CSS_VERTICAL_ALIGN_INDEX];
+ bits &= CSS_VERTICAL_ALIGN_MASK;
+ bits >>= CSS_VERTICAL_ALIGN_SHIFT;
/* 8bits: uuuutttt : units | type */
if ((bits & 0xf) == CSS_VERTICAL_ALIGN_SET) {
@@ -708,20 +709,20 @@ static inline uint8_t css_computed_vertical_align(
return (bits & 0xf);
}
-#undef VERTICAL_ALIGN_MASK
-#undef VERTICAL_ALIGN_SHIFT
-#undef VERTICAL_ALIGN_INDEX
+#undef CSS_VERTICAL_ALIGN_MASK
+#undef CSS_VERTICAL_ALIGN_SHIFT
+#undef CSS_VERTICAL_ALIGN_INDEX
-#define FONT_SIZE_INDEX 1
-#define FONT_SIZE_SHIFT 0
-#define FONT_SIZE_MASK 0xff
+#define CSS_FONT_SIZE_INDEX 1
+#define CSS_FONT_SIZE_SHIFT 0
+#define CSS_FONT_SIZE_MASK 0xff
static inline uint8_t css_computed_font_size(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[FONT_SIZE_INDEX];
- bits &= FONT_SIZE_MASK;
- bits >>= FONT_SIZE_SHIFT;
+ uint8_t bits = style->bits[CSS_FONT_SIZE_INDEX];
+ bits &= CSS_FONT_SIZE_MASK;
+ bits >>= CSS_FONT_SIZE_SHIFT;
/* 8bits: uuuutttt : units | type */
if ((bits & 0xf) == CSS_FONT_SIZE_DIMENSION) {
@@ -731,20 +732,20 @@ static inline uint8_t css_computed_font_size(
return (bits & 0xf);
}
-#undef FONT_SIZE_MASK
-#undef FONT_SIZE_SHIFT
-#undef FONT_SIZE_INDEX
+#undef CSS_FONT_SIZE_MASK
+#undef CSS_FONT_SIZE_SHIFT
+#undef CSS_FONT_SIZE_INDEX
-#define BORDER_TOP_WIDTH_INDEX 2
-#define BORDER_TOP_WIDTH_SHIFT 1
-#define BORDER_TOP_WIDTH_MASK 0xfe
+#define CSS_BORDER_TOP_WIDTH_INDEX 2
+#define CSS_BORDER_TOP_WIDTH_SHIFT 1
+#define CSS_BORDER_TOP_WIDTH_MASK 0xfe
static inline uint8_t css_computed_border_top_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[BORDER_TOP_WIDTH_INDEX];
- bits &= BORDER_TOP_WIDTH_MASK;
- bits >>= BORDER_TOP_WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_TOP_WIDTH_INDEX];
+ bits &= CSS_BORDER_TOP_WIDTH_MASK;
+ bits >>= CSS_BORDER_TOP_WIDTH_SHIFT;
/* 7bits: uuuuttt : units | type */
if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
@@ -754,20 +755,20 @@ static inline uint8_t css_computed_border_top_width(
return (bits & 0x7);
}
-#undef BORDER_TOP_WIDTH_MASK
-#undef BORDER_TOP_WIDTH_SHIFT
-#undef BORDER_TOP_WIDTH_INDEX
+#undef CSS_BORDER_TOP_WIDTH_MASK
+#undef CSS_BORDER_TOP_WIDTH_SHIFT
+#undef CSS_BORDER_TOP_WIDTH_INDEX
-#define BORDER_RIGHT_WIDTH_INDEX 3
-#define BORDER_RIGHT_WIDTH_SHIFT 1
-#define BORDER_RIGHT_WIDTH_MASK 0xfe
+#define CSS_BORDER_RIGHT_WIDTH_INDEX 3
+#define CSS_BORDER_RIGHT_WIDTH_SHIFT 1
+#define CSS_BORDER_RIGHT_WIDTH_MASK 0xfe
static inline uint8_t css_computed_border_right_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[BORDER_RIGHT_WIDTH_INDEX];
- bits &= BORDER_RIGHT_WIDTH_MASK;
- bits >>= BORDER_RIGHT_WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_RIGHT_WIDTH_INDEX];
+ bits &= CSS_BORDER_RIGHT_WIDTH_MASK;
+ bits >>= CSS_BORDER_RIGHT_WIDTH_SHIFT;
/* 7bits: uuuuttt : units | type */
if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
@@ -777,20 +778,20 @@ static inline uint8_t css_computed_border_right_width(
return (bits & 0x7);
}
-#undef BORDER_RIGHT_WIDTH_MASK
-#undef BORDER_RIGHT_WIDTH_SHIFT
-#undef BORDER_RIGHT_WIDTH_INDEX
+#undef CSS_BORDER_RIGHT_WIDTH_MASK
+#undef CSS_BORDER_RIGHT_WIDTH_SHIFT
+#undef CSS_BORDER_RIGHT_WIDTH_INDEX
-#define BORDER_BOTTOM_WIDTH_INDEX 4
-#define BORDER_BOTTOM_WIDTH_SHIFT 1
-#define BORDER_BOTTOM_WIDTH_MASK 0xfe
+#define CSS_BORDER_BOTTOM_WIDTH_INDEX 4
+#define CSS_BORDER_BOTTOM_WIDTH_SHIFT 1
+#define CSS_BORDER_BOTTOM_WIDTH_MASK 0xfe
static inline uint8_t css_computed_border_bottom_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[BORDER_BOTTOM_WIDTH_INDEX];
- bits &= BORDER_BOTTOM_WIDTH_MASK;
- bits >>= BORDER_BOTTOM_WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_BOTTOM_WIDTH_INDEX];
+ bits &= CSS_BORDER_BOTTOM_WIDTH_MASK;
+ bits >>= CSS_BORDER_BOTTOM_WIDTH_SHIFT;
/* 7bits: uuuuttt : units | type */
if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
@@ -800,20 +801,20 @@ static inline uint8_t css_computed_border_bottom_width(
return (bits & 0x7);
}
-#undef BORDER_BOTTOM_WIDTH_MASK
-#undef BORDER_BOTTOM_WIDTH_SHIFT
-#undef BORDER_BOTTOM_WIDTH_INDEX
+#undef CSS_BORDER_BOTTOM_WIDTH_MASK
+#undef CSS_BORDER_BOTTOM_WIDTH_SHIFT
+#undef CSS_BORDER_BOTTOM_WIDTH_INDEX
-#define BORDER_LEFT_WIDTH_INDEX 5
-#define BORDER_LEFT_WIDTH_SHIFT 1
-#define BORDER_LEFT_WIDTH_MASK 0xfe
+#define CSS_BORDER_LEFT_WIDTH_INDEX 5
+#define CSS_BORDER_LEFT_WIDTH_SHIFT 1
+#define CSS_BORDER_LEFT_WIDTH_MASK 0xfe
static inline uint8_t css_computed_border_left_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[BORDER_LEFT_WIDTH_INDEX];
- bits &= BORDER_LEFT_WIDTH_MASK;
- bits >>= BORDER_LEFT_WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_LEFT_WIDTH_INDEX];
+ bits &= CSS_BORDER_LEFT_WIDTH_MASK;
+ bits >>= CSS_BORDER_LEFT_WIDTH_SHIFT;
/* 7bits: uuuuttt : units | type */
if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
@@ -823,109 +824,109 @@ static inline uint8_t css_computed_border_left_width(
return (bits & 0x7);
}
-#undef BORDER_LEFT_WIDTH_MASK
-#undef BORDER_LEFT_WIDTH_SHIFT
-#undef BORDER_LEFT_WIDTH_INDEX
+#undef CSS_BORDER_LEFT_WIDTH_MASK
+#undef CSS_BORDER_LEFT_WIDTH_SHIFT
+#undef CSS_BORDER_LEFT_WIDTH_INDEX
-#define BACKGROUND_IMAGE_INDEX 2
-#define BACKGROUND_IMAGE_SHIFT 0
-#define BACKGROUND_IMAGE_MASK 0x1
+#define CSS_BACKGROUND_IMAGE_INDEX 2
+#define CSS_BACKGROUND_IMAGE_SHIFT 0
+#define CSS_BACKGROUND_IMAGE_MASK 0x1
static inline uint8_t css_computed_background_image(
const css_computed_style *style,
lwc_string **url)
{
- uint8_t bits = style->bits[BACKGROUND_IMAGE_INDEX];
- bits &= BACKGROUND_IMAGE_MASK;
- bits >>= BACKGROUND_IMAGE_SHIFT;
+ uint8_t bits = style->bits[CSS_BACKGROUND_IMAGE_INDEX];
+ bits &= CSS_BACKGROUND_IMAGE_MASK;
+ bits >>= CSS_BACKGROUND_IMAGE_SHIFT;
/* 1bit: type */
*url = style->background_image;
return bits;
}
-#undef BACKGROUND_IMAGE_MASK
-#undef BACKGROUND_IMAGE_SHIFT
-#undef BACKGROUND_IMAGE_INDEX
+#undef CSS_BACKGROUND_IMAGE_MASK
+#undef CSS_BACKGROUND_IMAGE_SHIFT
+#undef CSS_BACKGROUND_IMAGE_INDEX
-#define COLOR_INDEX 3
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
+#define CSS_COLOR_INDEX 3
+#define CSS_COLOR_SHIFT 0
+#define CSS_COLOR_MASK 0x1
static inline uint8_t css_computed_color(
const css_computed_style *style,
css_color *color)
{
- uint8_t bits = style->bits[COLOR_INDEX];
- bits &= COLOR_MASK;
- bits >>= COLOR_SHIFT;
+ uint8_t bits = style->bits[CSS_COLOR_INDEX];
+ bits &= CSS_COLOR_MASK;
+ bits >>= CSS_COLOR_SHIFT;
/* 1bit: type */
*color = style->color;
return bits;
}
-#undef COLOR_MASK
-#undef COLOR_SHIFT
-#undef COLOR_INDEX
+#undef CSS_COLOR_MASK
+#undef CSS_COLOR_SHIFT
+#undef CSS_COLOR_INDEX
-#define LIST_STYLE_IMAGE_INDEX 4
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
+#define CSS_LIST_STYLE_IMAGE_INDEX 4
+#define CSS_LIST_STYLE_IMAGE_SHIFT 0
+#define CSS_LIST_STYLE_IMAGE_MASK 0x1
static inline uint8_t css_computed_list_style_image(
const css_computed_style *style,
lwc_string **url)
{
- uint8_t bits = style->bits[LIST_STYLE_IMAGE_INDEX];
- bits &= LIST_STYLE_IMAGE_MASK;
- bits >>= LIST_STYLE_IMAGE_SHIFT;
+ uint8_t bits = style->bits[CSS_LIST_STYLE_IMAGE_INDEX];
+ bits &= CSS_LIST_STYLE_IMAGE_MASK;
+ bits >>= CSS_LIST_STYLE_IMAGE_SHIFT;
/* 1bit: type */
*url = style->list_style_image;
return bits;
}
-#undef LIST_STYLE_IMAGE_MASK
-#undef LIST_STYLE_IMAGE_SHIFT
-#undef LIST_STYLE_IMAGE_INDEX
+#undef CSS_LIST_STYLE_IMAGE_MASK
+#undef CSS_LIST_STYLE_IMAGE_SHIFT
+#undef CSS_LIST_STYLE_IMAGE_INDEX
-#define QUOTES_INDEX 5
-#define QUOTES_SHIFT 0
-#define QUOTES_MASK 0x1
+#define CSS_QUOTES_INDEX 5
+#define CSS_QUOTES_SHIFT 0
+#define CSS_QUOTES_MASK 0x1
static inline uint8_t css_computed_quotes(
const css_computed_style *style,
lwc_string ***quotes)
{
- uint8_t bits = style->bits[QUOTES_INDEX];
- bits &= QUOTES_MASK;
- bits >>= QUOTES_SHIFT;
+ uint8_t bits = style->bits[CSS_QUOTES_INDEX];
+ bits &= CSS_QUOTES_MASK;
+ bits >>= CSS_QUOTES_SHIFT;
/* 1bit: type */
*quotes = style->quotes;
return bits;
}
-#undef QUOTES_MASK
-#undef QUOTES_SHIFT
-#undef QUOTES_INDEX
-
-#define TOP_INDEX 6
-#define TOP_SHIFT 2
-#define TOP_MASK 0xfc
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 2
-#define RIGHT_MASK 0xfc
-#define BOTTOM_INDEX 8
-#define BOTTOM_SHIFT 2
-#define BOTTOM_MASK 0xfc
-#define LEFT_INDEX 9
-#define LEFT_SHIFT 2
-#define LEFT_MASK 0xfc
+#undef CSS_QUOTES_MASK
+#undef CSS_QUOTES_SHIFT
+#undef CSS_QUOTES_INDEX
+
+#define CSS_TOP_INDEX 6
+#define CSS_TOP_SHIFT 2
+#define CSS_TOP_MASK 0xfc
+#define CSS_RIGHT_INDEX 7
+#define CSS_RIGHT_SHIFT 2
+#define CSS_RIGHT_MASK 0xfc
+#define CSS_BOTTOM_INDEX 8
+#define CSS_BOTTOM_SHIFT 2
+#define CSS_BOTTOM_MASK 0xfc
+#define CSS_LEFT_INDEX 9
+#define CSS_LEFT_SHIFT 2
+#define CSS_LEFT_MASK 0xfc
static inline uint8_t css_computed_top(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[TOP_INDEX];
- bits &= TOP_MASK;
- bits >>= TOP_SHIFT;
+ uint8_t bits = style->bits[CSS_TOP_INDEX];
+ bits &= CSS_TOP_MASK;
+ bits >>= CSS_TOP_SHIFT;
/* Fix up, based on computed position */
if (css_computed_position(style) == CSS_POSITION_STATIC) {
@@ -933,9 +934,9 @@ static inline uint8_t css_computed_top(
bits = CSS_TOP_AUTO;
} else if (css_computed_position(style) == CSS_POSITION_RELATIVE) {
/* Relative -> follow $9.4.3 */
- uint8_t bottom = style->bits[BOTTOM_INDEX];
- bottom &= BOTTOM_MASK;
- bottom >>= BOTTOM_SHIFT;
+ uint8_t bottom = style->bits[CSS_BOTTOM_INDEX];
+ bottom &= CSS_BOTTOM_MASK;
+ bottom >>= CSS_BOTTOM_SHIFT;
if ((bits & 0x3) == CSS_TOP_AUTO &&
(bottom & 0x3) == CSS_BOTTOM_AUTO) {
@@ -965,9 +966,9 @@ static inline uint8_t css_computed_right(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[RIGHT_INDEX];
- bits &= RIGHT_MASK;
- bits >>= RIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_RIGHT_INDEX];
+ bits &= CSS_RIGHT_MASK;
+ bits >>= CSS_RIGHT_SHIFT;
/* Fix up, based on computed position */
if (css_computed_position(style) == CSS_POSITION_STATIC) {
@@ -975,9 +976,9 @@ static inline uint8_t css_computed_right(
bits = CSS_RIGHT_AUTO;
} else if (css_computed_position(style) == CSS_POSITION_RELATIVE) {
/* Relative -> follow $9.4.3 */
- uint8_t left = style->bits[LEFT_INDEX];
- left &= LEFT_MASK;
- left >>= LEFT_SHIFT;
+ uint8_t left = style->bits[CSS_LEFT_INDEX];
+ left &= CSS_LEFT_MASK;
+ left >>= CSS_LEFT_SHIFT;
if ((bits & 0x3) == CSS_RIGHT_AUTO &&
(left & 0x3) == CSS_LEFT_AUTO) {
@@ -1009,9 +1010,9 @@ static inline uint8_t css_computed_bottom(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[BOTTOM_INDEX];
- bits &= BOTTOM_MASK;
- bits >>= BOTTOM_SHIFT;
+ uint8_t bits = style->bits[CSS_BOTTOM_INDEX];
+ bits &= CSS_BOTTOM_MASK;
+ bits >>= CSS_BOTTOM_SHIFT;
/* Fix up, based on computed position */
if (css_computed_position(style) == CSS_POSITION_STATIC) {
@@ -1019,9 +1020,9 @@ static inline uint8_t css_computed_bottom(
bits = CSS_BOTTOM_AUTO;
} else if (css_computed_position(style) == CSS_POSITION_RELATIVE) {
/* Relative -> follow $9.4.3 */
- uint8_t top = style->bits[TOP_INDEX];
- top &= TOP_MASK;
- top >>= TOP_SHIFT;
+ uint8_t top = style->bits[CSS_TOP_INDEX];
+ top &= CSS_TOP_MASK;
+ top >>= CSS_TOP_SHIFT;
if ((bits & 0x3) == CSS_BOTTOM_AUTO &&
(top & 0x3) == CSS_TOP_AUTO) {
@@ -1052,9 +1053,9 @@ static inline uint8_t css_computed_left(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[LEFT_INDEX];
- bits &= LEFT_MASK;
- bits >>= LEFT_SHIFT;
+ uint8_t bits = style->bits[CSS_LEFT_INDEX];
+ bits &= CSS_LEFT_MASK;
+ bits >>= CSS_LEFT_SHIFT;
/* Fix up, based on computed position */
if (css_computed_position(style) == CSS_POSITION_STATIC) {
@@ -1062,9 +1063,9 @@ static inline uint8_t css_computed_left(
bits = CSS_LEFT_AUTO;
} else if (css_computed_position(style) == CSS_POSITION_RELATIVE) {
/* Relative -> follow $9.4.3 */
- uint8_t right = style->bits[RIGHT_INDEX];
- right &= RIGHT_MASK;
- right >>= RIGHT_SHIFT;
+ uint8_t right = style->bits[CSS_RIGHT_INDEX];
+ right &= CSS_RIGHT_MASK;
+ right >>= CSS_RIGHT_SHIFT;
if ((bits & 0x3) == CSS_LEFT_AUTO &&
(right & 0x3) == CSS_RIGHT_AUTO) {
@@ -1091,109 +1092,109 @@ static inline uint8_t css_computed_left(
/* 6bits: uuuutt : units | type */
return (bits & 0x3);
}
-#undef LEFT_MASK
-#undef LEFT_SHIFT
-#undef LEFT_INDEX
-#undef BOTTOM_MASK
-#undef BOTTOM_SHIFT
-#undef BOTTOM_INDEX
-#undef RIGHT_MASK
-#undef RIGHT_SHIFT
-#undef RIGHT_INDEX
-#undef TOP_MASK
-#undef TOP_SHIFT
-#undef TOP_INDEX
-
-#define BORDER_TOP_COLOR_INDEX 6
-#define BORDER_TOP_COLOR_SHIFT 0
-#define BORDER_TOP_COLOR_MASK 0x3
+#undef CSS_LEFT_MASK
+#undef CSS_LEFT_SHIFT
+#undef CSS_LEFT_INDEX
+#undef CSS_BOTTOM_MASK
+#undef CSS_BOTTOM_SHIFT
+#undef CSS_BOTTOM_INDEX
+#undef CSS_RIGHT_MASK
+#undef CSS_RIGHT_SHIFT
+#undef CSS_RIGHT_INDEX
+#undef CSS_TOP_MASK
+#undef CSS_TOP_SHIFT
+#undef CSS_TOP_INDEX
+
+#define CSS_BORDER_TOP_COLOR_INDEX 6
+#define CSS_BORDER_TOP_COLOR_SHIFT 0
+#define CSS_BORDER_TOP_COLOR_MASK 0x3
static inline uint8_t css_computed_border_top_color(
const css_computed_style *style,
css_color *color)
{
- uint8_t bits = style->bits[BORDER_TOP_COLOR_INDEX];
- bits &= BORDER_TOP_COLOR_MASK;
- bits >>= BORDER_TOP_COLOR_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_TOP_COLOR_INDEX];
+ bits &= CSS_BORDER_TOP_COLOR_MASK;
+ bits >>= CSS_BORDER_TOP_COLOR_SHIFT;
/* 2bits: type */
*color = style->border_color[0];
return bits;
}
-#undef BORDER_TOP_COLOR_MASK
-#undef BORDER_TOP_COLOR_SHIFT
-#undef BORDER_TOP_COLOR_INDEX
+#undef CSS_BORDER_TOP_COLOR_MASK
+#undef CSS_BORDER_TOP_COLOR_SHIFT
+#undef CSS_BORDER_TOP_COLOR_INDEX
-#define BORDER_RIGHT_COLOR_INDEX 7
-#define BORDER_RIGHT_COLOR_SHIFT 0
-#define BORDER_RIGHT_COLOR_MASK 0x3
+#define CSS_BORDER_RIGHT_COLOR_INDEX 7
+#define CSS_BORDER_RIGHT_COLOR_SHIFT 0
+#define CSS_BORDER_RIGHT_COLOR_MASK 0x3
static inline uint8_t css_computed_border_right_color(
const css_computed_style *style,
css_color *color)
{
- uint8_t bits = style->bits[BORDER_RIGHT_COLOR_INDEX];
- bits &= BORDER_RIGHT_COLOR_MASK;
- bits >>= BORDER_RIGHT_COLOR_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_RIGHT_COLOR_INDEX];
+ bits &= CSS_BORDER_RIGHT_COLOR_MASK;
+ bits >>= CSS_BORDER_RIGHT_COLOR_SHIFT;
/* 2bits: type */
*color = style->border_color[1];
return bits;
}
-#undef BORDER_RIGHT_COLOR_MASK
-#undef BORDER_RIGHT_COLOR_SHIFT
-#undef BORDER_RIGHT_COLOR_INDEX
+#undef CSS_BORDER_RIGHT_COLOR_MASK
+#undef CSS_BORDER_RIGHT_COLOR_SHIFT
+#undef CSS_BORDER_RIGHT_COLOR_INDEX
-#define BORDER_BOTTOM_COLOR_INDEX 8
-#define BORDER_BOTTOM_COLOR_SHIFT 0
-#define BORDER_BOTTOM_COLOR_MASK 0x3
+#define CSS_BORDER_BOTTOM_COLOR_INDEX 8
+#define CSS_BORDER_BOTTOM_COLOR_SHIFT 0
+#define CSS_BORDER_BOTTOM_COLOR_MASK 0x3
static inline uint8_t css_computed_border_bottom_color(
const css_computed_style *style,
css_color *color)
{
- uint8_t bits = style->bits[BORDER_BOTTOM_COLOR_INDEX];
- bits &= BORDER_BOTTOM_COLOR_MASK;
- bits >>= BORDER_BOTTOM_COLOR_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_BOTTOM_COLOR_INDEX];
+ bits &= CSS_BORDER_BOTTOM_COLOR_MASK;
+ bits >>= CSS_BORDER_BOTTOM_COLOR_SHIFT;
/* 2bits: type */
*color = style->border_color[2];
return bits;
}
-#undef BORDER_BOTTOM_COLOR_MASK
-#undef BORDER_BOTTOM_COLOR_SHIFT
-#undef BORDER_BOTTOM_COLOR_INDEX
+#undef CSS_BORDER_BOTTOM_COLOR_MASK
+#undef CSS_BORDER_BOTTOM_COLOR_SHIFT
+#undef CSS_BORDER_BOTTOM_COLOR_INDEX
-#define BORDER_LEFT_COLOR_INDEX 9
-#define BORDER_LEFT_COLOR_SHIFT 0
-#define BORDER_LEFT_COLOR_MASK 0x3
+#define CSS_BORDER_LEFT_COLOR_INDEX 9
+#define CSS_BORDER_LEFT_COLOR_SHIFT 0
+#define CSS_BORDER_LEFT_COLOR_MASK 0x3
static inline uint8_t css_computed_border_left_color(
const css_computed_style *style,
css_color *color)
{
- uint8_t bits = style->bits[BORDER_LEFT_COLOR_INDEX];
- bits &= BORDER_LEFT_COLOR_MASK;
- bits >>= BORDER_LEFT_COLOR_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_LEFT_COLOR_INDEX];
+ bits &= CSS_BORDER_LEFT_COLOR_MASK;
+ bits >>= CSS_BORDER_LEFT_COLOR_SHIFT;
/* 2bits: type */
*color = style->border_color[3];
return bits;
}
-#undef BORDER_LEFT_COLOR_MASK
-#undef BORDER_LEFT_COLOR_SHIFT
-#undef BORDER_LEFT_COLOR_INDEX
+#undef CSS_BORDER_LEFT_COLOR_MASK
+#undef CSS_BORDER_LEFT_COLOR_SHIFT
+#undef CSS_BORDER_LEFT_COLOR_INDEX
-#define HEIGHT_INDEX 10
-#define HEIGHT_SHIFT 2
-#define HEIGHT_MASK 0xfc
+#define CSS_HEIGHT_INDEX 10
+#define CSS_HEIGHT_SHIFT 2
+#define CSS_HEIGHT_MASK 0xfc
static inline uint8_t css_computed_height(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[HEIGHT_INDEX];
- bits &= HEIGHT_MASK;
- bits >>= HEIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_HEIGHT_INDEX];
+ bits &= CSS_HEIGHT_MASK;
+ bits >>= CSS_HEIGHT_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_HEIGHT_SET) {
@@ -1203,20 +1204,20 @@ static inline uint8_t css_computed_height(
return (bits & 0x3);
}
-#undef HEIGHT_MASK
-#undef HEIGHT_SHIFT
-#undef HEIGHT_INDEX
+#undef CSS_HEIGHT_MASK
+#undef CSS_HEIGHT_SHIFT
+#undef CSS_HEIGHT_INDEX
-#define LINE_HEIGHT_INDEX 11
-#define LINE_HEIGHT_SHIFT 2
-#define LINE_HEIGHT_MASK 0xfc
+#define CSS_LINE_HEIGHT_INDEX 11
+#define CSS_LINE_HEIGHT_SHIFT 2
+#define CSS_LINE_HEIGHT_MASK 0xfc
static inline uint8_t css_computed_line_height(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[LINE_HEIGHT_INDEX];
- bits &= LINE_HEIGHT_MASK;
- bits >>= LINE_HEIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_LINE_HEIGHT_INDEX];
+ bits &= CSS_LINE_HEIGHT_MASK;
+ bits >>= CSS_LINE_HEIGHT_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
@@ -1230,60 +1231,60 @@ static inline uint8_t css_computed_line_height(
return (bits & 0x3);
}
-#undef LINE_HEIGHT_MASK
-#undef LINE_HEIGHT_SHIFT
-#undef LINE_HEIGHT_INDEX
+#undef CSS_LINE_HEIGHT_MASK
+#undef CSS_LINE_HEIGHT_SHIFT
+#undef CSS_LINE_HEIGHT_INDEX
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 0
-#define BACKGROUND_COLOR_MASK 0x3
+#define CSS_BACKGROUND_COLOR_INDEX 10
+#define CSS_BACKGROUND_COLOR_SHIFT 0
+#define CSS_BACKGROUND_COLOR_MASK 0x3
static inline uint8_t css_computed_background_color(
const css_computed_style *style,
css_color *color)
{
- uint8_t bits = style->bits[BACKGROUND_COLOR_INDEX];
- bits &= BACKGROUND_COLOR_MASK;
- bits >>= BACKGROUND_COLOR_SHIFT;
+ uint8_t bits = style->bits[CSS_BACKGROUND_COLOR_INDEX];
+ bits &= CSS_BACKGROUND_COLOR_MASK;
+ bits >>= CSS_BACKGROUND_COLOR_SHIFT;
/* 2bits: type */
*color = style->background_color;
return bits;
}
-#undef BACKGROUND_COLOR_MASK
-#undef BACKGROUND_COLOR_SHIFT
-#undef BACKGROUND_COLOR_INDEX
+#undef CSS_BACKGROUND_COLOR_MASK
+#undef CSS_BACKGROUND_COLOR_SHIFT
+#undef CSS_BACKGROUND_COLOR_INDEX
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 0
-#define Z_INDEX_MASK 0x3
+#define CSS_Z_INDEX_INDEX 11
+#define CSS_Z_INDEX_SHIFT 0
+#define CSS_Z_INDEX_MASK 0x3
static inline uint8_t css_computed_z_index(
const css_computed_style *style,
int32_t *z_index)
{
- uint8_t bits = style->bits[Z_INDEX_INDEX];
- bits &= Z_INDEX_MASK;
- bits >>= Z_INDEX_SHIFT;
+ uint8_t bits = style->bits[CSS_Z_INDEX_INDEX];
+ bits &= CSS_Z_INDEX_MASK;
+ bits >>= CSS_Z_INDEX_SHIFT;
/* 2bits: type */
*z_index = style->z_index;
return bits;
}
-#undef Z_INDEX_MASK
-#undef Z_INDEX_SHIFT
-#undef Z_INDEX_INDEX
+#undef CSS_Z_INDEX_MASK
+#undef CSS_Z_INDEX_SHIFT
+#undef CSS_Z_INDEX_INDEX
-#define MARGIN_TOP_INDEX 12
-#define MARGIN_TOP_SHIFT 2
-#define MARGIN_TOP_MASK 0xfc
+#define CSS_MARGIN_TOP_INDEX 12
+#define CSS_MARGIN_TOP_SHIFT 2
+#define CSS_MARGIN_TOP_MASK 0xfc
static inline uint8_t css_computed_margin_top(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MARGIN_TOP_INDEX];
- bits &= MARGIN_TOP_MASK;
- bits >>= MARGIN_TOP_SHIFT;
+ uint8_t bits = style->bits[CSS_MARGIN_TOP_INDEX];
+ bits &= CSS_MARGIN_TOP_MASK;
+ bits >>= CSS_MARGIN_TOP_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_MARGIN_SET) {
@@ -1293,20 +1294,20 @@ static inline uint8_t css_computed_margin_top(
return (bits & 0x3);
}
-#undef MARGIN_TOP_MASK
-#undef MARGIN_TOP_SHIFT
-#undef MARGIN_TOP_INDEX
+#undef CSS_MARGIN_TOP_MASK
+#undef CSS_MARGIN_TOP_SHIFT
+#undef CSS_MARGIN_TOP_INDEX
-#define MARGIN_RIGHT_INDEX 13
-#define MARGIN_RIGHT_SHIFT 2
-#define MARGIN_RIGHT_MASK 0xfc
+#define CSS_MARGIN_RIGHT_INDEX 13
+#define CSS_MARGIN_RIGHT_SHIFT 2
+#define CSS_MARGIN_RIGHT_MASK 0xfc
static inline uint8_t css_computed_margin_right(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MARGIN_RIGHT_INDEX];
- bits &= MARGIN_RIGHT_MASK;
- bits >>= MARGIN_RIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_MARGIN_RIGHT_INDEX];
+ bits &= CSS_MARGIN_RIGHT_MASK;
+ bits >>= CSS_MARGIN_RIGHT_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_MARGIN_SET) {
@@ -1316,20 +1317,20 @@ static inline uint8_t css_computed_margin_right(
return (bits & 0x3);
}
-#undef MARGIN_RIGHT_MASK
-#undef MARGIN_RIGHT_SHIFT
-#undef MARGIN_RIGHT_INDEX
+#undef CSS_MARGIN_RIGHT_MASK
+#undef CSS_MARGIN_RIGHT_SHIFT
+#undef CSS_MARGIN_RIGHT_INDEX
-#define MARGIN_BOTTOM_INDEX 14
-#define MARGIN_BOTTOM_SHIFT 2
-#define MARGIN_BOTTOM_MASK 0xfc
+#define CSS_MARGIN_BOTTOM_INDEX 14
+#define CSS_MARGIN_BOTTOM_SHIFT 2
+#define CSS_MARGIN_BOTTOM_MASK 0xfc
static inline uint8_t css_computed_margin_bottom(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MARGIN_BOTTOM_INDEX];
- bits &= MARGIN_BOTTOM_MASK;
- bits >>= MARGIN_BOTTOM_SHIFT;
+ uint8_t bits = style->bits[CSS_MARGIN_BOTTOM_INDEX];
+ bits &= CSS_MARGIN_BOTTOM_MASK;
+ bits >>= CSS_MARGIN_BOTTOM_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_MARGIN_SET) {
@@ -1339,20 +1340,20 @@ static inline uint8_t css_computed_margin_bottom(
return (bits & 0x3);
}
-#undef MARGIN_BOTTOM_MASK
-#undef MARGIN_BOTTOM_SHIFT
-#undef MARGIN_BOTTOM_INDEX
+#undef CSS_MARGIN_BOTTOM_MASK
+#undef CSS_MARGIN_BOTTOM_SHIFT
+#undef CSS_MARGIN_BOTTOM_INDEX
-#define MARGIN_LEFT_INDEX 15
-#define MARGIN_LEFT_SHIFT 2
-#define MARGIN_LEFT_MASK 0xfc
+#define CSS_MARGIN_LEFT_INDEX 15
+#define CSS_MARGIN_LEFT_SHIFT 2
+#define CSS_MARGIN_LEFT_MASK 0xfc
static inline uint8_t css_computed_margin_left(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MARGIN_LEFT_INDEX];
- bits &= MARGIN_LEFT_MASK;
- bits >>= MARGIN_LEFT_SHIFT;
+ uint8_t bits = style->bits[CSS_MARGIN_LEFT_INDEX];
+ bits &= CSS_MARGIN_LEFT_MASK;
+ bits >>= CSS_MARGIN_LEFT_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_MARGIN_SET) {
@@ -1362,88 +1363,88 @@ static inline uint8_t css_computed_margin_left(
return (bits & 0x3);
}
-#undef MARGIN_LEFT_MASK
-#undef MARGIN_LEFT_SHIFT
-#undef MARGIN_LEFT_INDEX
+#undef CSS_MARGIN_LEFT_MASK
+#undef CSS_MARGIN_LEFT_SHIFT
+#undef CSS_MARGIN_LEFT_INDEX
-#define BACKGROUND_ATTACHMENT_INDEX 12
-#define BACKGROUND_ATTACHMENT_SHIFT 0
-#define BACKGROUND_ATTACHMENT_MASK 0x3
+#define CSS_BACKGROUND_ATTACHMENT_INDEX 12
+#define CSS_BACKGROUND_ATTACHMENT_SHIFT 0
+#define CSS_BACKGROUND_ATTACHMENT_MASK 0x3
static inline uint8_t css_computed_background_attachment(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BACKGROUND_ATTACHMENT_INDEX];
- bits &= BACKGROUND_ATTACHMENT_MASK;
- bits >>= BACKGROUND_ATTACHMENT_SHIFT;
+ uint8_t bits = style->bits[CSS_BACKGROUND_ATTACHMENT_INDEX];
+ bits &= CSS_BACKGROUND_ATTACHMENT_MASK;
+ bits >>= CSS_BACKGROUND_ATTACHMENT_SHIFT;
/* 2bits: type */
return bits;
}
-#undef BACKGROUND_ATTACHMENT_MASK
-#undef BACKGROUND_ATTACHMENT_SHIFT
-#undef BACKGROUND_ATTACHMENT_INDEX
+#undef CSS_BACKGROUND_ATTACHMENT_MASK
+#undef CSS_BACKGROUND_ATTACHMENT_SHIFT
+#undef CSS_BACKGROUND_ATTACHMENT_INDEX
-#define BORDER_COLLAPSE_INDEX 13
-#define BORDER_COLLAPSE_SHIFT 0
-#define BORDER_COLLAPSE_MASK 0x3
+#define CSS_BORDER_COLLAPSE_INDEX 13
+#define CSS_BORDER_COLLAPSE_SHIFT 0
+#define CSS_BORDER_COLLAPSE_MASK 0x3
static inline uint8_t css_computed_border_collapse(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BORDER_COLLAPSE_INDEX];
- bits &= BORDER_COLLAPSE_MASK;
- bits >>= BORDER_COLLAPSE_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_COLLAPSE_INDEX];
+ bits &= CSS_BORDER_COLLAPSE_MASK;
+ bits >>= CSS_BORDER_COLLAPSE_SHIFT;
/* 2bits: type */
return bits;
}
-#undef BORDER_COLLAPSE_MASK
-#undef BORDER_COLLAPSE_SHIFT
-#undef BORDER_COLLAPSE_INDEX
+#undef CSS_BORDER_COLLAPSE_MASK
+#undef CSS_BORDER_COLLAPSE_SHIFT
+#undef CSS_BORDER_COLLAPSE_INDEX
-#define CAPTION_SIDE_INDEX 14
-#define CAPTION_SIDE_SHIFT 0
-#define CAPTION_SIDE_MASK 0x3
+#define CSS_CAPTION_SIDE_INDEX 14
+#define CSS_CAPTION_SIDE_SHIFT 0
+#define CSS_CAPTION_SIDE_MASK 0x3
static inline uint8_t css_computed_caption_side(
const css_computed_style *style)
{
- uint8_t bits = style->bits[CAPTION_SIDE_INDEX];
- bits &= CAPTION_SIDE_MASK;
- bits >>= CAPTION_SIDE_SHIFT;
+ uint8_t bits = style->bits[CSS_CAPTION_SIDE_INDEX];
+ bits &= CSS_CAPTION_SIDE_MASK;
+ bits >>= CSS_CAPTION_SIDE_SHIFT;
/* 2bits: type */
return bits;
}
-#undef CAPTION_SIDE_MASK
-#undef CAPTION_SIDE_SHIFT
-#undef CAPTION_SIDE_INDEX
+#undef CSS_CAPTION_SIDE_MASK
+#undef CSS_CAPTION_SIDE_SHIFT
+#undef CSS_CAPTION_SIDE_INDEX
-#define DIRECTION_INDEX 15
-#define DIRECTION_SHIFT 0
-#define DIRECTION_MASK 0x3
+#define CSS_DIRECTION_INDEX 15
+#define CSS_DIRECTION_SHIFT 0
+#define CSS_DIRECTION_MASK 0x3
static inline uint8_t css_computed_direction(
const css_computed_style *style)
{
- uint8_t bits = style->bits[DIRECTION_INDEX];
- bits &= DIRECTION_MASK;
- bits >>= DIRECTION_SHIFT;
+ uint8_t bits = style->bits[CSS_DIRECTION_INDEX];
+ bits &= CSS_DIRECTION_MASK;
+ bits >>= CSS_DIRECTION_SHIFT;
/* 2bits: type */
return bits;
}
-#undef DIRECTION_MASK
-#undef DIRECTION_SHIFT
-#undef DIRECTION_INDEX
+#undef CSS_DIRECTION_MASK
+#undef CSS_DIRECTION_SHIFT
+#undef CSS_DIRECTION_INDEX
-#define MAX_HEIGHT_INDEX 16
-#define MAX_HEIGHT_SHIFT 2
-#define MAX_HEIGHT_MASK 0xfc
+#define CSS_MAX_HEIGHT_INDEX 16
+#define CSS_MAX_HEIGHT_SHIFT 2
+#define CSS_MAX_HEIGHT_MASK 0xfc
static inline uint8_t css_computed_max_height(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MAX_HEIGHT_INDEX];
- bits &= MAX_HEIGHT_MASK;
- bits >>= MAX_HEIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_MAX_HEIGHT_INDEX];
+ bits &= CSS_MAX_HEIGHT_MASK;
+ bits >>= CSS_MAX_HEIGHT_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_MAX_HEIGHT_SET) {
@@ -1453,20 +1454,20 @@ static inline uint8_t css_computed_max_height(
return (bits & 0x3);
}
-#undef MAX_HEIGHT_MASK
-#undef MAX_HEIGHT_SHIFT
-#undef MAX_HEIGHT_INDEX
+#undef CSS_MAX_HEIGHT_MASK
+#undef CSS_MAX_HEIGHT_SHIFT
+#undef CSS_MAX_HEIGHT_INDEX
-#define MAX_WIDTH_INDEX 17
-#define MAX_WIDTH_SHIFT 2
-#define MAX_WIDTH_MASK 0xfc
+#define CSS_MAX_WIDTH_INDEX 17
+#define CSS_MAX_WIDTH_SHIFT 2
+#define CSS_MAX_WIDTH_MASK 0xfc
static inline uint8_t css_computed_max_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MAX_WIDTH_INDEX];
- bits &= MAX_WIDTH_MASK;
- bits >>= MAX_WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_MAX_WIDTH_INDEX];
+ bits &= CSS_MAX_WIDTH_MASK;
+ bits >>= CSS_MAX_WIDTH_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_MAX_WIDTH_SET) {
@@ -1476,20 +1477,20 @@ static inline uint8_t css_computed_max_width(
return (bits & 0x3);
}
-#undef MAX_WIDTH_MASK
-#undef MAX_WIDTH_SHIFT
-#undef MAX_WIDTH_INDEX
+#undef CSS_MAX_WIDTH_MASK
+#undef CSS_MAX_WIDTH_SHIFT
+#undef CSS_MAX_WIDTH_INDEX
-#define WIDTH_INDEX 18
-#define WIDTH_SHIFT 2
-#define WIDTH_MASK 0xfc
+#define CSS_WIDTH_INDEX 18
+#define CSS_WIDTH_SHIFT 2
+#define CSS_WIDTH_MASK 0xfc
static inline uint8_t css_computed_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[WIDTH_INDEX];
- bits &= WIDTH_MASK;
- bits >>= WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_WIDTH_INDEX];
+ bits &= CSS_WIDTH_MASK;
+ bits >>= CSS_WIDTH_SHIFT;
/* 6bits: uuuutt : units | type */
if ((bits & 0x3) == CSS_WIDTH_SET) {
@@ -1499,36 +1500,36 @@ static inline uint8_t css_computed_width(
return (bits & 0x3);
}
-#undef WIDTH_MASK
-#undef WIDTH_SHIFT
-#undef WIDTH_INDEX
+#undef CSS_WIDTH_MASK
+#undef CSS_WIDTH_SHIFT
+#undef CSS_WIDTH_INDEX
-#define EMPTY_CELLS_INDEX 16
-#define EMPTY_CELLS_SHIFT 0
-#define EMPTY_CELLS_MASK 0x3
+#define CSS_EMPTY_CELLS_INDEX 16
+#define CSS_EMPTY_CELLS_SHIFT 0
+#define CSS_EMPTY_CELLS_MASK 0x3
static inline uint8_t css_computed_empty_cells(
const css_computed_style *style)
{
- uint8_t bits = style->bits[EMPTY_CELLS_INDEX];
- bits &= EMPTY_CELLS_MASK;
- bits >>= EMPTY_CELLS_SHIFT;
+ uint8_t bits = style->bits[CSS_EMPTY_CELLS_INDEX];
+ bits &= CSS_EMPTY_CELLS_MASK;
+ bits >>= CSS_EMPTY_CELLS_SHIFT;
/* 2bits: type */
return bits;
}
-#undef EMPTY_CELLS_MASK
-#undef EMPTY_CELLS_SHIFT
-#undef EMPTY_CELLS_INDEX
+#undef CSS_EMPTY_CELLS_MASK
+#undef CSS_EMPTY_CELLS_SHIFT
+#undef CSS_EMPTY_CELLS_INDEX
-#define FLOAT_INDEX 17
-#define FLOAT_SHIFT 0
-#define FLOAT_MASK 0x3
+#define CSS_FLOAT_INDEX 17
+#define CSS_FLOAT_SHIFT 0
+#define CSS_FLOAT_MASK 0x3
static inline uint8_t css_computed_float(
const css_computed_style *style)
{
- uint8_t bits = style->bits[FLOAT_INDEX];
- bits &= FLOAT_MASK;
- bits >>= FLOAT_SHIFT;
+ uint8_t bits = style->bits[CSS_FLOAT_INDEX];
+ bits &= CSS_FLOAT_MASK;
+ bits >>= CSS_FLOAT_SHIFT;
/* Fix up as per $9.7:2 */
if (css_computed_position(style) == CSS_POSITION_ABSOLUTE ||
@@ -1538,37 +1539,37 @@ static inline uint8_t css_computed_float(
/* 2bits: type */
return bits;
}
-#undef FLOAT_MASK
-#undef FLOAT_SHIFT
-#undef FLOAT_INDEX
+#undef CSS_FLOAT_MASK
+#undef CSS_FLOAT_SHIFT
+#undef CSS_FLOAT_INDEX
-#define FONT_STYLE_INDEX 18
-#define FONT_STYLE_SHIFT 0
-#define FONT_STYLE_MASK 0x3
+#define CSS_FONT_STYLE_INDEX 18
+#define CSS_FONT_STYLE_SHIFT 0
+#define CSS_FONT_STYLE_MASK 0x3
static inline uint8_t css_computed_font_style(
const css_computed_style *style)
{
- uint8_t bits = style->bits[FONT_STYLE_INDEX];
- bits &= FONT_STYLE_MASK;
- bits >>= FONT_STYLE_SHIFT;
+ uint8_t bits = style->bits[CSS_FONT_STYLE_INDEX];
+ bits &= CSS_FONT_STYLE_MASK;
+ bits >>= CSS_FONT_STYLE_SHIFT;
/* 2bits: type */
return bits;
}
-#undef FONT_STYLE_MASK
-#undef FONT_STYLE_SHIFT
-#undef FONT_STYLE_INDEX
+#undef CSS_FONT_STYLE_MASK
+#undef CSS_FONT_STYLE_SHIFT
+#undef CSS_FONT_STYLE_INDEX
-#define MIN_HEIGHT_INDEX 19
-#define MIN_HEIGHT_SHIFT 3
-#define MIN_HEIGHT_MASK 0xf8
+#define CSS_MIN_HEIGHT_INDEX 19
+#define CSS_MIN_HEIGHT_SHIFT 3
+#define CSS_MIN_HEIGHT_MASK 0xf8
static inline uint8_t css_computed_min_height(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MIN_HEIGHT_INDEX];
- bits &= MIN_HEIGHT_MASK;
- bits >>= MIN_HEIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_MIN_HEIGHT_INDEX];
+ bits &= CSS_MIN_HEIGHT_MASK;
+ bits >>= CSS_MIN_HEIGHT_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_MIN_HEIGHT_SET) {
@@ -1578,20 +1579,20 @@ static inline uint8_t css_computed_min_height(
return (bits & 0x1);
}
-#undef MIN_HEIGHT_MASK
-#undef MIN_HEIGHT_SHIFT
-#undef MIN_HEIGHT_INDEX
+#undef CSS_MIN_HEIGHT_MASK
+#undef CSS_MIN_HEIGHT_SHIFT
+#undef CSS_MIN_HEIGHT_INDEX
-#define MIN_WIDTH_INDEX 20
-#define MIN_WIDTH_SHIFT 3
-#define MIN_WIDTH_MASK 0xf8
+#define CSS_MIN_WIDTH_INDEX 20
+#define CSS_MIN_WIDTH_SHIFT 3
+#define CSS_MIN_WIDTH_MASK 0xf8
static inline uint8_t css_computed_min_width(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[MIN_WIDTH_INDEX];
- bits &= MIN_WIDTH_MASK;
- bits >>= MIN_WIDTH_SHIFT;
+ uint8_t bits = style->bits[CSS_MIN_WIDTH_INDEX];
+ bits &= CSS_MIN_WIDTH_MASK;
+ bits >>= CSS_MIN_WIDTH_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_MIN_WIDTH_SET) {
@@ -1601,54 +1602,54 @@ static inline uint8_t css_computed_min_width(
return (bits & 0x1);
}
-#undef MIN_WIDTH_MASK
-#undef MIN_WIDTH_SHIFT
-#undef MIN_WIDTH_INDEX
+#undef CSS_MIN_WIDTH_MASK
+#undef CSS_MIN_WIDTH_SHIFT
+#undef CSS_MIN_WIDTH_INDEX
-#define BACKGROUND_REPEAT_INDEX 19
-#define BACKGROUND_REPEAT_SHIFT 0
-#define BACKGROUND_REPEAT_MASK 0x7
+#define CSS_BACKGROUND_REPEAT_INDEX 19
+#define CSS_BACKGROUND_REPEAT_SHIFT 0
+#define CSS_BACKGROUND_REPEAT_MASK 0x7
static inline uint8_t css_computed_background_repeat(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BACKGROUND_REPEAT_INDEX];
- bits &= BACKGROUND_REPEAT_MASK;
- bits >>= BACKGROUND_REPEAT_SHIFT;
+ uint8_t bits = style->bits[CSS_BACKGROUND_REPEAT_INDEX];
+ bits &= CSS_BACKGROUND_REPEAT_MASK;
+ bits >>= CSS_BACKGROUND_REPEAT_SHIFT;
/* 3bits: type */
return bits;
}
-#undef BACKGROUND_REPEAT_MASK
-#undef BACKGROUND_REPEAT_SHIFT
-#undef BACKGROUND_REPEAT_INDEX
+#undef CSS_BACKGROUND_REPEAT_MASK
+#undef CSS_BACKGROUND_REPEAT_SHIFT
+#undef CSS_BACKGROUND_REPEAT_INDEX
-#define CLEAR_INDEX 20
-#define CLEAR_SHIFT 0
-#define CLEAR_MASK 0x7
+#define CSS_CLEAR_INDEX 20
+#define CSS_CLEAR_SHIFT 0
+#define CSS_CLEAR_MASK 0x7
static inline uint8_t css_computed_clear(
const css_computed_style *style)
{
- uint8_t bits = style->bits[CLEAR_INDEX];
- bits &= CLEAR_MASK;
- bits >>= CLEAR_SHIFT;
+ uint8_t bits = style->bits[CSS_CLEAR_INDEX];
+ bits &= CSS_CLEAR_MASK;
+ bits >>= CSS_CLEAR_SHIFT;
/* 3bits: type */
return bits;
}
-#undef CLEAR_MASK
-#undef CLEAR_SHIFT
-#undef CLEAR_INDEX
+#undef CSS_CLEAR_MASK
+#undef CSS_CLEAR_SHIFT
+#undef CSS_CLEAR_INDEX
-#define PADDING_TOP_INDEX 21
-#define PADDING_TOP_SHIFT 3
-#define PADDING_TOP_MASK 0xf8
+#define CSS_PADDING_TOP_INDEX 21
+#define CSS_PADDING_TOP_SHIFT 3
+#define CSS_PADDING_TOP_MASK 0xf8
static inline uint8_t css_computed_padding_top(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[PADDING_TOP_INDEX];
- bits &= PADDING_TOP_MASK;
- bits >>= PADDING_TOP_SHIFT;
+ uint8_t bits = style->bits[CSS_PADDING_TOP_INDEX];
+ bits &= CSS_PADDING_TOP_MASK;
+ bits >>= CSS_PADDING_TOP_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_PADDING_SET) {
@@ -1658,20 +1659,20 @@ static inline uint8_t css_computed_padding_top(
return (bits & 0x1);
}
-#undef PADDING_TOP_MASK
-#undef PADDING_TOP_SHIFT
-#undef PADDING_TOP_INDEX
+#undef CSS_PADDING_TOP_MASK
+#undef CSS_PADDING_TOP_SHIFT
+#undef CSS_PADDING_TOP_INDEX
-#define PADDING_RIGHT_INDEX 22
-#define PADDING_RIGHT_SHIFT 3
-#define PADDING_RIGHT_MASK 0xf8
+#define CSS_PADDING_RIGHT_INDEX 22
+#define CSS_PADDING_RIGHT_SHIFT 3
+#define CSS_PADDING_RIGHT_MASK 0xf8
static inline uint8_t css_computed_padding_right(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[PADDING_RIGHT_INDEX];
- bits &= PADDING_RIGHT_MASK;
- bits >>= PADDING_RIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_PADDING_RIGHT_INDEX];
+ bits &= CSS_PADDING_RIGHT_MASK;
+ bits >>= CSS_PADDING_RIGHT_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_PADDING_SET) {
@@ -1681,20 +1682,20 @@ static inline uint8_t css_computed_padding_right(
return (bits & 0x1);
}
-#undef PADDING_RIGHT_MASK
-#undef PADDING_RIGHT_SHIFT
-#undef PADDING_RIGHT_INDEX
+#undef CSS_PADDING_RIGHT_MASK
+#undef CSS_PADDING_RIGHT_SHIFT
+#undef CSS_PADDING_RIGHT_INDEX
-#define PADDING_BOTTOM_INDEX 23
-#define PADDING_BOTTOM_SHIFT 3
-#define PADDING_BOTTOM_MASK 0xf8
+#define CSS_PADDING_BOTTOM_INDEX 23
+#define CSS_PADDING_BOTTOM_SHIFT 3
+#define CSS_PADDING_BOTTOM_MASK 0xf8
static inline uint8_t css_computed_padding_bottom(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[PADDING_BOTTOM_INDEX];
- bits &= PADDING_BOTTOM_MASK;
- bits >>= PADDING_BOTTOM_SHIFT;
+ uint8_t bits = style->bits[CSS_PADDING_BOTTOM_INDEX];
+ bits &= CSS_PADDING_BOTTOM_MASK;
+ bits >>= CSS_PADDING_BOTTOM_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_PADDING_SET) {
@@ -1704,20 +1705,20 @@ static inline uint8_t css_computed_padding_bottom(
return (bits & 0x1);
}
-#undef PADDING_BOTTOM_MASK
-#undef PADDING_BOTTOM_SHIFT
-#undef PADDING_BOTTOM_INDEX
+#undef CSS_PADDING_BOTTOM_MASK
+#undef CSS_PADDING_BOTTOM_SHIFT
+#undef CSS_PADDING_BOTTOM_INDEX
-#define PADDING_LEFT_INDEX 24
-#define PADDING_LEFT_SHIFT 3
-#define PADDING_LEFT_MASK 0xf8
+#define CSS_PADDING_LEFT_INDEX 24
+#define CSS_PADDING_LEFT_SHIFT 3
+#define CSS_PADDING_LEFT_MASK 0xf8
static inline uint8_t css_computed_padding_left(
const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- uint8_t bits = style->bits[PADDING_LEFT_INDEX];
- bits &= PADDING_LEFT_MASK;
- bits >>= PADDING_LEFT_SHIFT;
+ uint8_t bits = style->bits[CSS_PADDING_LEFT_INDEX];
+ bits &= CSS_PADDING_LEFT_MASK;
+ bits >>= CSS_PADDING_LEFT_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_PADDING_SET) {
@@ -1727,71 +1728,71 @@ static inline uint8_t css_computed_padding_left(
return (bits & 0x1);
}
-#undef PADDING_LEFT_MASK
-#undef PADDING_LEFT_SHIFT
-#undef PADDING_LEFT_INDEX
+#undef CSS_PADDING_LEFT_MASK
+#undef CSS_PADDING_LEFT_SHIFT
+#undef CSS_PADDING_LEFT_INDEX
-#define OVERFLOW_INDEX 21
-#define OVERFLOW_SHIFT 0
-#define OVERFLOW_MASK 0x7
+#define CSS_OVERFLOW_INDEX 21
+#define CSS_OVERFLOW_SHIFT 0
+#define CSS_OVERFLOW_MASK 0x7
static inline uint8_t css_computed_overflow(
const css_computed_style *style)
{
- uint8_t bits = style->bits[OVERFLOW_INDEX];
- bits &= OVERFLOW_MASK;
- bits >>= OVERFLOW_SHIFT;
+ uint8_t bits = style->bits[CSS_OVERFLOW_INDEX];
+ bits &= CSS_OVERFLOW_MASK;
+ bits >>= CSS_OVERFLOW_SHIFT;
/* 3bits: type */
return bits;
}
-#undef OVERFLOW_MASK
-#undef OVERFLOW_SHIFT
-#undef OVERFLOW_INDEX
+#undef CSS_OVERFLOW_MASK
+#undef CSS_OVERFLOW_SHIFT
+#undef CSS_OVERFLOW_INDEX
-#define POSITION_INDEX 22
-#define POSITION_SHIFT 0
-#define POSITION_MASK 0x7
+#define CSS_POSITION_INDEX 22
+#define CSS_POSITION_SHIFT 0
+#define CSS_POSITION_MASK 0x7
static inline uint8_t css_computed_position(
const css_computed_style *style)
{
- uint8_t bits = style->bits[POSITION_INDEX];
- bits &= POSITION_MASK;
- bits >>= POSITION_SHIFT;
+ uint8_t bits = style->bits[CSS_POSITION_INDEX];
+ bits &= CSS_POSITION_MASK;
+ bits >>= CSS_POSITION_SHIFT;
/* 3bits: type */
return bits;
}
-#undef POSITION_MASK
-#undef POSITION_SHIFT
-#undef POSITION_INDEX
+#undef CSS_POSITION_MASK
+#undef CSS_POSITION_SHIFT
+#undef CSS_POSITION_INDEX
-#define TEXT_TRANSFORM_INDEX 24
-#define TEXT_TRANSFORM_SHIFT 0
-#define TEXT_TRANSFORM_MASK 0x7
+#define CSS_TEXT_TRANSFORM_INDEX 24
+#define CSS_TEXT_TRANSFORM_SHIFT 0
+#define CSS_TEXT_TRANSFORM_MASK 0x7
static inline uint8_t css_computed_text_transform(
const css_computed_style *style)
{
- uint8_t bits = style->bits[TEXT_TRANSFORM_INDEX];
- bits &= TEXT_TRANSFORM_MASK;
- bits >>= TEXT_TRANSFORM_SHIFT;
+ uint8_t bits = style->bits[CSS_TEXT_TRANSFORM_INDEX];
+ bits &= CSS_TEXT_TRANSFORM_MASK;
+ bits >>= CSS_TEXT_TRANSFORM_SHIFT;
/* 3bits: type */
return bits;
}
-#undef TEXT_TRANSFORM_MASK
-#undef TEXT_TRANSFORM_SHIFT
-#undef TEXT_TRANSFORM_INDEX
+#undef CSS_TEXT_TRANSFORM_MASK
+#undef CSS_TEXT_TRANSFORM_SHIFT
+#undef CSS_TEXT_TRANSFORM_INDEX
-#define TEXT_INDENT_INDEX 25
-#define TEXT_INDENT_SHIFT 3
-#define TEXT_INDENT_MASK 0xf8
+#define CSS_TEXT_INDENT_INDEX 25
+#define CSS_TEXT_INDENT_SHIFT 3
+#define CSS_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;
+ uint8_t bits = style->bits[CSS_TEXT_INDENT_INDEX];
+ bits &= CSS_TEXT_INDENT_MASK;
+ bits >>= CSS_TEXT_INDENT_SHIFT;
/* 5bits: uuuut : units | type */
if ((bits & 0x1) == CSS_TEXT_INDENT_SET) {
@@ -1801,47 +1802,47 @@ static inline uint8_t css_computed_text_indent(
return (bits & 0x1);
}
-#undef TEXT_INDENT_MASK
-#undef TEXT_INDENT_SHIFT
-#undef TEXT_INDENT_INDEX
+#undef CSS_TEXT_INDENT_MASK
+#undef CSS_TEXT_INDENT_SHIFT
+#undef CSS_TEXT_INDENT_INDEX
-#define WHITE_SPACE_INDEX 25
-#define WHITE_SPACE_SHIFT 0
-#define WHITE_SPACE_MASK 0x7
+#define CSS_WHITE_SPACE_INDEX 25
+#define CSS_WHITE_SPACE_SHIFT 0
+#define CSS_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;
+ uint8_t bits = style->bits[CSS_WHITE_SPACE_INDEX];
+ bits &= CSS_WHITE_SPACE_MASK;
+ bits >>= CSS_WHITE_SPACE_SHIFT;
/* 3bits: type */
return bits;
}
-#undef WHITE_SPACE_MASK
-#undef WHITE_SPACE_SHIFT
-#undef WHITE_SPACE_INDEX
+#undef CSS_WHITE_SPACE_MASK
+#undef CSS_WHITE_SPACE_SHIFT
+#undef CSS_WHITE_SPACE_INDEX
-#define BACKGROUND_POSITION_INDEX 27
-#define BACKGROUND_POSITION_SHIFT 7
-#define BACKGROUND_POSITION_MASK 0x80
-#define BACKGROUND_POSITION_INDEX1 26
-#define BACKGROUND_POSITION_SHIFT1 0
-#define BACKGROUND_POSITION_MASK1 0xff
+#define CSS_BACKGROUND_POSITION_INDEX 27
+#define CSS_BACKGROUND_POSITION_SHIFT 7
+#define CSS_BACKGROUND_POSITION_MASK 0x80
+#define CSS_BACKGROUND_POSITION_INDEX1 26
+#define CSS_BACKGROUND_POSITION_SHIFT1 0
+#define CSS_BACKGROUND_POSITION_MASK1 0xff
static inline uint8_t css_computed_background_position(
const css_computed_style *style,
css_fixed *hlength, css_unit *hunit,
css_fixed *vlength, css_unit *vunit)
{
- uint8_t bits = style->bits[BACKGROUND_POSITION_INDEX];
- bits &= BACKGROUND_POSITION_MASK;
- bits >>= BACKGROUND_POSITION_SHIFT;
+ uint8_t bits = style->bits[CSS_BACKGROUND_POSITION_INDEX];
+ bits &= CSS_BACKGROUND_POSITION_MASK;
+ bits >>= CSS_BACKGROUND_POSITION_SHIFT;
/* 1bit: type */
if (bits == CSS_BACKGROUND_POSITION_SET) {
- uint8_t bits1 = style->bits[BACKGROUND_POSITION_INDEX1];
- bits1 &= BACKGROUND_POSITION_MASK1;
- bits1 >>= BACKGROUND_POSITION_SHIFT1;
+ uint8_t bits1 = style->bits[CSS_BACKGROUND_POSITION_INDEX1];
+ bits1 &= CSS_BACKGROUND_POSITION_MASK1;
+ bits1 >>= CSS_BACKGROUND_POSITION_SHIFT1;
/* 8bits: hhhhvvvv : hunit | vunit */
*hlength = style->background_position[0];
@@ -1853,23 +1854,23 @@ static inline uint8_t css_computed_background_position(
return bits;
}
-#undef BACKGROUND_POSITION_MASK1
-#undef BACKGROUND_POSITION_SHIFT1
-#undef BACKGROUND_POSITION_INDEX1
-#undef BACKGROUND_POSITION_MASK
-#undef BACKGROUND_POSITION_SHIFT
-#undef BACKGROUND_POSITION_INDEX
+#undef CSS_BACKGROUND_POSITION_MASK1
+#undef CSS_BACKGROUND_POSITION_SHIFT1
+#undef CSS_BACKGROUND_POSITION_INDEX1
+#undef CSS_BACKGROUND_POSITION_MASK
+#undef CSS_BACKGROUND_POSITION_SHIFT
+#undef CSS_BACKGROUND_POSITION_INDEX
-#define DISPLAY_INDEX 27
-#define DISPLAY_SHIFT 2
-#define DISPLAY_MASK 0x7c
+#define CSS_DISPLAY_INDEX 27
+#define CSS_DISPLAY_SHIFT 2
+#define CSS_DISPLAY_MASK 0x7c
static inline uint8_t css_computed_display(
const css_computed_style *style, bool root)
{
uint8_t position;
- uint8_t bits = style->bits[DISPLAY_INDEX];
- bits &= DISPLAY_MASK;
- bits >>= DISPLAY_SHIFT;
+ uint8_t bits = style->bits[CSS_DISPLAY_INDEX];
+ bits &= CSS_DISPLAY_MASK;
+ bits >>= CSS_DISPLAY_SHIFT;
/* Return computed display as per $9.7 */
position = css_computed_position(style);
@@ -1906,274 +1907,274 @@ static inline uint8_t css_computed_display(
static inline uint8_t css_computed_display_static(
const css_computed_style *style)
{
- uint8_t bits = style->bits[DISPLAY_INDEX];
- bits &= DISPLAY_MASK;
- bits >>= DISPLAY_SHIFT;
+ uint8_t bits = style->bits[CSS_DISPLAY_INDEX];
+ bits &= CSS_DISPLAY_MASK;
+ bits >>= CSS_DISPLAY_SHIFT;
/* 5bits: type */
return bits;
}
-#undef DISPLAY_MASK
-#undef DISPLAY_SHIFT
-#undef DISPLAY_INDEX
+#undef CSS_DISPLAY_MASK
+#undef CSS_DISPLAY_SHIFT
+#undef CSS_DISPLAY_INDEX
-#define FONT_VARIANT_INDEX 27
-#define FONT_VARIANT_SHIFT 0
-#define FONT_VARIANT_MASK 0x3
+#define CSS_FONT_VARIANT_INDEX 27
+#define CSS_FONT_VARIANT_SHIFT 0
+#define CSS_FONT_VARIANT_MASK 0x3
static inline uint8_t css_computed_font_variant(
const css_computed_style *style)
{
- uint8_t bits = style->bits[FONT_VARIANT_INDEX];
- bits &= FONT_VARIANT_MASK;
- bits >>= FONT_VARIANT_SHIFT;
+ uint8_t bits = style->bits[CSS_FONT_VARIANT_INDEX];
+ bits &= CSS_FONT_VARIANT_MASK;
+ bits >>= CSS_FONT_VARIANT_SHIFT;
/* 2bits: type */
return bits;
}
-#undef FONT_VARIANT_MASK
-#undef FONT_VARIANT_SHIFT
-#undef FONT_VARIANT_INDEX
+#undef CSS_FONT_VARIANT_MASK
+#undef CSS_FONT_VARIANT_SHIFT
+#undef CSS_FONT_VARIANT_INDEX
-#define TEXT_DECORATION_INDEX 28
-#define TEXT_DECORATION_SHIFT 3
-#define TEXT_DECORATION_MASK 0xf8
+#define CSS_TEXT_DECORATION_INDEX 28
+#define CSS_TEXT_DECORATION_SHIFT 3
+#define CSS_TEXT_DECORATION_MASK 0xf8
static inline uint8_t css_computed_text_decoration(
const css_computed_style *style)
{
- uint8_t bits = style->bits[TEXT_DECORATION_INDEX];
- bits &= TEXT_DECORATION_MASK;
- bits >>= TEXT_DECORATION_SHIFT;
+ uint8_t bits = style->bits[CSS_TEXT_DECORATION_INDEX];
+ bits &= CSS_TEXT_DECORATION_MASK;
+ bits >>= CSS_TEXT_DECORATION_SHIFT;
/* 5bits: type */
return bits;
}
-#undef TEXT_DECORATION_MASK
-#undef TEXT_DECORATION_SHIFT
-#undef TEXT_DECORATION_INDEX
+#undef CSS_TEXT_DECORATION_MASK
+#undef CSS_TEXT_DECORATION_SHIFT
+#undef CSS_TEXT_DECORATION_INDEX
-#define FONT_FAMILY_INDEX 28
-#define FONT_FAMILY_SHIFT 0
-#define FONT_FAMILY_MASK 0x7
+#define CSS_FONT_FAMILY_INDEX 28
+#define CSS_FONT_FAMILY_SHIFT 0
+#define CSS_FONT_FAMILY_MASK 0x7
static inline uint8_t css_computed_font_family(
const css_computed_style *style,
lwc_string ***names)
{
- uint8_t bits = style->bits[FONT_FAMILY_INDEX];
- bits &= FONT_FAMILY_MASK;
- bits >>= FONT_FAMILY_SHIFT;
+ uint8_t bits = style->bits[CSS_FONT_FAMILY_INDEX];
+ bits &= CSS_FONT_FAMILY_MASK;
+ bits >>= CSS_FONT_FAMILY_SHIFT;
/* 3bits: type */
*names = style->font_family;
return bits;
}
-#undef FONT_FAMILY_MASK
-#undef FONT_FAMILY_SHIFT
-#undef FONT_FAMILY_INDEX
+#undef CSS_FONT_FAMILY_MASK
+#undef CSS_FONT_FAMILY_SHIFT
+#undef CSS_FONT_FAMILY_INDEX
-#define BORDER_TOP_STYLE_INDEX 29
-#define BORDER_TOP_STYLE_SHIFT 4
-#define BORDER_TOP_STYLE_MASK 0xf0
+#define CSS_BORDER_TOP_STYLE_INDEX 29
+#define CSS_BORDER_TOP_STYLE_SHIFT 4
+#define CSS_BORDER_TOP_STYLE_MASK 0xf0
static inline uint8_t css_computed_border_top_style(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BORDER_TOP_STYLE_INDEX];
- bits &= BORDER_TOP_STYLE_MASK;
- bits >>= BORDER_TOP_STYLE_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_TOP_STYLE_INDEX];
+ bits &= CSS_BORDER_TOP_STYLE_MASK;
+ bits >>= CSS_BORDER_TOP_STYLE_SHIFT;
/* 4bits: type */
return bits;
}
-#undef BORDER_TOP_STYLE_MASK
-#undef BORDER_TOP_STYLE_SHIFT
-#undef BORDER_TOP_STYLE_INDEX
+#undef CSS_BORDER_TOP_STYLE_MASK
+#undef CSS_BORDER_TOP_STYLE_SHIFT
+#undef CSS_BORDER_TOP_STYLE_INDEX
-#define BORDER_RIGHT_STYLE_INDEX 29
-#define BORDER_RIGHT_STYLE_SHIFT 0
-#define BORDER_RIGHT_STYLE_MASK 0xf
+#define CSS_BORDER_RIGHT_STYLE_INDEX 29
+#define CSS_BORDER_RIGHT_STYLE_SHIFT 0
+#define CSS_BORDER_RIGHT_STYLE_MASK 0xf
static inline uint8_t css_computed_border_right_style(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BORDER_RIGHT_STYLE_INDEX];
- bits &= BORDER_RIGHT_STYLE_MASK;
- bits >>= BORDER_RIGHT_STYLE_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_RIGHT_STYLE_INDEX];
+ bits &= CSS_BORDER_RIGHT_STYLE_MASK;
+ bits >>= CSS_BORDER_RIGHT_STYLE_SHIFT;
/* 4bits: type */
return bits;
}
-#undef BORDER_RIGHT_STYLE_MASK
-#undef BORDER_RIGHT_STYLE_SHIFT
-#undef BORDER_RIGHT_STYLE_INDEX
+#undef CSS_BORDER_RIGHT_STYLE_MASK
+#undef CSS_BORDER_RIGHT_STYLE_SHIFT
+#undef CSS_BORDER_RIGHT_STYLE_INDEX
-#define BORDER_BOTTOM_STYLE_INDEX 30
-#define BORDER_BOTTOM_STYLE_SHIFT 4
-#define BORDER_BOTTOM_STYLE_MASK 0xf0
+#define CSS_BORDER_BOTTOM_STYLE_INDEX 30
+#define CSS_BORDER_BOTTOM_STYLE_SHIFT 4
+#define CSS_BORDER_BOTTOM_STYLE_MASK 0xf0
static inline uint8_t css_computed_border_bottom_style(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BORDER_BOTTOM_STYLE_INDEX];
- bits &= BORDER_BOTTOM_STYLE_MASK;
- bits >>= BORDER_BOTTOM_STYLE_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_BOTTOM_STYLE_INDEX];
+ bits &= CSS_BORDER_BOTTOM_STYLE_MASK;
+ bits >>= CSS_BORDER_BOTTOM_STYLE_SHIFT;
/* 4bits: type */
return bits;
}
-#undef BORDER_BOTTOM_STYLE_MASK
-#undef BORDER_BOTTOM_STYLE_SHIFT
-#undef BORDER_BOTTOM_STYLE_INDEX
+#undef CSS_BORDER_BOTTOM_STYLE_MASK
+#undef CSS_BORDER_BOTTOM_STYLE_SHIFT
+#undef CSS_BORDER_BOTTOM_STYLE_INDEX
-#define BORDER_LEFT_STYLE_INDEX 30
-#define BORDER_LEFT_STYLE_SHIFT 0
-#define BORDER_LEFT_STYLE_MASK 0xf
+#define CSS_BORDER_LEFT_STYLE_INDEX 30
+#define CSS_BORDER_LEFT_STYLE_SHIFT 0
+#define CSS_BORDER_LEFT_STYLE_MASK 0xf
static inline uint8_t css_computed_border_left_style(
const css_computed_style *style)
{
- uint8_t bits = style->bits[BORDER_LEFT_STYLE_INDEX];
- bits &= BORDER_LEFT_STYLE_MASK;
- bits >>= BORDER_LEFT_STYLE_SHIFT;
+ uint8_t bits = style->bits[CSS_BORDER_LEFT_STYLE_INDEX];
+ bits &= CSS_BORDER_LEFT_STYLE_MASK;
+ bits >>= CSS_BORDER_LEFT_STYLE_SHIFT;
/* 4bits: type */
return bits;
}
-#undef BORDER_LEFT_STYLE_MASK
-#undef BORDER_LEFT_STYLE_SHIFT
-#undef BORDER_LEFT_STYLE_INDEX
+#undef CSS_BORDER_LEFT_STYLE_MASK
+#undef CSS_BORDER_LEFT_STYLE_SHIFT
+#undef CSS_BORDER_LEFT_STYLE_INDEX
-#define FONT_WEIGHT_INDEX 31
-#define FONT_WEIGHT_SHIFT 4
-#define FONT_WEIGHT_MASK 0xf0
+#define CSS_FONT_WEIGHT_INDEX 31
+#define CSS_FONT_WEIGHT_SHIFT 4
+#define CSS_FONT_WEIGHT_MASK 0xf0
static inline uint8_t css_computed_font_weight(
const css_computed_style *style)
{
- uint8_t bits = style->bits[FONT_WEIGHT_INDEX];
- bits &= FONT_WEIGHT_MASK;
- bits >>= FONT_WEIGHT_SHIFT;
+ uint8_t bits = style->bits[CSS_FONT_WEIGHT_INDEX];
+ bits &= CSS_FONT_WEIGHT_MASK;
+ bits >>= CSS_FONT_WEIGHT_SHIFT;
/* 4bits: type */
return bits;
}
-#undef FONT_WEIGHT_MASK
-#undef FONT_WEIGHT_SHIFT
-#undef FONT_WEIGHT_INDEX
+#undef CSS_FONT_WEIGHT_MASK
+#undef CSS_FONT_WEIGHT_SHIFT
+#undef CSS_FONT_WEIGHT_INDEX
-#define LIST_STYLE_TYPE_INDEX 31
-#define LIST_STYLE_TYPE_SHIFT 0
-#define LIST_STYLE_TYPE_MASK 0xf
+#define CSS_LIST_STYLE_TYPE_INDEX 31
+#define CSS_LIST_STYLE_TYPE_SHIFT 0
+#define CSS_LIST_STYLE_TYPE_MASK 0xf
static inline uint8_t css_computed_list_style_type(
const css_computed_style *style)
{
- uint8_t bits = style->bits[LIST_STYLE_TYPE_INDEX];
- bits &= LIST_STYLE_TYPE_MASK;
- bits >>= LIST_STYLE_TYPE_SHIFT;
+ uint8_t bits = style->bits[CSS_LIST_STYLE_TYPE_INDEX];
+ bits &= CSS_LIST_STYLE_TYPE_MASK;
+ bits >>= CSS_LIST_STYLE_TYPE_SHIFT;
/* 4bits: type */
return bits;
}
-#undef LIST_STYLE_TYPE_MASK
-#undef LIST_STYLE_TYPE_SHIFT
-#undef LIST_STYLE_TYPE_INDEX
+#undef CSS_LIST_STYLE_TYPE_MASK
+#undef CSS_LIST_STYLE_TYPE_SHIFT
+#undef CSS_LIST_STYLE_TYPE_INDEX
-#define OUTLINE_STYLE_INDEX 32
-#define OUTLINE_STYLE_SHIFT 4
-#define OUTLINE_STYLE_MASK 0xf0
+#define CSS_OUTLINE_STYLE_INDEX 32
+#define CSS_OUTLINE_STYLE_SHIFT 4
+#define CSS_OUTLINE_STYLE_MASK 0xf0
static inline uint8_t css_computed_outline_style(
const css_computed_style *style)
{
- uint8_t bits = style->bits[OUTLINE_STYLE_INDEX];
- bits &= OUTLINE_STYLE_MASK;
- bits >>= OUTLINE_STYLE_SHIFT;
+ uint8_t bits = style->bits[CSS_OUTLINE_STYLE_INDEX];
+ bits &= CSS_OUTLINE_STYLE_MASK;
+ bits >>= CSS_OUTLINE_STYLE_SHIFT;
/* 4bits: type */
return bits;
}
-#undef OUTLINE_STYLE_MASK
-#undef OUTLINE_STYLE_SHIFT
-#undef OUTLINE_STYLE_INDEX
+#undef CSS_OUTLINE_STYLE_MASK
+#undef CSS_OUTLINE_STYLE_SHIFT
+#undef CSS_OUTLINE_STYLE_INDEX
-#define TABLE_LAYOUT_INDEX 32
-#define TABLE_LAYOUT_SHIFT 2
-#define TABLE_LAYOUT_MASK 0xc
+#define CSS_TABLE_LAYOUT_INDEX 32
+#define CSS_TABLE_LAYOUT_SHIFT 2
+#define CSS_TABLE_LAYOUT_MASK 0xc
static inline uint8_t css_computed_table_layout(
const css_computed_style *style)
{
- uint8_t bits = style->bits[TABLE_LAYOUT_INDEX];
- bits &= TABLE_LAYOUT_MASK;
- bits >>= TABLE_LAYOUT_SHIFT;
+ uint8_t bits = style->bits[CSS_TABLE_LAYOUT_INDEX];
+ bits &= CSS_TABLE_LAYOUT_MASK;
+ bits >>= CSS_TABLE_LAYOUT_SHIFT;
/* 2bits: type */
return bits;
}
-#undef TABLE_LAYOUT_MASK
-#undef TABLE_LAYOUT_SHIFT
-#undef TABLE_LAYOUT_INDEX
+#undef CSS_TABLE_LAYOUT_MASK
+#undef CSS_TABLE_LAYOUT_SHIFT
+#undef CSS_TABLE_LAYOUT_INDEX
-#define UNICODE_BIDI_INDEX 32
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
+#define CSS_UNICODE_BIDI_INDEX 32
+#define CSS_UNICODE_BIDI_SHIFT 0
+#define CSS_UNICODE_BIDI_MASK 0x3
static inline uint8_t css_computed_unicode_bidi(
const css_computed_style *style)
{
- uint8_t bits = style->bits[UNICODE_BIDI_INDEX];
- bits &= UNICODE_BIDI_MASK;
- bits >>= UNICODE_BIDI_SHIFT;
+ uint8_t bits = style->bits[CSS_UNICODE_BIDI_INDEX];
+ bits &= CSS_UNICODE_BIDI_MASK;
+ bits >>= CSS_UNICODE_BIDI_SHIFT;
/* 2bits: type */
return bits;
}
-#undef UNICODE_BIDI_MASK
-#undef UNICODE_BIDI_SHIFT
-#undef UNICODE_BIDI_INDEX
+#undef CSS_UNICODE_BIDI_MASK
+#undef CSS_UNICODE_BIDI_SHIFT
+#undef CSS_UNICODE_BIDI_INDEX
-#define VISIBILITY_INDEX 33
-#define VISIBILITY_SHIFT 6
-#define VISIBILITY_MASK 0xc0
+#define CSS_VISIBILITY_INDEX 33
+#define CSS_VISIBILITY_SHIFT 6
+#define CSS_VISIBILITY_MASK 0xc0
static inline uint8_t css_computed_visibility(
const css_computed_style *style)
{
- uint8_t bits = style->bits[VISIBILITY_INDEX];
- bits &= VISIBILITY_MASK;
- bits >>= VISIBILITY_SHIFT;
+ uint8_t bits = style->bits[CSS_VISIBILITY_INDEX];
+ bits &= CSS_VISIBILITY_MASK;
+ bits >>= CSS_VISIBILITY_SHIFT;
/* 2bits: type */
return bits;
}
-#undef VISIBILITY_MASK
-#undef VISIBILITY_SHIFT
-#undef VISIBILITY_INDEX
+#undef CSS_VISIBILITY_MASK
+#undef CSS_VISIBILITY_SHIFT
+#undef CSS_VISIBILITY_INDEX
-#define LIST_STYLE_POSITION_INDEX 33
-#define LIST_STYLE_POSITION_SHIFT 4
-#define LIST_STYLE_POSITION_MASK 0x30
+#define CSS_LIST_STYLE_POSITION_INDEX 33
+#define CSS_LIST_STYLE_POSITION_SHIFT 4
+#define CSS_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;
+ uint8_t bits = style->bits[CSS_LIST_STYLE_POSITION_INDEX];
+ bits &= CSS_LIST_STYLE_POSITION_MASK;
+ bits >>= CSS_LIST_STYLE_POSITION_SHIFT;
/* 2bits: type */
return bits;
}
-#undef LIST_STYLE_POSITION_MASK
-#undef LIST_STYLE_POSITION_SHIFT
-#undef LIST_STYLE_POSITION_INDEX
+#undef CSS_LIST_STYLE_POSITION_MASK
+#undef CSS_LIST_STYLE_POSITION_SHIFT
+#undef CSS_LIST_STYLE_POSITION_INDEX
-#define TEXT_ALIGN_INDEX 33
-#define TEXT_ALIGN_SHIFT 0
-#define TEXT_ALIGN_MASK 0xf
+#define CSS_TEXT_ALIGN_INDEX 33
+#define CSS_TEXT_ALIGN_SHIFT 0
+#define CSS_TEXT_ALIGN_MASK 0xf
static inline uint8_t css_computed_text_align(
const css_computed_style *style)
{
- uint8_t bits = style->bits[TEXT_ALIGN_INDEX];
- bits &= TEXT_ALIGN_MASK;
- bits >>= TEXT_ALIGN_SHIFT;
+ uint8_t bits = style->bits[CSS_TEXT_ALIGN_INDEX];
+ bits &= CSS_TEXT_ALIGN_MASK;
+ bits >>= CSS_TEXT_ALIGN_SHIFT;
/* 4bits: type */
return bits;
}
-#undef TEXT_ALIGN_MASK
-#undef TEXT_ALIGN_SHIFT
-#undef TEXT_ALIGN_INDEX
+#undef CSS_TEXT_ALIGN_MASK
+#undef CSS_TEXT_ALIGN_SHIFT
+#undef CSS_TEXT_ALIGN_INDEX
#endif