diff options
author | Lucas Neves <lcneves@gmail.com> | 2017-11-11 18:00:10 -0500 |
---|---|---|
committer | Lucas Neves <lcneves@gmail.com> | 2017-11-11 18:00:10 -0500 |
commit | 082f3d077293f813567ac6c9a4b2a00337933238 (patch) | |
tree | 3c0ed09e857bf9c03a628712fb08da59068e175a | |
parent | 0516fc388111bbf6f860ffe7b4ac4d3fd241006a (diff) | |
download | libcss-082f3d077293f813567ac6c9a4b2a00337933238.tar.gz |
WIP: Select: autogen for selection properties.
-rw-r--r-- | src/select/__pycache__/assets.cpython-36.pyc | bin | 629 -> 629 bytes | |||
-rw-r--r-- | src/select/__pycache__/overrides.cpython-36.pyc | bin | 4578 -> 4579 bytes | |||
-rw-r--r-- | src/select/__pycache__/select_config.cpython-36.pyc | bin | 6598 -> 6681 bytes | |||
-rw-r--r-- | src/select/autogenerated_computed.h | 79 | ||||
-rw-r--r-- | src/select/autogenerated_propget.h | 442 | ||||
-rw-r--r-- | src/select/autogenerated_propset.h | 674 | ||||
-rw-r--r-- | src/select/overrides.py | 2 | ||||
-rw-r--r-- | src/select/select_config.py | 4 | ||||
-rw-r--r-- | src/select/select_generator.py | 8 |
9 files changed, 630 insertions, 579 deletions
diff --git a/src/select/__pycache__/assets.cpython-36.pyc b/src/select/__pycache__/assets.cpython-36.pyc Binary files differindex a0ba1b1..797012f 100644 --- a/src/select/__pycache__/assets.cpython-36.pyc +++ b/src/select/__pycache__/assets.cpython-36.pyc diff --git a/src/select/__pycache__/overrides.cpython-36.pyc b/src/select/__pycache__/overrides.cpython-36.pyc Binary files differindex 8a6b01c..ff0dffb 100644 --- a/src/select/__pycache__/overrides.cpython-36.pyc +++ b/src/select/__pycache__/overrides.cpython-36.pyc diff --git a/src/select/__pycache__/select_config.cpython-36.pyc b/src/select/__pycache__/select_config.cpython-36.pyc Binary files differindex 5091149..8ecd301 100644 --- a/src/select/__pycache__/select_config.cpython-36.pyc +++ b/src/select/__pycache__/select_config.cpython-36.pyc diff --git a/src/select/autogenerated_computed.h b/src/select/autogenerated_computed.h index 744b3ad..09a0c19 100644 --- a/src/select/autogenerated_computed.h +++ b/src/select/autogenerated_computed.h @@ -27,6 +27,7 @@ struct css_computed_uncommon_i { * outline_color 2 4 * outline_width 3 + 5 4 * word_spacing 2 + 5 4 + * writing_mode 2 * * Encode content as an array of content items, terminated with a blank entry. * @@ -48,24 +49,24 @@ struct css_computed_uncommon_i { * cursor 5 sizeof(ptr) * * --- --- --- - * 116 bits 60 + 4sizeof(ptr) bytes + * 118 bits 60 + 4sizeof(ptr) bytes * =================== * 75 + 4sizeof(ptr) bytes * * Bit allocations: * - * 0 bbbbbbbbbbbccccccccoooooooouuuuu - * border_spacing; column_rule_width; outline_width; cursor + * 0 bbbbbbbbbbbooooooooccccccccuuuuu + * border_spacing; outline_width; column_rule_width; cursor * - * 1 wwwwwwwcccccccooooooollllllluuuu - * word_spacing; column_width; column_gap; letter_spacing; column_rule_style + * 1 ccccccclllllllooooooowwwwwwwbbbb + * column_width; letter_spacing; column_gap; word_spacing; break_after * - * 2 ccccccccccccccccccccccccccbbbboo - * clip; break_inside; column_span + * 2 ccccccccccccccccccccccccccoooonn + * clip; column_rule_style; content * - * 3 bbbbrrrrooccnnlluute............ - * break_after; break_before; outline_color; column_fill; content; - * column_count; column_rule_color; counter_increment; counter_reset + * 3 bbbbrrrrccoouuwwllmmnt.......... + * break_inside; break_before; column_count; column_rule_color; outline_color; + * writing_mode; column_fill; column_span; counter_reset; counter_increment */ uint32_t bits[4]; @@ -118,7 +119,7 @@ typedef struct css_computed_page { * Bit allocations: * * 0 pppaaaggwo...................... - * page_break_after; page_break_before; page_break_inside; widows; orphans + * page_break_before; page_break_after; page_break_inside; widows; orphans */ uint32_t bits[1]; @@ -224,45 +225,45 @@ struct css_computed_style_i { * Bit allocations: * * 0 bbbbbbbboooooooorrrrrrrrdddddddd - * border_top_width; border_right_width; border_bottom_width; border_left_width + * border_top_width; border_left_width; border_right_width; border_bottom_width * - * 1 mmmmmmmlllllllfffffffiiiiiiissss - * margin_bottom; left; flex_basis; min_height; list_style_type + * 1 tttttttbbbbbbbmmmmmmmfffffffoooo + * top; bottom; max_height; flex_basis; outline_style * - * 2 hhhhhhhmmmmmmmbbbbbbbaaaaaaaoooo - * height; min_width; bottom; margin_left; outline_style + * 2 mmmmmmmwwwwwwwaaaaaaalllllllbbbb + * margin_bottom; width; margin_right; line_height; border_right_style * - * 3 mmmmmmmwwwwwwwaaaaaaarrrrrrrffff - * max_height; width; margin_top; right; font_weight + * 3 lllllllhhhhhhhmmmmmmmiiiiiiibbbb + * left; height; margin_left; min_height; border_bottom_style * - * 4 mmmmmmmaaaaaaatttttttlllllllbbbb - * max_width; margin_right; top; line_height; border_right_style + * 4 mmmmmmmaaaaaaarrrrrrriiiiiiibbbb + * max_width; margin_top; right; min_width; border_top_style * * 5 bbbbbbbbbbbfffffffffvvvvvvvvvaaa - * background_position; font_size; vertical_align; align_self + * background_position; font_size; vertical_align; background_repeat * - * 6 tttttdddddeeeebbbboooorrrraaawww - * text_decoration; display; text_align; border_top_style; border_bottom_style; - * border_left_style; align_content; white_space + * 6 dddddtttttffffbbbbeeeellllcccxxx + * display; text_decoration; font_weight; border_left_style; text_align; + * list_style_type; clear; text_transform * - * 7 ppppppaaaaaattttttddddddiiiiiibb - * padding_bottom; padding_left; text_indent; padding_right; padding_top; - * background_attachment - * - * 8 bbzzllccffoouueevvaakkttxxrrddBB - * border_bottom_color; z_index; list_style_position; caption_side; flex_wrap; - * border_right_color; unicode_bidi; empty_cells; visibility; float; - * background_color; table_layout; box_sizing; border_collapse; direction; + * 7 ppppppttttttaaaaaaddddddiiiiiibb + * padding_top; text_indent; padding_left; padding_bottom; padding_right; * border_left_color * - * 9 bbbooocccfffnnnaaatttjjjpppvvrrq - * background_repeat; overflow; clear; flex_direction; font_family; - * align_items; text_transform; justify_content; position; font_variant; - * border_top_color; quotes + * 8 bbaaccoorrffddllzzkkeemmuuppnntt + * box_sizing; background_color; caption_side; border_bottom_color; + * border_top_color; float; direction; flex_wrap; z_index; + * background_attachment; border_right_color; empty_cells; unicode_bidi; + * border_collapse; font_style; table_layout + * + * 9 fffjjjaaaooolllvvvpppiiiwwwssnne + * flex_direction; justify_content; align_self; font_family; align_items; + * overflow; position; align_content; white_space; visibility; font_variant; + * flex_grow * - * 10 ffloexcpb....................... - * font_style; list_style_image; order; flex_grow; flex_shrink; color; opacity; - * background_image + * 10 llfcqbior....................... + * list_style_position; flex_shrink; color; quotes; background_image; + * list_style_image; opacity; order */ uint32_t bits[11]; diff --git a/src/select/autogenerated_propget.h b/src/select/autogenerated_propget.h index 523a5db..6148a23 100644 --- a/src/select/autogenerated_propget.h +++ b/src/select/autogenerated_propget.h @@ -35,9 +35,9 @@ static inline uint8_t get_border_spacing(const css_computed_style *style, #undef BORDER_SPACING_SHIFT #undef BORDER_SPACING_MASK -#define BREAK_AFTER_INDEX 3 -#define BREAK_AFTER_SHIFT 28 -#define BREAK_AFTER_MASK 0xf0000000 +#define BREAK_AFTER_INDEX 1 +#define BREAK_AFTER_SHIFT 0 +#define BREAK_AFTER_MASK 0xf static inline uint8_t get_break_after(const css_computed_style *style) { if (style->i.uncommon != NULL) { @@ -79,9 +79,9 @@ static inline uint8_t get_break_before(const css_computed_style *style) #undef BREAK_BEFORE_SHIFT #undef BREAK_BEFORE_MASK -#define BREAK_INSIDE_INDEX 2 -#define BREAK_INSIDE_SHIFT 2 -#define BREAK_INSIDE_MASK 0x3c +#define BREAK_INSIDE_INDEX 3 +#define BREAK_INSIDE_SHIFT 28 +#define BREAK_INSIDE_MASK 0xf0000000 static inline uint8_t get_break_inside(const css_computed_style *style) { if (style->i.uncommon != NULL) { @@ -149,8 +149,8 @@ static inline uint8_t get_clip( #undef CLIP_SHIFT #undef CLIP_MASK #define COLUMN_COUNT_INDEX 3 -#define COLUMN_COUNT_SHIFT 16 -#define COLUMN_COUNT_MASK 0x30000 +#define COLUMN_COUNT_SHIFT 22 +#define COLUMN_COUNT_MASK 0xc00000 static inline uint8_t get_column_count(const css_computed_style *style, int32_t *integer) { @@ -173,8 +173,8 @@ static inline uint8_t get_column_count(const css_computed_style *style, int32_t #undef COLUMN_COUNT_MASK #define COLUMN_FILL_INDEX 3 -#define COLUMN_FILL_SHIFT 20 -#define COLUMN_FILL_MASK 0x300000 +#define COLUMN_FILL_SHIFT 14 +#define COLUMN_FILL_MASK 0xc000 static inline uint8_t get_column_fill(const css_computed_style *style) { if (style->i.uncommon != NULL) { @@ -222,8 +222,8 @@ static inline uint8_t get_column_gap(const css_computed_style *style, css_fixed #undef COLUMN_GAP_MASK #define COLUMN_RULE_COLOR_INDEX 3 -#define COLUMN_RULE_COLOR_SHIFT 14 -#define COLUMN_RULE_COLOR_MASK 0xc000 +#define COLUMN_RULE_COLOR_SHIFT 20 +#define COLUMN_RULE_COLOR_MASK 0x300000 static inline uint8_t get_column_rule_color(const css_computed_style *style, css_color *color) { @@ -240,15 +240,15 @@ static inline uint8_t get_column_rule_color(const css_computed_style *style, } /* Initial value */ - return CSS_COLUMN_RULE_CURRENT_COLOR; + return CSS_COLUMN_RULE_COLOR_CURRENT_COLOR; } #undef COLUMN_RULE_COLOR_INDEX #undef COLUMN_RULE_COLOR_SHIFT #undef COLUMN_RULE_COLOR_MASK -#define COLUMN_RULE_STYLE_INDEX 1 -#define COLUMN_RULE_STYLE_SHIFT 0 -#define COLUMN_RULE_STYLE_MASK 0xf +#define COLUMN_RULE_STYLE_INDEX 2 +#define COLUMN_RULE_STYLE_SHIFT 2 +#define COLUMN_RULE_STYLE_MASK 0x3c static inline uint8_t get_column_rule_style(const css_computed_style *style) { if (style->i.uncommon != NULL) { @@ -270,8 +270,8 @@ static inline uint8_t get_column_rule_style(const css_computed_style *style) #undef COLUMN_RULE_STYLE_MASK #define COLUMN_RULE_WIDTH_INDEX 0 -#define COLUMN_RULE_WIDTH_SHIFT 13 -#define COLUMN_RULE_WIDTH_MASK 0x1fe000 +#define COLUMN_RULE_WIDTH_SHIFT 5 +#define COLUMN_RULE_WIDTH_MASK 0x1fe0 static inline uint8_t get_column_rule_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -297,9 +297,9 @@ static inline uint8_t get_column_rule_width(const css_computed_style *style, #undef COLUMN_RULE_WIDTH_SHIFT #undef COLUMN_RULE_WIDTH_MASK -#define COLUMN_SPAN_INDEX 2 -#define COLUMN_SPAN_SHIFT 0 -#define COLUMN_SPAN_MASK 0x3 +#define COLUMN_SPAN_INDEX 3 +#define COLUMN_SPAN_SHIFT 12 +#define COLUMN_SPAN_MASK 0x3000 static inline uint8_t get_column_span(const css_computed_style *style) { if (style->i.uncommon != NULL) { @@ -320,8 +320,8 @@ static inline uint8_t get_column_span(const css_computed_style *style) #undef COLUMN_SPAN_MASK #define COLUMN_WIDTH_INDEX 1 -#define COLUMN_WIDTH_SHIFT 18 -#define COLUMN_WIDTH_MASK 0x1fc0000 +#define COLUMN_WIDTH_SHIFT 25 +#define COLUMN_WIDTH_MASK 0xfe000000 static inline uint8_t get_column_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -346,9 +346,9 @@ static inline uint8_t get_column_width(const css_computed_style *style, #undef COLUMN_WIDTH_SHIFT #undef COLUMN_WIDTH_MASK -#define CONTENT_INDEX 3 -#define CONTENT_SHIFT 18 -#define CONTENT_MASK 0xc0000 +#define CONTENT_INDEX 2 +#define CONTENT_SHIFT 0 +#define CONTENT_MASK 0x3 static inline uint8_t get_content(const css_computed_style *style, const css_computed_content_item **content_item) { @@ -359,7 +359,7 @@ static inline uint8_t get_content(const css_computed_style *style, const /* 2bits: tt : type */ if ((bits & 0x3) == CSS_CONTENT_NORMAL) { - *content_item = style->i.uncommon->i.content; + *content_item = style->i.uncommon->content; } return (bits & 0x3); @@ -373,8 +373,8 @@ static inline uint8_t get_content(const css_computed_style *style, const #undef CONTENT_MASK #define COUNTER_INCREMENT_INDEX 3 -#define COUNTER_INCREMENT_SHIFT 13 -#define COUNTER_INCREMENT_MASK 0x2000 +#define COUNTER_INCREMENT_SHIFT 10 +#define COUNTER_INCREMENT_MASK 0x400 static inline uint8_t get_counter_increment(const css_computed_style *style, const css_computed_counter **counter_arr) { @@ -385,7 +385,7 @@ static inline uint8_t get_counter_increment(const css_computed_style *style, bits >>= COUNTER_INCREMENT_SHIFT; /* 1bit: t : type */ - *counter_arr = style->i.uncommon->i.counter_increment; + *counter_arr = style->i.uncommon->counter_increment; return (bits & 0x1); } @@ -398,8 +398,8 @@ static inline uint8_t get_counter_increment(const css_computed_style *style, #undef COUNTER_INCREMENT_MASK #define COUNTER_RESET_INDEX 3 -#define COUNTER_RESET_SHIFT 12 -#define COUNTER_RESET_MASK 0x1000 +#define COUNTER_RESET_SHIFT 11 +#define COUNTER_RESET_MASK 0x800 static inline uint8_t get_counter_reset(const css_computed_style *style, const css_computed_counter **counter_arr) { @@ -409,7 +409,7 @@ static inline uint8_t get_counter_reset(const css_computed_style *style, const bits >>= COUNTER_RESET_SHIFT; /* 1bit: t : type */ - *counter_arr = style->i.uncommon->i.counter_reset; + *counter_arr = style->i.uncommon->counter_reset; return (bits & 0x1); } @@ -434,7 +434,7 @@ static inline uint8_t get_cursor(const css_computed_style *style, lwc_string /* 5bits: ttttt : type */ if ((bits & 0x1f) == CSS_CURSOR_AUTO) { - *string_arr = style->i.uncommon->i.cursor; + *string_arr = style->i.uncommon->cursor; } return (bits & 0x1f); @@ -448,8 +448,8 @@ static inline uint8_t get_cursor(const css_computed_style *style, lwc_string #undef CURSOR_MASK #define LETTER_SPACING_INDEX 1 -#define LETTER_SPACING_SHIFT 4 -#define LETTER_SPACING_MASK 0x7f0 +#define LETTER_SPACING_SHIFT 18 +#define LETTER_SPACING_MASK 0x1fc0000 static inline uint8_t get_letter_spacing(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -475,8 +475,8 @@ static inline uint8_t get_letter_spacing(const css_computed_style *style, #undef LETTER_SPACING_MASK #define OUTLINE_COLOR_INDEX 3 -#define OUTLINE_COLOR_SHIFT 22 -#define OUTLINE_COLOR_MASK 0xc00000 +#define OUTLINE_COLOR_SHIFT 18 +#define OUTLINE_COLOR_MASK 0xc0000 static inline uint8_t get_outline_color(const css_computed_style *style, css_color *color) { @@ -501,8 +501,8 @@ static inline uint8_t get_outline_color(const css_computed_style *style, #undef OUTLINE_COLOR_MASK #define OUTLINE_WIDTH_INDEX 0 -#define OUTLINE_WIDTH_SHIFT 5 -#define OUTLINE_WIDTH_MASK 0x1fe0 +#define OUTLINE_WIDTH_SHIFT 13 +#define OUTLINE_WIDTH_MASK 0x1fe000 static inline uint8_t get_outline_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -528,8 +528,8 @@ static inline uint8_t get_outline_width(const css_computed_style *style, #undef OUTLINE_WIDTH_MASK #define WORD_SPACING_INDEX 1 -#define WORD_SPACING_SHIFT 25 -#define WORD_SPACING_MASK 0xfe000000 +#define WORD_SPACING_SHIFT 4 +#define WORD_SPACING_MASK 0x7f0 static inline uint8_t get_word_spacing(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -554,6 +554,28 @@ static inline uint8_t get_word_spacing(const css_computed_style *style, #undef WORD_SPACING_SHIFT #undef WORD_SPACING_MASK +#define WRITING_MODE_INDEX 3 +#define WRITING_MODE_SHIFT 16 +#define WRITING_MODE_MASK 0x30000 +static inline uint8_t get_writing_mode(const css_computed_style *style) +{ + if (style->i.uncommon != NULL) { + uint32_t bits = style->i.uncommon->i.bits[WRITING_MODE_INDEX]; + bits &= WRITING_MODE_MASK; + bits >>= WRITING_MODE_SHIFT; + + /* 2bits: tt : type */ + + return (bits & 0x3); + } + + /* Initial value */ + return CSS_WRITING_MODE_HORIZONTAL_TB; +} +#undef WRITING_MODE_INDEX +#undef WRITING_MODE_SHIFT +#undef WRITING_MODE_MASK + #define ORPHANS_INDEX 0 #define ORPHANS_SHIFT 22 #define ORPHANS_MASK 0x400000 @@ -579,8 +601,8 @@ static inline uint8_t get_orphans(const css_computed_style *style, int32_t #undef ORPHANS_MASK #define PAGE_BREAK_AFTER_INDEX 0 -#define PAGE_BREAK_AFTER_SHIFT 29 -#define PAGE_BREAK_AFTER_MASK 0xe0000000 +#define PAGE_BREAK_AFTER_SHIFT 26 +#define PAGE_BREAK_AFTER_MASK 0x1c000000 static inline uint8_t get_page_break_after(const css_computed_style *style) { if (style->page != NULL) { @@ -601,8 +623,8 @@ static inline uint8_t get_page_break_after(const css_computed_style *style) #undef PAGE_BREAK_AFTER_MASK #define PAGE_BREAK_BEFORE_INDEX 0 -#define PAGE_BREAK_BEFORE_SHIFT 26 -#define PAGE_BREAK_BEFORE_MASK 0x1c000000 +#define PAGE_BREAK_BEFORE_SHIFT 29 +#define PAGE_BREAK_BEFORE_MASK 0xe0000000 static inline uint8_t get_page_break_before(const css_computed_style *style) { if (style->page != NULL) { @@ -668,9 +690,9 @@ static inline uint8_t get_widows(const css_computed_style *style, int32_t #undef WIDOWS_SHIFT #undef WIDOWS_MASK -#define ALIGN_CONTENT_INDEX 6 -#define ALIGN_CONTENT_SHIFT 3 -#define ALIGN_CONTENT_MASK 0x38 +#define ALIGN_CONTENT_INDEX 9 +#define ALIGN_CONTENT_SHIFT 8 +#define ALIGN_CONTENT_MASK 0x700 static inline uint8_t get_align_content(const css_computed_style *style) { uint32_t bits = style->i.bits[ALIGN_CONTENT_INDEX]; @@ -686,8 +708,8 @@ static inline uint8_t get_align_content(const css_computed_style *style) #undef ALIGN_CONTENT_MASK #define ALIGN_ITEMS_INDEX 9 -#define ALIGN_ITEMS_SHIFT 14 -#define ALIGN_ITEMS_MASK 0x1c000 +#define ALIGN_ITEMS_SHIFT 17 +#define ALIGN_ITEMS_MASK 0xe0000 static inline uint8_t get_align_items(const css_computed_style *style) { uint32_t bits = style->i.bits[ALIGN_ITEMS_INDEX]; @@ -702,9 +724,9 @@ static inline uint8_t get_align_items(const css_computed_style *style) #undef ALIGN_ITEMS_SHIFT #undef ALIGN_ITEMS_MASK -#define ALIGN_SELF_INDEX 5 -#define ALIGN_SELF_SHIFT 0 -#define ALIGN_SELF_MASK 0x7 +#define ALIGN_SELF_INDEX 9 +#define ALIGN_SELF_SHIFT 23 +#define ALIGN_SELF_MASK 0x3800000 static inline uint8_t get_align_self(const css_computed_style *style) { uint32_t bits = style->i.bits[ALIGN_SELF_INDEX]; @@ -719,9 +741,9 @@ static inline uint8_t get_align_self(const css_computed_style *style) #undef ALIGN_SELF_SHIFT #undef ALIGN_SELF_MASK -#define BACKGROUND_ATTACHMENT_INDEX 7 -#define BACKGROUND_ATTACHMENT_SHIFT 0 -#define BACKGROUND_ATTACHMENT_MASK 0x3 +#define BACKGROUND_ATTACHMENT_INDEX 8 +#define BACKGROUND_ATTACHMENT_SHIFT 12 +#define BACKGROUND_ATTACHMENT_MASK 0x3000 static inline uint8_t get_background_attachment(const css_computed_style *style) { uint32_t bits = style->i.bits[BACKGROUND_ATTACHMENT_INDEX]; @@ -737,8 +759,8 @@ static inline uint8_t get_background_attachment(const css_computed_style *style) #undef BACKGROUND_ATTACHMENT_MASK #define BACKGROUND_COLOR_INDEX 8 -#define BACKGROUND_COLOR_SHIFT 10 -#define BACKGROUND_COLOR_MASK 0xc00 +#define BACKGROUND_COLOR_SHIFT 28 +#define BACKGROUND_COLOR_MASK 0x30000000 static inline uint8_t get_background_color(const css_computed_style *style, css_color *color) { @@ -756,8 +778,8 @@ static inline uint8_t get_background_color(const css_computed_style *style, #undef BACKGROUND_COLOR_MASK #define BACKGROUND_IMAGE_INDEX 10 -#define BACKGROUND_IMAGE_SHIFT 23 -#define BACKGROUND_IMAGE_MASK 0x800000 +#define BACKGROUND_IMAGE_SHIFT 26 +#define BACKGROUND_IMAGE_MASK 0x4000000 static inline uint8_t get_background_image(const css_computed_style *style, lwc_string **string) { @@ -799,9 +821,9 @@ static inline uint8_t get_background_position(const css_computed_style *style, #undef BACKGROUND_POSITION_SHIFT #undef BACKGROUND_POSITION_MASK -#define BACKGROUND_REPEAT_INDEX 9 -#define BACKGROUND_REPEAT_SHIFT 29 -#define BACKGROUND_REPEAT_MASK 0xe0000000 +#define BACKGROUND_REPEAT_INDEX 5 +#define BACKGROUND_REPEAT_SHIFT 0 +#define BACKGROUND_REPEAT_MASK 0x7 static inline uint8_t get_background_repeat(const css_computed_style *style) { uint32_t bits = style->i.bits[BACKGROUND_REPEAT_INDEX]; @@ -817,8 +839,8 @@ static inline uint8_t get_background_repeat(const css_computed_style *style) #undef BACKGROUND_REPEAT_MASK #define BORDER_BOTTOM_COLOR_INDEX 8 -#define BORDER_BOTTOM_COLOR_SHIFT 30 -#define BORDER_BOTTOM_COLOR_MASK 0xc0000000 +#define BORDER_BOTTOM_COLOR_SHIFT 24 +#define BORDER_BOTTOM_COLOR_MASK 0x3000000 static inline uint8_t get_border_bottom_color(const css_computed_style *style, css_color *color) { @@ -835,9 +857,9 @@ static inline uint8_t get_border_bottom_color(const css_computed_style *style, #undef BORDER_BOTTOM_COLOR_SHIFT #undef BORDER_BOTTOM_COLOR_MASK -#define BORDER_BOTTOM_STYLE_INDEX 6 -#define BORDER_BOTTOM_STYLE_SHIFT 10 -#define BORDER_BOTTOM_STYLE_MASK 0x3c00 +#define BORDER_BOTTOM_STYLE_INDEX 3 +#define BORDER_BOTTOM_STYLE_SHIFT 0 +#define BORDER_BOTTOM_STYLE_MASK 0xf static inline uint8_t get_border_bottom_style(const css_computed_style *style) { uint32_t bits = style->i.bits[BORDER_BOTTOM_STYLE_INDEX]; @@ -853,8 +875,8 @@ static inline uint8_t get_border_bottom_style(const css_computed_style *style) #undef BORDER_BOTTOM_STYLE_MASK #define BORDER_BOTTOM_WIDTH_INDEX 0 -#define BORDER_BOTTOM_WIDTH_SHIFT 8 -#define BORDER_BOTTOM_WIDTH_MASK 0xff00 +#define BORDER_BOTTOM_WIDTH_SHIFT 0 +#define BORDER_BOTTOM_WIDTH_MASK 0xff static inline uint8_t get_border_bottom_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -891,7 +913,7 @@ static inline uint8_t get_border_collapse(const css_computed_style *style) #undef BORDER_COLLAPSE_SHIFT #undef BORDER_COLLAPSE_MASK -#define BORDER_LEFT_COLOR_INDEX 8 +#define BORDER_LEFT_COLOR_INDEX 7 #define BORDER_LEFT_COLOR_SHIFT 0 #define BORDER_LEFT_COLOR_MASK 0x3 static inline uint8_t get_border_left_color(const css_computed_style *style, @@ -911,8 +933,8 @@ static inline uint8_t get_border_left_color(const css_computed_style *style, #undef BORDER_LEFT_COLOR_MASK #define BORDER_LEFT_STYLE_INDEX 6 -#define BORDER_LEFT_STYLE_SHIFT 6 -#define BORDER_LEFT_STYLE_MASK 0x3c0 +#define BORDER_LEFT_STYLE_SHIFT 14 +#define BORDER_LEFT_STYLE_MASK 0x3c000 static inline uint8_t get_border_left_style(const css_computed_style *style) { uint32_t bits = style->i.bits[BORDER_LEFT_STYLE_INDEX]; @@ -928,8 +950,8 @@ static inline uint8_t get_border_left_style(const css_computed_style *style) #undef BORDER_LEFT_STYLE_MASK #define BORDER_LEFT_WIDTH_INDEX 0 -#define BORDER_LEFT_WIDTH_SHIFT 0 -#define BORDER_LEFT_WIDTH_MASK 0xff +#define BORDER_LEFT_WIDTH_SHIFT 16 +#define BORDER_LEFT_WIDTH_MASK 0xff0000 static inline uint8_t get_border_left_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -950,8 +972,8 @@ static inline uint8_t get_border_left_width(const css_computed_style *style, #undef BORDER_LEFT_WIDTH_MASK #define BORDER_RIGHT_COLOR_INDEX 8 -#define BORDER_RIGHT_COLOR_SHIFT 20 -#define BORDER_RIGHT_COLOR_MASK 0x300000 +#define BORDER_RIGHT_COLOR_SHIFT 10 +#define BORDER_RIGHT_COLOR_MASK 0xc00 static inline uint8_t get_border_right_color(const css_computed_style *style, css_color *color) { @@ -968,7 +990,7 @@ static inline uint8_t get_border_right_color(const css_computed_style *style, #undef BORDER_RIGHT_COLOR_SHIFT #undef BORDER_RIGHT_COLOR_MASK -#define BORDER_RIGHT_STYLE_INDEX 4 +#define BORDER_RIGHT_STYLE_INDEX 2 #define BORDER_RIGHT_STYLE_SHIFT 0 #define BORDER_RIGHT_STYLE_MASK 0xf static inline uint8_t get_border_right_style(const css_computed_style *style) @@ -986,8 +1008,8 @@ static inline uint8_t get_border_right_style(const css_computed_style *style) #undef BORDER_RIGHT_STYLE_MASK #define BORDER_RIGHT_WIDTH_INDEX 0 -#define BORDER_RIGHT_WIDTH_SHIFT 16 -#define BORDER_RIGHT_WIDTH_MASK 0xff0000 +#define BORDER_RIGHT_WIDTH_SHIFT 8 +#define BORDER_RIGHT_WIDTH_MASK 0xff00 static inline uint8_t get_border_right_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1007,9 +1029,9 @@ static inline uint8_t get_border_right_width(const css_computed_style *style, #undef BORDER_RIGHT_WIDTH_SHIFT #undef BORDER_RIGHT_WIDTH_MASK -#define BORDER_TOP_COLOR_INDEX 9 -#define BORDER_TOP_COLOR_SHIFT 1 -#define BORDER_TOP_COLOR_MASK 0x6 +#define BORDER_TOP_COLOR_INDEX 8 +#define BORDER_TOP_COLOR_SHIFT 22 +#define BORDER_TOP_COLOR_MASK 0xc00000 static inline uint8_t get_border_top_color(const css_computed_style *style, css_color *color) { @@ -1026,9 +1048,9 @@ static inline uint8_t get_border_top_color(const css_computed_style *style, #undef BORDER_TOP_COLOR_SHIFT #undef BORDER_TOP_COLOR_MASK -#define BORDER_TOP_STYLE_INDEX 6 -#define BORDER_TOP_STYLE_SHIFT 14 -#define BORDER_TOP_STYLE_MASK 0x3c000 +#define BORDER_TOP_STYLE_INDEX 4 +#define BORDER_TOP_STYLE_SHIFT 0 +#define BORDER_TOP_STYLE_MASK 0xf static inline uint8_t get_border_top_style(const css_computed_style *style) { uint32_t bits = style->i.bits[BORDER_TOP_STYLE_INDEX]; @@ -1065,9 +1087,9 @@ static inline uint8_t get_border_top_width(const css_computed_style *style, #undef BORDER_TOP_WIDTH_SHIFT #undef BORDER_TOP_WIDTH_MASK -#define BOTTOM_INDEX 2 -#define BOTTOM_SHIFT 11 -#define BOTTOM_MASK 0x3f800 +#define BOTTOM_INDEX 1 +#define BOTTOM_SHIFT 18 +#define BOTTOM_MASK 0x1fc0000 static inline uint8_t get_bottom(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1088,8 +1110,8 @@ static inline uint8_t get_bottom(const css_computed_style *style, css_fixed #undef BOTTOM_MASK #define BOX_SIZING_INDEX 8 -#define BOX_SIZING_SHIFT 6 -#define BOX_SIZING_MASK 0xc0 +#define BOX_SIZING_SHIFT 30 +#define BOX_SIZING_MASK 0xc0000000 static inline uint8_t get_box_sizing(const css_computed_style *style) { uint32_t bits = style->i.bits[BOX_SIZING_INDEX]; @@ -1105,8 +1127,8 @@ static inline uint8_t get_box_sizing(const css_computed_style *style) #undef BOX_SIZING_MASK #define CAPTION_SIDE_INDEX 8 -#define CAPTION_SIDE_SHIFT 24 -#define CAPTION_SIDE_MASK 0x3000000 +#define CAPTION_SIDE_SHIFT 26 +#define CAPTION_SIDE_MASK 0xc000000 static inline uint8_t get_caption_side(const css_computed_style *style) { uint32_t bits = style->i.bits[CAPTION_SIDE_INDEX]; @@ -1121,9 +1143,9 @@ static inline uint8_t get_caption_side(const css_computed_style *style) #undef CAPTION_SIDE_SHIFT #undef CAPTION_SIDE_MASK -#define CLEAR_INDEX 9 -#define CLEAR_SHIFT 23 -#define CLEAR_MASK 0x3800000 +#define CLEAR_INDEX 6 +#define CLEAR_SHIFT 3 +#define CLEAR_MASK 0x38 static inline uint8_t get_clear(const css_computed_style *style) { uint32_t bits = style->i.bits[CLEAR_INDEX]; @@ -1139,8 +1161,8 @@ static inline uint8_t get_clear(const css_computed_style *style) #undef CLEAR_MASK #define COLOR_INDEX 10 -#define COLOR_SHIFT 25 -#define COLOR_MASK 0x2000000 +#define COLOR_SHIFT 28 +#define COLOR_MASK 0x10000000 static inline uint8_t get_color(const css_computed_style *style, css_color *color) { @@ -1158,8 +1180,8 @@ static inline uint8_t get_color(const css_computed_style *style, css_color #undef COLOR_MASK #define DIRECTION_INDEX 8 -#define DIRECTION_SHIFT 2 -#define DIRECTION_MASK 0xc +#define DIRECTION_SHIFT 18 +#define DIRECTION_MASK 0xc0000 static inline uint8_t get_direction(const css_computed_style *style) { uint32_t bits = style->i.bits[DIRECTION_INDEX]; @@ -1175,8 +1197,8 @@ static inline uint8_t get_direction(const css_computed_style *style) #undef DIRECTION_MASK #define DISPLAY_INDEX 6 -#define DISPLAY_SHIFT 22 -#define DISPLAY_MASK 0x7c00000 +#define DISPLAY_SHIFT 27 +#define DISPLAY_MASK 0xf8000000 static inline uint8_t get_display(const css_computed_style *style) { uint32_t bits = style->i.bits[DISPLAY_INDEX]; @@ -1192,8 +1214,8 @@ static inline uint8_t get_display(const css_computed_style *style) #undef DISPLAY_MASK #define EMPTY_CELLS_INDEX 8 -#define EMPTY_CELLS_SHIFT 16 -#define EMPTY_CELLS_MASK 0x30000 +#define EMPTY_CELLS_SHIFT 8 +#define EMPTY_CELLS_MASK 0x300 static inline uint8_t get_empty_cells(const css_computed_style *style) { uint32_t bits = style->i.bits[EMPTY_CELLS_INDEX]; @@ -1209,8 +1231,8 @@ static inline uint8_t get_empty_cells(const css_computed_style *style) #undef EMPTY_CELLS_MASK #define FLEX_BASIS_INDEX 1 -#define FLEX_BASIS_SHIFT 11 -#define FLEX_BASIS_MASK 0x3f800 +#define FLEX_BASIS_SHIFT 4 +#define FLEX_BASIS_MASK 0x7f0 static inline uint8_t get_flex_basis(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1231,8 +1253,8 @@ static inline uint8_t get_flex_basis(const css_computed_style *style, css_fixed #undef FLEX_BASIS_MASK #define FLEX_DIRECTION_INDEX 9 -#define FLEX_DIRECTION_SHIFT 20 -#define FLEX_DIRECTION_MASK 0x700000 +#define FLEX_DIRECTION_SHIFT 29 +#define FLEX_DIRECTION_MASK 0xe0000000 static inline uint8_t get_flex_direction(const css_computed_style *style) { uint32_t bits = style->i.bits[FLEX_DIRECTION_INDEX]; @@ -1247,9 +1269,9 @@ static inline uint8_t get_flex_direction(const css_computed_style *style) #undef FLEX_DIRECTION_SHIFT #undef FLEX_DIRECTION_MASK -#define FLEX_GROW_INDEX 10 -#define FLEX_GROW_SHIFT 27 -#define FLEX_GROW_MASK 0x8000000 +#define FLEX_GROW_INDEX 9 +#define FLEX_GROW_SHIFT 0 +#define FLEX_GROW_MASK 0x1 static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed *fixed) { @@ -1269,8 +1291,8 @@ static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed #undef FLEX_GROW_MASK #define FLEX_SHRINK_INDEX 10 -#define FLEX_SHRINK_SHIFT 26 -#define FLEX_SHRINK_MASK 0x4000000 +#define FLEX_SHRINK_SHIFT 29 +#define FLEX_SHRINK_MASK 0x20000000 static inline uint8_t get_flex_shrink(const css_computed_style *style, css_fixed *fixed) { @@ -1290,8 +1312,8 @@ static inline uint8_t get_flex_shrink(const css_computed_style *style, #undef FLEX_SHRINK_MASK #define FLEX_WRAP_INDEX 8 -#define FLEX_WRAP_SHIFT 22 -#define FLEX_WRAP_MASK 0xc00000 +#define FLEX_WRAP_SHIFT 16 +#define FLEX_WRAP_MASK 0x30000 static inline uint8_t get_flex_wrap(const css_computed_style *style) { uint32_t bits = style->i.bits[FLEX_WRAP_INDEX]; @@ -1307,8 +1329,8 @@ static inline uint8_t get_flex_wrap(const css_computed_style *style) #undef FLEX_WRAP_MASK #define FLOAT_INDEX 8 -#define FLOAT_SHIFT 12 -#define FLOAT_MASK 0x3000 +#define FLOAT_SHIFT 20 +#define FLOAT_MASK 0x300000 static inline uint8_t get_float(const css_computed_style *style) { uint32_t bits = style->i.bits[FLOAT_INDEX]; @@ -1324,8 +1346,8 @@ static inline uint8_t get_float(const css_computed_style *style) #undef FLOAT_MASK #define FONT_FAMILY_INDEX 9 -#define FONT_FAMILY_SHIFT 17 -#define FONT_FAMILY_MASK 0xe0000 +#define FONT_FAMILY_SHIFT 20 +#define FONT_FAMILY_MASK 0x700000 static inline uint8_t get_font_family(const css_computed_style *style, lwc_string ***string_arr) { @@ -1334,7 +1356,7 @@ static inline uint8_t get_font_family(const css_computed_style *style, bits >>= FONT_FAMILY_SHIFT; /* 3bits: ttt : type */ - *string_arr = style->i.font_family; + *string_arr = style->font_family; return (bits & 0x7); } @@ -1364,9 +1386,9 @@ static inline uint8_t get_font_size(const css_computed_style *style, css_fixed #undef FONT_SIZE_SHIFT #undef FONT_SIZE_MASK -#define FONT_STYLE_INDEX 10 -#define FONT_STYLE_SHIFT 30 -#define FONT_STYLE_MASK 0xc0000000 +#define FONT_STYLE_INDEX 8 +#define FONT_STYLE_SHIFT 2 +#define FONT_STYLE_MASK 0xc static inline uint8_t get_font_style(const css_computed_style *style) { uint32_t bits = style->i.bits[FONT_STYLE_INDEX]; @@ -1382,8 +1404,8 @@ static inline uint8_t get_font_style(const css_computed_style *style) #undef FONT_STYLE_MASK #define FONT_VARIANT_INDEX 9 -#define FONT_VARIANT_SHIFT 3 -#define FONT_VARIANT_MASK 0x18 +#define FONT_VARIANT_SHIFT 1 +#define FONT_VARIANT_MASK 0x6 static inline uint8_t get_font_variant(const css_computed_style *style) { uint32_t bits = style->i.bits[FONT_VARIANT_INDEX]; @@ -1398,9 +1420,9 @@ static inline uint8_t get_font_variant(const css_computed_style *style) #undef FONT_VARIANT_SHIFT #undef FONT_VARIANT_MASK -#define FONT_WEIGHT_INDEX 3 -#define FONT_WEIGHT_SHIFT 0 -#define FONT_WEIGHT_MASK 0xf +#define FONT_WEIGHT_INDEX 6 +#define FONT_WEIGHT_SHIFT 18 +#define FONT_WEIGHT_MASK 0x3c0000 static inline uint8_t get_font_weight(const css_computed_style *style) { uint32_t bits = style->i.bits[FONT_WEIGHT_INDEX]; @@ -1415,9 +1437,9 @@ static inline uint8_t get_font_weight(const css_computed_style *style) #undef FONT_WEIGHT_SHIFT #undef FONT_WEIGHT_MASK -#define HEIGHT_INDEX 2 -#define HEIGHT_SHIFT 25 -#define HEIGHT_MASK 0xfe000000 +#define HEIGHT_INDEX 3 +#define HEIGHT_SHIFT 18 +#define HEIGHT_MASK 0x1fc0000 static inline uint8_t get_height(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1438,8 +1460,8 @@ static inline uint8_t get_height(const css_computed_style *style, css_fixed #undef HEIGHT_MASK #define JUSTIFY_CONTENT_INDEX 9 -#define JUSTIFY_CONTENT_SHIFT 8 -#define JUSTIFY_CONTENT_MASK 0x700 +#define JUSTIFY_CONTENT_SHIFT 26 +#define JUSTIFY_CONTENT_MASK 0x1c000000 static inline uint8_t get_justify_content(const css_computed_style *style) { uint32_t bits = style->i.bits[JUSTIFY_CONTENT_INDEX]; @@ -1454,9 +1476,9 @@ static inline uint8_t get_justify_content(const css_computed_style *style) #undef JUSTIFY_CONTENT_SHIFT #undef JUSTIFY_CONTENT_MASK -#define LEFT_INDEX 1 -#define LEFT_SHIFT 18 -#define LEFT_MASK 0x1fc0000 +#define LEFT_INDEX 3 +#define LEFT_SHIFT 25 +#define LEFT_MASK 0xfe000000 static inline uint8_t get_left(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1476,7 +1498,7 @@ static inline uint8_t get_left(const css_computed_style *style, css_fixed #undef LEFT_SHIFT #undef LEFT_MASK -#define LINE_HEIGHT_INDEX 4 +#define LINE_HEIGHT_INDEX 2 #define LINE_HEIGHT_SHIFT 4 #define LINE_HEIGHT_MASK 0x7f0 static inline uint8_t get_line_height( @@ -1504,8 +1526,8 @@ static inline uint8_t get_line_height( #undef LINE_HEIGHT_SHIFT #undef LINE_HEIGHT_MASK #define LIST_STYLE_IMAGE_INDEX 10 -#define LIST_STYLE_IMAGE_SHIFT 29 -#define LIST_STYLE_IMAGE_MASK 0x20000000 +#define LIST_STYLE_IMAGE_SHIFT 25 +#define LIST_STYLE_IMAGE_MASK 0x2000000 static inline uint8_t get_list_style_image(const css_computed_style *style, lwc_string **string) { @@ -1522,9 +1544,9 @@ static inline uint8_t get_list_style_image(const css_computed_style *style, #undef LIST_STYLE_IMAGE_SHIFT #undef LIST_STYLE_IMAGE_MASK -#define LIST_STYLE_POSITION_INDEX 8 -#define LIST_STYLE_POSITION_SHIFT 26 -#define LIST_STYLE_POSITION_MASK 0xc000000 +#define LIST_STYLE_POSITION_INDEX 10 +#define LIST_STYLE_POSITION_SHIFT 30 +#define LIST_STYLE_POSITION_MASK 0xc0000000 static inline uint8_t get_list_style_position(const css_computed_style *style) { uint32_t bits = style->i.bits[LIST_STYLE_POSITION_INDEX]; @@ -1539,9 +1561,9 @@ static inline uint8_t get_list_style_position(const css_computed_style *style) #undef LIST_STYLE_POSITION_SHIFT #undef LIST_STYLE_POSITION_MASK -#define LIST_STYLE_TYPE_INDEX 1 -#define LIST_STYLE_TYPE_SHIFT 0 -#define LIST_STYLE_TYPE_MASK 0xf +#define LIST_STYLE_TYPE_INDEX 6 +#define LIST_STYLE_TYPE_SHIFT 6 +#define LIST_STYLE_TYPE_MASK 0x3c0 static inline uint8_t get_list_style_type(const css_computed_style *style) { uint32_t bits = style->i.bits[LIST_STYLE_TYPE_INDEX]; @@ -1556,7 +1578,7 @@ static inline uint8_t get_list_style_type(const css_computed_style *style) #undef LIST_STYLE_TYPE_SHIFT #undef LIST_STYLE_TYPE_MASK -#define MARGIN_BOTTOM_INDEX 1 +#define MARGIN_BOTTOM_INDEX 2 #define MARGIN_BOTTOM_SHIFT 25 #define MARGIN_BOTTOM_MASK 0xfe000000 static inline uint8_t get_margin_bottom(const css_computed_style *style, @@ -1578,9 +1600,9 @@ static inline uint8_t get_margin_bottom(const css_computed_style *style, #undef MARGIN_BOTTOM_SHIFT #undef MARGIN_BOTTOM_MASK -#define MARGIN_LEFT_INDEX 2 -#define MARGIN_LEFT_SHIFT 4 -#define MARGIN_LEFT_MASK 0x7f0 +#define MARGIN_LEFT_INDEX 3 +#define MARGIN_LEFT_SHIFT 11 +#define MARGIN_LEFT_MASK 0x3f800 static inline uint8_t get_margin_left(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1600,9 +1622,9 @@ static inline uint8_t get_margin_left(const css_computed_style *style, #undef MARGIN_LEFT_SHIFT #undef MARGIN_LEFT_MASK -#define MARGIN_RIGHT_INDEX 4 -#define MARGIN_RIGHT_SHIFT 18 -#define MARGIN_RIGHT_MASK 0x1fc0000 +#define MARGIN_RIGHT_INDEX 2 +#define MARGIN_RIGHT_SHIFT 11 +#define MARGIN_RIGHT_MASK 0x3f800 static inline uint8_t get_margin_right(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1622,9 +1644,9 @@ static inline uint8_t get_margin_right(const css_computed_style *style, #undef MARGIN_RIGHT_SHIFT #undef MARGIN_RIGHT_MASK -#define MARGIN_TOP_INDEX 3 -#define MARGIN_TOP_SHIFT 11 -#define MARGIN_TOP_MASK 0x3f800 +#define MARGIN_TOP_INDEX 4 +#define MARGIN_TOP_SHIFT 18 +#define MARGIN_TOP_MASK 0x1fc0000 static inline uint8_t get_margin_top(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1644,9 +1666,9 @@ static inline uint8_t get_margin_top(const css_computed_style *style, css_fixed #undef MARGIN_TOP_SHIFT #undef MARGIN_TOP_MASK -#define MAX_HEIGHT_INDEX 3 -#define MAX_HEIGHT_SHIFT 25 -#define MAX_HEIGHT_MASK 0xfe000000 +#define MAX_HEIGHT_INDEX 1 +#define MAX_HEIGHT_SHIFT 11 +#define MAX_HEIGHT_MASK 0x3f800 static inline uint8_t get_max_height(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1688,7 +1710,7 @@ static inline uint8_t get_max_width(const css_computed_style *style, css_fixed #undef MAX_WIDTH_SHIFT #undef MAX_WIDTH_MASK -#define MIN_HEIGHT_INDEX 1 +#define MIN_HEIGHT_INDEX 3 #define MIN_HEIGHT_SHIFT 4 #define MIN_HEIGHT_MASK 0x7f0 static inline uint8_t get_min_height(const css_computed_style *style, css_fixed @@ -1710,9 +1732,9 @@ static inline uint8_t get_min_height(const css_computed_style *style, css_fixed #undef MIN_HEIGHT_SHIFT #undef MIN_HEIGHT_MASK -#define MIN_WIDTH_INDEX 2 -#define MIN_WIDTH_SHIFT 18 -#define MIN_WIDTH_MASK 0x1fc0000 +#define MIN_WIDTH_INDEX 4 +#define MIN_WIDTH_SHIFT 4 +#define MIN_WIDTH_MASK 0x7f0 static inline uint8_t get_min_width(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1754,8 +1776,8 @@ static inline uint8_t get_opacity(const css_computed_style *style, css_fixed #undef OPACITY_MASK #define ORDER_INDEX 10 -#define ORDER_SHIFT 28 -#define ORDER_MASK 0x10000000 +#define ORDER_SHIFT 23 +#define ORDER_MASK 0x800000 static inline uint8_t get_order(const css_computed_style *style, int32_t *integer) { @@ -1774,7 +1796,7 @@ static inline uint8_t get_order(const css_computed_style *style, int32_t #undef ORDER_SHIFT #undef ORDER_MASK -#define OUTLINE_STYLE_INDEX 2 +#define OUTLINE_STYLE_INDEX 1 #define OUTLINE_STYLE_SHIFT 0 #define OUTLINE_STYLE_MASK 0xf static inline uint8_t get_outline_style(const css_computed_style *style) @@ -1792,8 +1814,8 @@ static inline uint8_t get_outline_style(const css_computed_style *style) #undef OUTLINE_STYLE_MASK #define OVERFLOW_INDEX 9 -#define OVERFLOW_SHIFT 26 -#define OVERFLOW_MASK 0x1c000000 +#define OVERFLOW_SHIFT 14 +#define OVERFLOW_MASK 0x1c000 static inline uint8_t get_overflow(const css_computed_style *style) { uint32_t bits = style->i.bits[OVERFLOW_INDEX]; @@ -1809,8 +1831,8 @@ static inline uint8_t get_overflow(const css_computed_style *style) #undef OVERFLOW_MASK #define PADDING_BOTTOM_INDEX 7 -#define PADDING_BOTTOM_SHIFT 26 -#define PADDING_BOTTOM_MASK 0xfc000000 +#define PADDING_BOTTOM_SHIFT 8 +#define PADDING_BOTTOM_MASK 0x3f00 static inline uint8_t get_padding_bottom(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1831,8 +1853,8 @@ static inline uint8_t get_padding_bottom(const css_computed_style *style, #undef PADDING_BOTTOM_MASK #define PADDING_LEFT_INDEX 7 -#define PADDING_LEFT_SHIFT 20 -#define PADDING_LEFT_MASK 0x3f00000 +#define PADDING_LEFT_SHIFT 14 +#define PADDING_LEFT_MASK 0xfc000 static inline uint8_t get_padding_left(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1853,8 +1875,8 @@ static inline uint8_t get_padding_left(const css_computed_style *style, #undef PADDING_LEFT_MASK #define PADDING_RIGHT_INDEX 7 -#define PADDING_RIGHT_SHIFT 8 -#define PADDING_RIGHT_MASK 0x3f00 +#define PADDING_RIGHT_SHIFT 2 +#define PADDING_RIGHT_MASK 0xfc static inline uint8_t get_padding_right(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1875,8 +1897,8 @@ static inline uint8_t get_padding_right(const css_computed_style *style, #undef PADDING_RIGHT_MASK #define PADDING_TOP_INDEX 7 -#define PADDING_TOP_SHIFT 2 -#define PADDING_TOP_MASK 0xfc +#define PADDING_TOP_SHIFT 26 +#define PADDING_TOP_MASK 0xfc000000 static inline uint8_t get_padding_top(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1897,8 +1919,8 @@ static inline uint8_t get_padding_top(const css_computed_style *style, #undef PADDING_TOP_MASK #define POSITION_INDEX 9 -#define POSITION_SHIFT 5 -#define POSITION_MASK 0xe0 +#define POSITION_SHIFT 11 +#define POSITION_MASK 0x3800 static inline uint8_t get_position(const css_computed_style *style) { uint32_t bits = style->i.bits[POSITION_INDEX]; @@ -1913,9 +1935,9 @@ static inline uint8_t get_position(const css_computed_style *style) #undef POSITION_SHIFT #undef POSITION_MASK -#define QUOTES_INDEX 9 -#define QUOTES_SHIFT 0 -#define QUOTES_MASK 0x1 +#define QUOTES_INDEX 10 +#define QUOTES_SHIFT 27 +#define QUOTES_MASK 0x8000000 static inline uint8_t get_quotes(const css_computed_style *style, lwc_string ***string_arr) { @@ -1924,7 +1946,7 @@ static inline uint8_t get_quotes(const css_computed_style *style, lwc_string bits >>= QUOTES_SHIFT; /* 1bit: t : type */ - *string_arr = style->i.quotes; + *string_arr = style->quotes; return (bits & 0x1); } @@ -1932,9 +1954,9 @@ static inline uint8_t get_quotes(const css_computed_style *style, lwc_string #undef QUOTES_SHIFT #undef QUOTES_MASK -#define RIGHT_INDEX 3 -#define RIGHT_SHIFT 4 -#define RIGHT_MASK 0x7f0 +#define RIGHT_INDEX 4 +#define RIGHT_SHIFT 11 +#define RIGHT_MASK 0x3f800 static inline uint8_t get_right(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -1955,8 +1977,8 @@ static inline uint8_t get_right(const css_computed_style *style, css_fixed #undef RIGHT_MASK #define TABLE_LAYOUT_INDEX 8 -#define TABLE_LAYOUT_SHIFT 8 -#define TABLE_LAYOUT_MASK 0x300 +#define TABLE_LAYOUT_SHIFT 0 +#define TABLE_LAYOUT_MASK 0x3 static inline uint8_t get_table_layout(const css_computed_style *style) { uint32_t bits = style->i.bits[TABLE_LAYOUT_INDEX]; @@ -1972,8 +1994,8 @@ static inline uint8_t get_table_layout(const css_computed_style *style) #undef TABLE_LAYOUT_MASK #define TEXT_ALIGN_INDEX 6 -#define TEXT_ALIGN_SHIFT 18 -#define TEXT_ALIGN_MASK 0x3c0000 +#define TEXT_ALIGN_SHIFT 10 +#define TEXT_ALIGN_MASK 0x3c00 static inline uint8_t get_text_align(const css_computed_style *style) { uint32_t bits = style->i.bits[TEXT_ALIGN_INDEX]; @@ -1989,8 +2011,8 @@ static inline uint8_t get_text_align(const css_computed_style *style) #undef TEXT_ALIGN_MASK #define TEXT_DECORATION_INDEX 6 -#define TEXT_DECORATION_SHIFT 27 -#define TEXT_DECORATION_MASK 0xf8000000 +#define TEXT_DECORATION_SHIFT 22 +#define TEXT_DECORATION_MASK 0x7c00000 static inline uint8_t get_text_decoration(const css_computed_style *style) { uint32_t bits = style->i.bits[TEXT_DECORATION_INDEX]; @@ -2006,8 +2028,8 @@ static inline uint8_t get_text_decoration(const css_computed_style *style) #undef TEXT_DECORATION_MASK #define TEXT_INDENT_INDEX 7 -#define TEXT_INDENT_SHIFT 14 -#define TEXT_INDENT_MASK 0xfc000 +#define TEXT_INDENT_SHIFT 20 +#define TEXT_INDENT_MASK 0x3f00000 static inline uint8_t get_text_indent(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -2027,9 +2049,9 @@ static inline uint8_t get_text_indent(const css_computed_style *style, #undef TEXT_INDENT_SHIFT #undef TEXT_INDENT_MASK -#define TEXT_TRANSFORM_INDEX 9 -#define TEXT_TRANSFORM_SHIFT 11 -#define TEXT_TRANSFORM_MASK 0x3800 +#define TEXT_TRANSFORM_INDEX 6 +#define TEXT_TRANSFORM_SHIFT 0 +#define TEXT_TRANSFORM_MASK 0x7 static inline uint8_t get_text_transform(const css_computed_style *style) { uint32_t bits = style->i.bits[TEXT_TRANSFORM_INDEX]; @@ -2044,9 +2066,9 @@ static inline uint8_t get_text_transform(const css_computed_style *style) #undef TEXT_TRANSFORM_SHIFT #undef TEXT_TRANSFORM_MASK -#define TOP_INDEX 4 -#define TOP_SHIFT 11 -#define TOP_MASK 0x3f800 +#define TOP_INDEX 1 +#define TOP_SHIFT 25 +#define TOP_MASK 0xfe000000 static inline uint8_t get_top(const css_computed_style *style, css_fixed *length, css_unit *unit) { @@ -2067,8 +2089,8 @@ static inline uint8_t get_top(const css_computed_style *style, css_fixed #undef TOP_MASK #define UNICODE_BIDI_INDEX 8 -#define UNICODE_BIDI_SHIFT 18 -#define UNICODE_BIDI_MASK 0xc0000 +#define UNICODE_BIDI_SHIFT 6 +#define UNICODE_BIDI_MASK 0xc0 static inline uint8_t get_unicode_bidi(const css_computed_style *style) { uint32_t bits = style->i.bits[UNICODE_BIDI_INDEX]; @@ -2105,9 +2127,9 @@ static inline uint8_t get_vertical_align(const css_computed_style *style, #undef VERTICAL_ALIGN_SHIFT #undef VERTICAL_ALIGN_MASK -#define VISIBILITY_INDEX 8 -#define VISIBILITY_SHIFT 14 -#define VISIBILITY_MASK 0xc000 +#define VISIBILITY_INDEX 9 +#define VISIBILITY_SHIFT 3 +#define VISIBILITY_MASK 0x18 static inline uint8_t get_visibility(const css_computed_style *style) { uint32_t bits = style->i.bits[VISIBILITY_INDEX]; @@ -2122,9 +2144,9 @@ static inline uint8_t get_visibility(const css_computed_style *style) #undef VISIBILITY_SHIFT #undef VISIBILITY_MASK -#define WHITE_SPACE_INDEX 6 -#define WHITE_SPACE_SHIFT 0 -#define WHITE_SPACE_MASK 0x7 +#define WHITE_SPACE_INDEX 9 +#define WHITE_SPACE_SHIFT 5 +#define WHITE_SPACE_MASK 0xe0 static inline uint8_t get_white_space(const css_computed_style *style) { uint32_t bits = style->i.bits[WHITE_SPACE_INDEX]; @@ -2139,7 +2161,7 @@ static inline uint8_t get_white_space(const css_computed_style *style) #undef WHITE_SPACE_SHIFT #undef WHITE_SPACE_MASK -#define WIDTH_INDEX 3 +#define WIDTH_INDEX 2 #define WIDTH_SHIFT 18 #define WIDTH_MASK 0x1fc0000 static inline uint8_t get_width(const css_computed_style *style, css_fixed @@ -2162,8 +2184,8 @@ static inline uint8_t get_width(const css_computed_style *style, css_fixed #undef WIDTH_MASK #define Z_INDEX_INDEX 8 -#define Z_INDEX_SHIFT 28 -#define Z_INDEX_MASK 0x30000000 +#define Z_INDEX_SHIFT 14 +#define Z_INDEX_MASK 0xc000 static inline uint8_t get_z_index(const css_computed_style *style, int32_t *integer) { diff --git a/src/select/autogenerated_propset.h b/src/select/autogenerated_propset.h index 4b13a26..005ce0c 100644 --- a/src/select/autogenerated_propset.h +++ b/src/select/autogenerated_propset.h @@ -11,24 +11,25 @@ static const css_computed_uncommon default_uncommon = { .i = { .bits = { (CSS_BORDER_SPACING_SET << 21) | ( - CSS_COLUMN_RULE_WIDTH_MEDIUM << 13) | ( - CSS_OUTLINE_WIDTH_MEDIUM << 5) | + CSS_OUTLINE_WIDTH_MEDIUM << 13) | ( + CSS_COLUMN_RULE_WIDTH_MEDIUM << 5) | CSS_CURSOR_INHERIT, - (CSS_WORD_SPACING_NORMAL << 25) | ( - CSS_COLUMN_WIDTH_AUTO << 18) | ( + (CSS_COLUMN_WIDTH_AUTO << 25) | ( + CSS_LETTER_SPACING_NORMAL << 18) | ( CSS_COLUMN_GAP_NORMAL << 11) | ( - CSS_LETTER_SPACING_NORMAL << 4) | - CSS_COLUMN_RULE_STYLE_NONE, - (CSS_CLIP_AUTO << 6) | (CSS_BREAK_INSIDE_AUTO << 2) | - CSS_COLUMN_SPAN_NONE, - (CSS_BREAK_AFTER_AUTO << 28) | (CSS_BREAK_BEFORE_AUTO - << 24) | (CSS_OUTLINE_COLOR_INVERT << - 22) | (CSS_COLUMN_FILL_BALANCE << 20) | - (CSS_CONTENT_NORMAL << 18) | ( - CSS_COLUMN_COUNT_AUTO << 16) | ( - CSS_COLUMN_RULE_CURRENT_COLOR << 14) | ( - CSS_COUNTER_INCREMENT_NONE << 13) | ( - CSS_COUNTER_RESET_NONE << 12) + CSS_WORD_SPACING_NORMAL << 4) | + CSS_BREAK_AFTER_AUTO, + (CSS_CLIP_AUTO << 6) | (CSS_COLUMN_RULE_STYLE_NONE << + 2) | CSS_CONTENT_NORMAL, + (CSS_BREAK_INSIDE_AUTO << 28) | (CSS_BREAK_BEFORE_AUTO + << 24) | (CSS_COLUMN_COUNT_AUTO << 22) + | (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR + << 20) | (CSS_OUTLINE_COLOR_INVERT << + 18) | (CSS_WRITING_MODE_HORIZONTAL_TB + << 16) | (CSS_COLUMN_FILL_BALANCE << + 14) | (CSS_COLUMN_SPAN_NONE << 12) | ( + CSS_COUNTER_RESET_NONE << 11) | ( + CSS_COUNTER_INCREMENT_NONE << 10) }, .border_spacing_a = 0, .border_spacing_b = 0, @@ -75,7 +76,7 @@ static inline css_error set_border_spacing(css_computed_style *style, uint8_t type, css_fixed length_a, css_unit unit_a, css_fixed length_b, css_unit unit_b) { - uint32_t bits = &style->i.uncommon->i.bits[BORDER_SPACING_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[BORDER_SPACING_INDEX]; ENSURE_UNCOMMON; @@ -93,13 +94,13 @@ static inline css_error set_border_spacing(css_computed_style *style, uint8_t #undef BORDER_SPACING_SHIFT #undef BORDER_SPACING_MASK -#define BREAK_AFTER_INDEX 3 -#define BREAK_AFTER_SHIFT 28 -#define BREAK_AFTER_MASK 0xf0000000 +#define BREAK_AFTER_INDEX 1 +#define BREAK_AFTER_SHIFT 0 +#define BREAK_AFTER_MASK 0xf static inline css_error set_break_after(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.uncommon->i.bits[BREAK_AFTER_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[BREAK_AFTER_INDEX]; ENSURE_UNCOMMON; @@ -120,7 +121,7 @@ static inline css_error set_break_after(css_computed_style *style, uint8_t type) static inline css_error set_break_before(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.uncommon->i.bits[BREAK_BEFORE_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[BREAK_BEFORE_INDEX]; ENSURE_UNCOMMON; @@ -134,14 +135,14 @@ static inline css_error set_break_before(css_computed_style *style, uint8_t #undef BREAK_BEFORE_SHIFT #undef BREAK_BEFORE_MASK -#define BREAK_INSIDE_INDEX 2 -#define BREAK_INSIDE_SHIFT 2 -#define BREAK_INSIDE_MASK 0x3c +#define BREAK_INSIDE_INDEX 3 +#define BREAK_INSIDE_SHIFT 28 +#define BREAK_INSIDE_MASK 0xf0000000 static inline css_error set_break_inside(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.uncommon->i.bits[BREAK_INSIDE_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[BREAK_INSIDE_INDEX]; ENSURE_UNCOMMON; @@ -201,13 +202,13 @@ static inline css_error set_clip( #undef CLIP_SHIFT #undef CLIP_MASK #define COLUMN_COUNT_INDEX 3 -#define COLUMN_COUNT_SHIFT 16 -#define COLUMN_COUNT_MASK 0x30000 +#define COLUMN_COUNT_SHIFT 22 +#define COLUMN_COUNT_MASK 0xc00000 static inline css_error set_column_count(css_computed_style *style, uint8_t type, int32_t integer) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_COUNT_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_COUNT_INDEX]; ENSURE_UNCOMMON; @@ -224,12 +225,12 @@ static inline css_error set_column_count(css_computed_style *style, uint8_t #undef COLUMN_COUNT_MASK #define COLUMN_FILL_INDEX 3 -#define COLUMN_FILL_SHIFT 20 -#define COLUMN_FILL_MASK 0x300000 +#define COLUMN_FILL_SHIFT 14 +#define COLUMN_FILL_MASK 0xc000 static inline css_error set_column_fill(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_FILL_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_FILL_INDEX]; ENSURE_UNCOMMON; @@ -250,7 +251,7 @@ static inline css_error set_column_fill(css_computed_style *style, uint8_t type) static inline css_error set_column_gap(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_GAP_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_GAP_INDEX]; ENSURE_UNCOMMON; @@ -267,13 +268,13 @@ static inline css_error set_column_gap(css_computed_style *style, uint8_t type, #undef COLUMN_GAP_MASK #define COLUMN_RULE_COLOR_INDEX 3 -#define COLUMN_RULE_COLOR_SHIFT 14 -#define COLUMN_RULE_COLOR_MASK 0xc000 +#define COLUMN_RULE_COLOR_SHIFT 20 +#define COLUMN_RULE_COLOR_MASK 0x300000 static inline css_error set_column_rule_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_RULE_COLOR_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_RULE_COLOR_INDEX]; ENSURE_UNCOMMON; @@ -289,14 +290,14 @@ static inline css_error set_column_rule_color(css_computed_style *style, #undef COLUMN_RULE_COLOR_SHIFT #undef COLUMN_RULE_COLOR_MASK -#define COLUMN_RULE_STYLE_INDEX 1 -#define COLUMN_RULE_STYLE_SHIFT 0 -#define COLUMN_RULE_STYLE_MASK 0xf +#define COLUMN_RULE_STYLE_INDEX 2 +#define COLUMN_RULE_STYLE_SHIFT 2 +#define COLUMN_RULE_STYLE_MASK 0x3c static inline css_error set_column_rule_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_RULE_STYLE_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_RULE_STYLE_INDEX]; ENSURE_UNCOMMON; @@ -311,13 +312,13 @@ static inline css_error set_column_rule_style(css_computed_style *style, #undef COLUMN_RULE_STYLE_MASK #define COLUMN_RULE_WIDTH_INDEX 0 -#define COLUMN_RULE_WIDTH_SHIFT 13 -#define COLUMN_RULE_WIDTH_MASK 0x1fe000 +#define COLUMN_RULE_WIDTH_SHIFT 5 +#define COLUMN_RULE_WIDTH_MASK 0x1fe0 static inline css_error set_column_rule_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_RULE_WIDTH_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_RULE_WIDTH_INDEX]; ENSURE_UNCOMMON; @@ -333,13 +334,13 @@ static inline css_error set_column_rule_width(css_computed_style *style, #undef COLUMN_RULE_WIDTH_SHIFT #undef COLUMN_RULE_WIDTH_MASK -#define COLUMN_SPAN_INDEX 2 -#define COLUMN_SPAN_SHIFT 0 -#define COLUMN_SPAN_MASK 0x3 +#define COLUMN_SPAN_INDEX 3 +#define COLUMN_SPAN_SHIFT 12 +#define COLUMN_SPAN_MASK 0x3000 static inline css_error set_column_span(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_SPAN_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_SPAN_INDEX]; ENSURE_UNCOMMON; @@ -354,13 +355,13 @@ static inline css_error set_column_span(css_computed_style *style, uint8_t type) #undef COLUMN_SPAN_MASK #define COLUMN_WIDTH_INDEX 1 -#define COLUMN_WIDTH_SHIFT 18 -#define COLUMN_WIDTH_MASK 0x1fc0000 +#define COLUMN_WIDTH_SHIFT 25 +#define COLUMN_WIDTH_MASK 0xfe000000 static inline css_error set_column_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.uncommon->i.bits[COLUMN_WIDTH_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COLUMN_WIDTH_INDEX]; ENSURE_UNCOMMON; @@ -376,14 +377,14 @@ static inline css_error set_column_width(css_computed_style *style, uint8_t #undef COLUMN_WIDTH_SHIFT #undef COLUMN_WIDTH_MASK -#define CONTENT_INDEX 3 -#define CONTENT_SHIFT 18 -#define CONTENT_MASK 0xc0000 +#define CONTENT_INDEX 2 +#define CONTENT_SHIFT 0 +#define CONTENT_MASK 0x3 static inline css_error set_content( css_computed_style *style, uint8_t type, css_computed_content_item *content) { - uint8_t *bits; + uint32_t *bits; css_computed_content_item *oldcontent; css_computed_content_item *c; @@ -462,13 +463,13 @@ static inline css_error set_content( #undef CONTENT_SHIFT #undef CONTENT_MASK #define COUNTER_INCREMENT_INDEX 3 -#define COUNTER_INCREMENT_SHIFT 13 -#define COUNTER_INCREMENT_MASK 0x2000 +#define COUNTER_INCREMENT_SHIFT 10 +#define COUNTER_INCREMENT_MASK 0x400 static inline css_error set_counter_increment(css_computed_style *style, uint8_t type, css_computed_counter *counter_arr) { - uint32_t bits = &style->i.uncommon->i.bits[COUNTER_INCREMENT_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COUNTER_INCREMENT_INDEX]; ENSURE_UNCOMMON; @@ -501,13 +502,13 @@ static inline css_error set_counter_increment(css_computed_style *style, #undef COUNTER_INCREMENT_MASK #define COUNTER_RESET_INDEX 3 -#define COUNTER_RESET_SHIFT 12 -#define COUNTER_RESET_MASK 0x1000 +#define COUNTER_RESET_SHIFT 11 +#define COUNTER_RESET_MASK 0x800 static inline css_error set_counter_reset(css_computed_style *style, uint8_t type, css_computed_counter *counter_arr) { - uint32_t bits = &style->i.uncommon->i.bits[COUNTER_RESET_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[COUNTER_RESET_INDEX]; ENSURE_UNCOMMON; @@ -546,7 +547,7 @@ static inline css_error set_counter_reset(css_computed_style *style, uint8_t static inline css_error set_cursor(css_computed_style *style, uint8_t type, lwc_string **string_arr) { - uint32_t bits = &style->i.uncommon->i.bits[CURSOR_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[CURSOR_INDEX]; ENSURE_UNCOMMON; @@ -577,13 +578,13 @@ static inline css_error set_cursor(css_computed_style *style, uint8_t type, #undef CURSOR_MASK #define LETTER_SPACING_INDEX 1 -#define LETTER_SPACING_SHIFT 4 -#define LETTER_SPACING_MASK 0x7f0 +#define LETTER_SPACING_SHIFT 18 +#define LETTER_SPACING_MASK 0x1fc0000 static inline css_error set_letter_spacing(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.uncommon->i.bits[LETTER_SPACING_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[LETTER_SPACING_INDEX]; ENSURE_UNCOMMON; @@ -600,13 +601,13 @@ static inline css_error set_letter_spacing(css_computed_style *style, uint8_t #undef LETTER_SPACING_MASK #define OUTLINE_COLOR_INDEX 3 -#define OUTLINE_COLOR_SHIFT 22 -#define OUTLINE_COLOR_MASK 0xc00000 +#define OUTLINE_COLOR_SHIFT 18 +#define OUTLINE_COLOR_MASK 0xc0000 static inline css_error set_outline_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.uncommon->i.bits[OUTLINE_COLOR_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[OUTLINE_COLOR_INDEX]; ENSURE_UNCOMMON; @@ -623,13 +624,13 @@ static inline css_error set_outline_color(css_computed_style *style, uint8_t #undef OUTLINE_COLOR_MASK #define OUTLINE_WIDTH_INDEX 0 -#define OUTLINE_WIDTH_SHIFT 5 -#define OUTLINE_WIDTH_MASK 0x1fe0 +#define OUTLINE_WIDTH_SHIFT 13 +#define OUTLINE_WIDTH_MASK 0x1fe000 static inline css_error set_outline_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.uncommon->i.bits[OUTLINE_WIDTH_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[OUTLINE_WIDTH_INDEX]; ENSURE_UNCOMMON; @@ -646,13 +647,13 @@ static inline css_error set_outline_width(css_computed_style *style, uint8_t #undef OUTLINE_WIDTH_MASK #define WORD_SPACING_INDEX 1 -#define WORD_SPACING_SHIFT 25 -#define WORD_SPACING_MASK 0xfe000000 +#define WORD_SPACING_SHIFT 4 +#define WORD_SPACING_MASK 0x7f0 static inline css_error set_word_spacing(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.uncommon->i.bits[WORD_SPACING_INDEX]; + uint32_t *bits = &style->i.uncommon->i.bits[WORD_SPACING_INDEX]; ENSURE_UNCOMMON; @@ -668,9 +669,30 @@ static inline css_error set_word_spacing(css_computed_style *style, uint8_t #undef WORD_SPACING_SHIFT #undef WORD_SPACING_MASK +#define WRITING_MODE_INDEX 3 +#define WRITING_MODE_SHIFT 16 +#define WRITING_MODE_MASK 0x30000 + +static inline css_error set_writing_mode(css_computed_style *style, uint8_t + type) +{ + uint32_t *bits = &style->i.uncommon->i.bits[WRITING_MODE_INDEX]; + + ENSURE_UNCOMMON; + + /* 2bits: tt : type */ + *bits = (*bits & ~WRITING_MODE_MASK) | ((type & 0x3) << + WRITING_MODE_SHIFT); + + return CSS_OK; +} +#undef WRITING_MODE_INDEX +#undef WRITING_MODE_SHIFT +#undef WRITING_MODE_MASK + static const css_computed_page default_page = { .bits = { - (CSS_PAGE_BREAK_AFTER_AUTO << 29) | (CSS_PAGE_BREAK_BEFORE_AUTO + (CSS_PAGE_BREAK_BEFORE_AUTO << 29) | (CSS_PAGE_BREAK_AFTER_AUTO << 26) | (CSS_PAGE_BREAK_INSIDE_AUTO << 24) | ( CSS_WIDOWS_SET << 23) | (CSS_ORPHANS_SET << 22) }, @@ -696,7 +718,7 @@ static const css_computed_page default_page = { static inline css_error set_orphans(css_computed_style *style, uint8_t type, int32_t integer) { - uint32_t bits = &style->page->bits[ORPHANS_INDEX]; + uint32_t *bits = &style->page->bits[ORPHANS_INDEX]; ENSURE_PAGE; @@ -712,13 +734,13 @@ static inline css_error set_orphans(css_computed_style *style, uint8_t type, #undef ORPHANS_MASK #define PAGE_BREAK_AFTER_INDEX 0 -#define PAGE_BREAK_AFTER_SHIFT 29 -#define PAGE_BREAK_AFTER_MASK 0xe0000000 +#define PAGE_BREAK_AFTER_SHIFT 26 +#define PAGE_BREAK_AFTER_MASK 0x1c000000 static inline css_error set_page_break_after(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->page->bits[PAGE_BREAK_AFTER_INDEX]; + uint32_t *bits = &style->page->bits[PAGE_BREAK_AFTER_INDEX]; ENSURE_PAGE; @@ -733,13 +755,13 @@ static inline css_error set_page_break_after(css_computed_style *style, uint8_t #undef PAGE_BREAK_AFTER_MASK #define PAGE_BREAK_BEFORE_INDEX 0 -#define PAGE_BREAK_BEFORE_SHIFT 26 -#define PAGE_BREAK_BEFORE_MASK 0x1c000000 +#define PAGE_BREAK_BEFORE_SHIFT 29 +#define PAGE_BREAK_BEFORE_MASK 0xe0000000 static inline css_error set_page_break_before(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->page->bits[PAGE_BREAK_BEFORE_INDEX]; + uint32_t *bits = &style->page->bits[PAGE_BREAK_BEFORE_INDEX]; ENSURE_PAGE; @@ -760,7 +782,7 @@ static inline css_error set_page_break_before(css_computed_style *style, static inline css_error set_page_break_inside(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->page->bits[PAGE_BREAK_INSIDE_INDEX]; + uint32_t *bits = &style->page->bits[PAGE_BREAK_INSIDE_INDEX]; ENSURE_PAGE; @@ -781,7 +803,7 @@ static inline css_error set_page_break_inside(css_computed_style *style, static inline css_error set_widows(css_computed_style *style, uint8_t type, int32_t integer) { - uint32_t bits = &style->page->bits[WIDOWS_INDEX]; + uint32_t *bits = &style->page->bits[WIDOWS_INDEX]; ENSURE_PAGE; @@ -796,14 +818,14 @@ static inline css_error set_widows(css_computed_style *style, uint8_t type, #undef WIDOWS_SHIFT #undef WIDOWS_MASK -#define ALIGN_CONTENT_INDEX 6 -#define ALIGN_CONTENT_SHIFT 3 -#define ALIGN_CONTENT_MASK 0x38 +#define ALIGN_CONTENT_INDEX 9 +#define ALIGN_CONTENT_SHIFT 8 +#define ALIGN_CONTENT_MASK 0x700 static inline css_error set_align_content(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[ALIGN_CONTENT_INDEX]; + uint32_t *bits = &style->i.bits[ALIGN_CONTENT_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~ALIGN_CONTENT_MASK) | ((type & 0x7) << @@ -816,12 +838,12 @@ static inline css_error set_align_content(css_computed_style *style, uint8_t #undef ALIGN_CONTENT_MASK #define ALIGN_ITEMS_INDEX 9 -#define ALIGN_ITEMS_SHIFT 14 -#define ALIGN_ITEMS_MASK 0x1c000 +#define ALIGN_ITEMS_SHIFT 17 +#define ALIGN_ITEMS_MASK 0xe0000 static inline css_error set_align_items(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[ALIGN_ITEMS_INDEX]; + uint32_t *bits = &style->i.bits[ALIGN_ITEMS_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~ALIGN_ITEMS_MASK) | ((type & 0x7) << @@ -833,13 +855,13 @@ static inline css_error set_align_items(css_computed_style *style, uint8_t type) #undef ALIGN_ITEMS_SHIFT #undef ALIGN_ITEMS_MASK -#define ALIGN_SELF_INDEX 5 -#define ALIGN_SELF_SHIFT 0 -#define ALIGN_SELF_MASK 0x7 +#define ALIGN_SELF_INDEX 9 +#define ALIGN_SELF_SHIFT 23 +#define ALIGN_SELF_MASK 0x3800000 static inline css_error set_align_self(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[ALIGN_SELF_INDEX]; + uint32_t *bits = &style->i.bits[ALIGN_SELF_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~ALIGN_SELF_MASK) | ((type & 0x7) << ALIGN_SELF_SHIFT); @@ -850,14 +872,14 @@ static inline css_error set_align_self(css_computed_style *style, uint8_t type) #undef ALIGN_SELF_SHIFT #undef ALIGN_SELF_MASK -#define BACKGROUND_ATTACHMENT_INDEX 7 -#define BACKGROUND_ATTACHMENT_SHIFT 0 -#define BACKGROUND_ATTACHMENT_MASK 0x3 +#define BACKGROUND_ATTACHMENT_INDEX 8 +#define BACKGROUND_ATTACHMENT_SHIFT 12 +#define BACKGROUND_ATTACHMENT_MASK 0x3000 static inline css_error set_background_attachment(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BACKGROUND_ATTACHMENT_INDEX]; + uint32_t *bits = &style->i.bits[BACKGROUND_ATTACHMENT_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BACKGROUND_ATTACHMENT_MASK) | ((type & 0x3) << @@ -870,13 +892,13 @@ static inline css_error set_background_attachment(css_computed_style *style, #undef BACKGROUND_ATTACHMENT_MASK #define BACKGROUND_COLOR_INDEX 8 -#define BACKGROUND_COLOR_SHIFT 10 -#define BACKGROUND_COLOR_MASK 0xc00 +#define BACKGROUND_COLOR_SHIFT 28 +#define BACKGROUND_COLOR_MASK 0x30000000 static inline css_error set_background_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.bits[BACKGROUND_COLOR_INDEX]; + uint32_t *bits = &style->i.bits[BACKGROUND_COLOR_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BACKGROUND_COLOR_MASK) | ((type & 0x3) << @@ -891,13 +913,13 @@ static inline css_error set_background_color(css_computed_style *style, uint8_t #undef BACKGROUND_COLOR_MASK #define BACKGROUND_IMAGE_INDEX 10 -#define BACKGROUND_IMAGE_SHIFT 23 -#define BACKGROUND_IMAGE_MASK 0x800000 +#define BACKGROUND_IMAGE_SHIFT 26 +#define BACKGROUND_IMAGE_MASK 0x4000000 static inline css_error set_background_image(css_computed_style *style, uint8_t type, lwc_string *string) { - uint32_t bits = &style->i.bits[BACKGROUND_IMAGE_INDEX]; + uint32_t *bits = &style->i.bits[BACKGROUND_IMAGE_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~BACKGROUND_IMAGE_MASK) | ((type & 0x1) << @@ -909,8 +931,9 @@ static inline css_error set_background_image(css_computed_style *style, uint8_t style->i.background_image = lwc_string_ref(string); } else { style->i.background_image = NULL; + } - if (old_string != NULL + if (old_string != NULL) lwc_string_unref(old_string); return CSS_OK; @@ -927,7 +950,7 @@ static inline css_error set_background_position(css_computed_style *style, uint8_t type, css_fixed length_a, css_unit unit_a, css_fixed length_b, css_unit unit_b) { - uint32_t bits = &style->i.bits[BACKGROUND_POSITION_INDEX]; + uint32_t *bits = &style->i.bits[BACKGROUND_POSITION_INDEX]; /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */ *bits = (*bits & ~BACKGROUND_POSITION_MASK) | (((type & 0x1) | (unit_b @@ -943,14 +966,14 @@ static inline css_error set_background_position(css_computed_style *style, #undef BACKGROUND_POSITION_SHIFT #undef BACKGROUND_POSITION_MASK -#define BACKGROUND_REPEAT_INDEX 9 -#define BACKGROUND_REPEAT_SHIFT 29 -#define BACKGROUND_REPEAT_MASK 0xe0000000 +#define BACKGROUND_REPEAT_INDEX 5 +#define BACKGROUND_REPEAT_SHIFT 0 +#define BACKGROUND_REPEAT_MASK 0x7 static inline css_error set_background_repeat(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BACKGROUND_REPEAT_INDEX]; + uint32_t *bits = &style->i.bits[BACKGROUND_REPEAT_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~BACKGROUND_REPEAT_MASK) | ((type & 0x7) << @@ -963,13 +986,13 @@ static inline css_error set_background_repeat(css_computed_style *style, #undef BACKGROUND_REPEAT_MASK #define BORDER_BOTTOM_COLOR_INDEX 8 -#define BORDER_BOTTOM_COLOR_SHIFT 30 -#define BORDER_BOTTOM_COLOR_MASK 0xc0000000 +#define BORDER_BOTTOM_COLOR_SHIFT 24 +#define BORDER_BOTTOM_COLOR_MASK 0x3000000 static inline css_error set_border_bottom_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.bits[BORDER_BOTTOM_COLOR_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_BOTTOM_COLOR_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BORDER_BOTTOM_COLOR_MASK) | ((type & 0x3) << @@ -983,14 +1006,14 @@ static inline css_error set_border_bottom_color(css_computed_style *style, #undef BORDER_BOTTOM_COLOR_SHIFT #undef BORDER_BOTTOM_COLOR_MASK -#define BORDER_BOTTOM_STYLE_INDEX 6 -#define BORDER_BOTTOM_STYLE_SHIFT 10 -#define BORDER_BOTTOM_STYLE_MASK 0x3c00 +#define BORDER_BOTTOM_STYLE_INDEX 3 +#define BORDER_BOTTOM_STYLE_SHIFT 0 +#define BORDER_BOTTOM_STYLE_MASK 0xf static inline css_error set_border_bottom_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BORDER_BOTTOM_STYLE_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_BOTTOM_STYLE_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~BORDER_BOTTOM_STYLE_MASK) | ((type & 0xf) << @@ -1003,13 +1026,13 @@ static inline css_error set_border_bottom_style(css_computed_style *style, #undef BORDER_BOTTOM_STYLE_MASK #define BORDER_BOTTOM_WIDTH_INDEX 0 -#define BORDER_BOTTOM_WIDTH_SHIFT 8 -#define BORDER_BOTTOM_WIDTH_MASK 0xff00 +#define BORDER_BOTTOM_WIDTH_SHIFT 0 +#define BORDER_BOTTOM_WIDTH_MASK 0xff static inline css_error set_border_bottom_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[BORDER_BOTTOM_WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_BOTTOM_WIDTH_INDEX]; /* 8bits: uuuuuttt : unit | type */ *bits = (*bits & ~BORDER_BOTTOM_WIDTH_MASK) | (((type & 0x7) | (unit << @@ -1030,7 +1053,7 @@ static inline css_error set_border_bottom_width(css_computed_style *style, static inline css_error set_border_collapse(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BORDER_COLLAPSE_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_COLLAPSE_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BORDER_COLLAPSE_MASK) | ((type & 0x3) << @@ -1042,14 +1065,14 @@ static inline css_error set_border_collapse(css_computed_style *style, uint8_t #undef BORDER_COLLAPSE_SHIFT #undef BORDER_COLLAPSE_MASK -#define BORDER_LEFT_COLOR_INDEX 8 +#define BORDER_LEFT_COLOR_INDEX 7 #define BORDER_LEFT_COLOR_SHIFT 0 #define BORDER_LEFT_COLOR_MASK 0x3 static inline css_error set_border_left_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.bits[BORDER_LEFT_COLOR_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_LEFT_COLOR_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BORDER_LEFT_COLOR_MASK) | ((type & 0x3) << @@ -1064,13 +1087,13 @@ static inline css_error set_border_left_color(css_computed_style *style, #undef BORDER_LEFT_COLOR_MASK #define BORDER_LEFT_STYLE_INDEX 6 -#define BORDER_LEFT_STYLE_SHIFT 6 -#define BORDER_LEFT_STYLE_MASK 0x3c0 +#define BORDER_LEFT_STYLE_SHIFT 14 +#define BORDER_LEFT_STYLE_MASK 0x3c000 static inline css_error set_border_left_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BORDER_LEFT_STYLE_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_LEFT_STYLE_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~BORDER_LEFT_STYLE_MASK) | ((type & 0xf) << @@ -1083,13 +1106,13 @@ static inline css_error set_border_left_style(css_computed_style *style, #undef BORDER_LEFT_STYLE_MASK #define BORDER_LEFT_WIDTH_INDEX 0 -#define BORDER_LEFT_WIDTH_SHIFT 0 -#define BORDER_LEFT_WIDTH_MASK 0xff +#define BORDER_LEFT_WIDTH_SHIFT 16 +#define BORDER_LEFT_WIDTH_MASK 0xff0000 static inline css_error set_border_left_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[BORDER_LEFT_WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_LEFT_WIDTH_INDEX]; /* 8bits: uuuuuttt : unit | type */ *bits = (*bits & ~BORDER_LEFT_WIDTH_MASK) | (((type & 0x7) | (unit << @@ -1104,13 +1127,13 @@ static inline css_error set_border_left_width(css_computed_style *style, #undef BORDER_LEFT_WIDTH_MASK #define BORDER_RIGHT_COLOR_INDEX 8 -#define BORDER_RIGHT_COLOR_SHIFT 20 -#define BORDER_RIGHT_COLOR_MASK 0x300000 +#define BORDER_RIGHT_COLOR_SHIFT 10 +#define BORDER_RIGHT_COLOR_MASK 0xc00 static inline css_error set_border_right_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.bits[BORDER_RIGHT_COLOR_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_RIGHT_COLOR_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BORDER_RIGHT_COLOR_MASK) | ((type & 0x3) << @@ -1124,14 +1147,14 @@ static inline css_error set_border_right_color(css_computed_style *style, #undef BORDER_RIGHT_COLOR_SHIFT #undef BORDER_RIGHT_COLOR_MASK -#define BORDER_RIGHT_STYLE_INDEX 4 +#define BORDER_RIGHT_STYLE_INDEX 2 #define BORDER_RIGHT_STYLE_SHIFT 0 #define BORDER_RIGHT_STYLE_MASK 0xf static inline css_error set_border_right_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BORDER_RIGHT_STYLE_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_RIGHT_STYLE_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~BORDER_RIGHT_STYLE_MASK) | ((type & 0xf) << @@ -1144,13 +1167,13 @@ static inline css_error set_border_right_style(css_computed_style *style, #undef BORDER_RIGHT_STYLE_MASK #define BORDER_RIGHT_WIDTH_INDEX 0 -#define BORDER_RIGHT_WIDTH_SHIFT 16 -#define BORDER_RIGHT_WIDTH_MASK 0xff0000 +#define BORDER_RIGHT_WIDTH_SHIFT 8 +#define BORDER_RIGHT_WIDTH_MASK 0xff00 static inline css_error set_border_right_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[BORDER_RIGHT_WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_RIGHT_WIDTH_INDEX]; /* 8bits: uuuuuttt : unit | type */ *bits = (*bits & ~BORDER_RIGHT_WIDTH_MASK) | (((type & 0x7) | (unit << @@ -1164,14 +1187,14 @@ static inline css_error set_border_right_width(css_computed_style *style, #undef BORDER_RIGHT_WIDTH_SHIFT #undef BORDER_RIGHT_WIDTH_MASK -#define BORDER_TOP_COLOR_INDEX 9 -#define BORDER_TOP_COLOR_SHIFT 1 -#define BORDER_TOP_COLOR_MASK 0x6 +#define BORDER_TOP_COLOR_INDEX 8 +#define BORDER_TOP_COLOR_SHIFT 22 +#define BORDER_TOP_COLOR_MASK 0xc00000 static inline css_error set_border_top_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.bits[BORDER_TOP_COLOR_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_TOP_COLOR_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BORDER_TOP_COLOR_MASK) | ((type & 0x3) << @@ -1185,14 +1208,14 @@ static inline css_error set_border_top_color(css_computed_style *style, uint8_t #undef BORDER_TOP_COLOR_SHIFT #undef BORDER_TOP_COLOR_MASK -#define BORDER_TOP_STYLE_INDEX 6 -#define BORDER_TOP_STYLE_SHIFT 14 -#define BORDER_TOP_STYLE_MASK 0x3c000 +#define BORDER_TOP_STYLE_INDEX 4 +#define BORDER_TOP_STYLE_SHIFT 0 +#define BORDER_TOP_STYLE_MASK 0xf static inline css_error set_border_top_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BORDER_TOP_STYLE_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_TOP_STYLE_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~BORDER_TOP_STYLE_MASK) | ((type & 0xf) << @@ -1211,7 +1234,7 @@ static inline css_error set_border_top_style(css_computed_style *style, uint8_t static inline css_error set_border_top_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[BORDER_TOP_WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[BORDER_TOP_WIDTH_INDEX]; /* 8bits: uuuuuttt : unit | type */ *bits = (*bits & ~BORDER_TOP_WIDTH_MASK) | (((type & 0x7) | (unit << @@ -1225,14 +1248,14 @@ static inline css_error set_border_top_width(css_computed_style *style, uint8_t #undef BORDER_TOP_WIDTH_SHIFT #undef BORDER_TOP_WIDTH_MASK -#define BOTTOM_INDEX 2 -#define BOTTOM_SHIFT 11 -#define BOTTOM_MASK 0x3f800 +#define BOTTOM_INDEX 1 +#define BOTTOM_SHIFT 18 +#define BOTTOM_MASK 0x1fc0000 static inline css_error set_bottom(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[BOTTOM_INDEX]; + uint32_t *bits = &style->i.bits[BOTTOM_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~BOTTOM_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1247,12 +1270,12 @@ static inline css_error set_bottom(css_computed_style *style, uint8_t type, #undef BOTTOM_MASK #define BOX_SIZING_INDEX 8 -#define BOX_SIZING_SHIFT 6 -#define BOX_SIZING_MASK 0xc0 +#define BOX_SIZING_SHIFT 30 +#define BOX_SIZING_MASK 0xc0000000 static inline css_error set_box_sizing(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[BOX_SIZING_INDEX]; + uint32_t *bits = &style->i.bits[BOX_SIZING_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~BOX_SIZING_MASK) | ((type & 0x3) << BOX_SIZING_SHIFT); @@ -1264,13 +1287,13 @@ static inline css_error set_box_sizing(css_computed_style *style, uint8_t type) #undef BOX_SIZING_MASK #define CAPTION_SIDE_INDEX 8 -#define CAPTION_SIDE_SHIFT 24 -#define CAPTION_SIDE_MASK 0x3000000 +#define CAPTION_SIDE_SHIFT 26 +#define CAPTION_SIDE_MASK 0xc000000 static inline css_error set_caption_side(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[CAPTION_SIDE_INDEX]; + uint32_t *bits = &style->i.bits[CAPTION_SIDE_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~CAPTION_SIDE_MASK) | ((type & 0x3) << @@ -1282,13 +1305,13 @@ static inline css_error set_caption_side(css_computed_style *style, uint8_t #undef CAPTION_SIDE_SHIFT #undef CAPTION_SIDE_MASK -#define CLEAR_INDEX 9 -#define CLEAR_SHIFT 23 -#define CLEAR_MASK 0x3800000 +#define CLEAR_INDEX 6 +#define CLEAR_SHIFT 3 +#define CLEAR_MASK 0x38 static inline css_error set_clear(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[CLEAR_INDEX]; + uint32_t *bits = &style->i.bits[CLEAR_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~CLEAR_MASK) | ((type & 0x7) << CLEAR_SHIFT); @@ -1300,13 +1323,13 @@ static inline css_error set_clear(css_computed_style *style, uint8_t type) #undef CLEAR_MASK #define COLOR_INDEX 10 -#define COLOR_SHIFT 25 -#define COLOR_MASK 0x2000000 +#define COLOR_SHIFT 28 +#define COLOR_MASK 0x10000000 static inline css_error set_color(css_computed_style *style, uint8_t type, css_color color) { - uint32_t bits = &style->i.bits[COLOR_INDEX]; + uint32_t *bits = &style->i.bits[COLOR_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~COLOR_MASK) | ((type & 0x1) << COLOR_SHIFT); @@ -1320,12 +1343,12 @@ static inline css_error set_color(css_computed_style *style, uint8_t type, #undef COLOR_MASK #define DIRECTION_INDEX 8 -#define DIRECTION_SHIFT 2 -#define DIRECTION_MASK 0xc +#define DIRECTION_SHIFT 18 +#define DIRECTION_MASK 0xc0000 static inline css_error set_direction(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[DIRECTION_INDEX]; + uint32_t *bits = &style->i.bits[DIRECTION_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~DIRECTION_MASK) | ((type & 0x3) << DIRECTION_SHIFT); @@ -1337,12 +1360,12 @@ static inline css_error set_direction(css_computed_style *style, uint8_t type) #undef DIRECTION_MASK #define DISPLAY_INDEX 6 -#define DISPLAY_SHIFT 22 -#define DISPLAY_MASK 0x7c00000 +#define DISPLAY_SHIFT 27 +#define DISPLAY_MASK 0xf8000000 static inline css_error set_display(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[DISPLAY_INDEX]; + uint32_t *bits = &style->i.bits[DISPLAY_INDEX]; /* 5bits: ttttt : type */ *bits = (*bits & ~DISPLAY_MASK) | ((type & 0x1f) << DISPLAY_SHIFT); @@ -1354,12 +1377,12 @@ static inline css_error set_display(css_computed_style *style, uint8_t type) #undef DISPLAY_MASK #define EMPTY_CELLS_INDEX 8 -#define EMPTY_CELLS_SHIFT 16 -#define EMPTY_CELLS_MASK 0x30000 +#define EMPTY_CELLS_SHIFT 8 +#define EMPTY_CELLS_MASK 0x300 static inline css_error set_empty_cells(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[EMPTY_CELLS_INDEX]; + uint32_t *bits = &style->i.bits[EMPTY_CELLS_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~EMPTY_CELLS_MASK) | ((type & 0x3) << @@ -1372,13 +1395,13 @@ static inline css_error set_empty_cells(css_computed_style *style, uint8_t type) #undef EMPTY_CELLS_MASK #define FLEX_BASIS_INDEX 1 -#define FLEX_BASIS_SHIFT 11 -#define FLEX_BASIS_MASK 0x3f800 +#define FLEX_BASIS_SHIFT 4 +#define FLEX_BASIS_MASK 0x7f0 static inline css_error set_flex_basis(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[FLEX_BASIS_INDEX]; + uint32_t *bits = &style->i.bits[FLEX_BASIS_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~FLEX_BASIS_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1393,13 +1416,13 @@ static inline css_error set_flex_basis(css_computed_style *style, uint8_t type, #undef FLEX_BASIS_MASK #define FLEX_DIRECTION_INDEX 9 -#define FLEX_DIRECTION_SHIFT 20 -#define FLEX_DIRECTION_MASK 0x700000 +#define FLEX_DIRECTION_SHIFT 29 +#define FLEX_DIRECTION_MASK 0xe0000000 static inline css_error set_flex_direction(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[FLEX_DIRECTION_INDEX]; + uint32_t *bits = &style->i.bits[FLEX_DIRECTION_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~FLEX_DIRECTION_MASK) | ((type & 0x7) << @@ -1411,14 +1434,14 @@ static inline css_error set_flex_direction(css_computed_style *style, uint8_t #undef FLEX_DIRECTION_SHIFT #undef FLEX_DIRECTION_MASK -#define FLEX_GROW_INDEX 10 -#define FLEX_GROW_SHIFT 27 -#define FLEX_GROW_MASK 0x8000000 +#define FLEX_GROW_INDEX 9 +#define FLEX_GROW_SHIFT 0 +#define FLEX_GROW_MASK 0x1 static inline css_error set_flex_grow(css_computed_style *style, uint8_t type, css_fixed fixed) { - uint32_t bits = &style->i.bits[FLEX_GROW_INDEX]; + uint32_t *bits = &style->i.bits[FLEX_GROW_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~FLEX_GROW_MASK) | ((type & 0x1) << FLEX_GROW_SHIFT); @@ -1432,13 +1455,13 @@ static inline css_error set_flex_grow(css_computed_style *style, uint8_t type, #undef FLEX_GROW_MASK #define FLEX_SHRINK_INDEX 10 -#define FLEX_SHRINK_SHIFT 26 -#define FLEX_SHRINK_MASK 0x4000000 +#define FLEX_SHRINK_SHIFT 29 +#define FLEX_SHRINK_MASK 0x20000000 static inline css_error set_flex_shrink(css_computed_style *style, uint8_t type, css_fixed fixed) { - uint32_t bits = &style->i.bits[FLEX_SHRINK_INDEX]; + uint32_t *bits = &style->i.bits[FLEX_SHRINK_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~FLEX_SHRINK_MASK) | ((type & 0x1) << @@ -1453,12 +1476,12 @@ static inline css_error set_flex_shrink(css_computed_style *style, uint8_t #undef FLEX_SHRINK_MASK #define FLEX_WRAP_INDEX 8 -#define FLEX_WRAP_SHIFT 22 -#define FLEX_WRAP_MASK 0xc00000 +#define FLEX_WRAP_SHIFT 16 +#define FLEX_WRAP_MASK 0x30000 static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[FLEX_WRAP_INDEX]; + uint32_t *bits = &style->i.bits[FLEX_WRAP_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~FLEX_WRAP_MASK) | ((type & 0x3) << FLEX_WRAP_SHIFT); @@ -1470,12 +1493,12 @@ static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type) #undef FLEX_WRAP_MASK #define FLOAT_INDEX 8 -#define FLOAT_SHIFT 12 -#define FLOAT_MASK 0x3000 +#define FLOAT_SHIFT 20 +#define FLOAT_MASK 0x300000 static inline css_error set_float(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[FLOAT_INDEX]; + uint32_t *bits = &style->i.bits[FLOAT_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~FLOAT_MASK) | ((type & 0x3) << FLOAT_SHIFT); @@ -1487,13 +1510,13 @@ static inline css_error set_float(css_computed_style *style, uint8_t type) #undef FLOAT_MASK #define FONT_FAMILY_INDEX 9 -#define FONT_FAMILY_SHIFT 17 -#define FONT_FAMILY_MASK 0xe0000 +#define FONT_FAMILY_SHIFT 20 +#define FONT_FAMILY_MASK 0x700000 static inline css_error set_font_family(css_computed_style *style, uint8_t type, lwc_string **string_arr) { - uint32_t bits = &style->i.bits[FONT_FAMILY_INDEX]; + uint32_t *bits = &style->i.bits[FONT_FAMILY_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~FONT_FAMILY_MASK) | ((type & 0x7) << @@ -1529,7 +1552,7 @@ static inline css_error set_font_family(css_computed_style *style, uint8_t static inline css_error set_font_size(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[FONT_SIZE_INDEX]; + uint32_t *bits = &style->i.bits[FONT_SIZE_INDEX]; /* 9bits: uuuuutttt : unit | type */ *bits = (*bits & ~FONT_SIZE_MASK) | (((type & 0xf) | (unit << 4)) << @@ -1543,13 +1566,13 @@ static inline css_error set_font_size(css_computed_style *style, uint8_t type, #undef FONT_SIZE_SHIFT #undef FONT_SIZE_MASK -#define FONT_STYLE_INDEX 10 -#define FONT_STYLE_SHIFT 30 -#define FONT_STYLE_MASK 0xc0000000 +#define FONT_STYLE_INDEX 8 +#define FONT_STYLE_SHIFT 2 +#define FONT_STYLE_MASK 0xc static inline css_error set_font_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[FONT_STYLE_INDEX]; + uint32_t *bits = &style->i.bits[FONT_STYLE_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~FONT_STYLE_MASK) | ((type & 0x3) << FONT_STYLE_SHIFT); @@ -1561,13 +1584,13 @@ static inline css_error set_font_style(css_computed_style *style, uint8_t type) #undef FONT_STYLE_MASK #define FONT_VARIANT_INDEX 9 -#define FONT_VARIANT_SHIFT 3 -#define FONT_VARIANT_MASK 0x18 +#define FONT_VARIANT_SHIFT 1 +#define FONT_VARIANT_MASK 0x6 static inline css_error set_font_variant(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[FONT_VARIANT_INDEX]; + uint32_t *bits = &style->i.bits[FONT_VARIANT_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~FONT_VARIANT_MASK) | ((type & 0x3) << @@ -1579,13 +1602,13 @@ static inline css_error set_font_variant(css_computed_style *style, uint8_t #undef FONT_VARIANT_SHIFT #undef FONT_VARIANT_MASK -#define FONT_WEIGHT_INDEX 3 -#define FONT_WEIGHT_SHIFT 0 -#define FONT_WEIGHT_MASK 0xf +#define FONT_WEIGHT_INDEX 6 +#define FONT_WEIGHT_SHIFT 18 +#define FONT_WEIGHT_MASK 0x3c0000 static inline css_error set_font_weight(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[FONT_WEIGHT_INDEX]; + uint32_t *bits = &style->i.bits[FONT_WEIGHT_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~FONT_WEIGHT_MASK) | ((type & 0xf) << @@ -1597,14 +1620,14 @@ static inline css_error set_font_weight(css_computed_style *style, uint8_t type) #undef FONT_WEIGHT_SHIFT #undef FONT_WEIGHT_MASK -#define HEIGHT_INDEX 2 -#define HEIGHT_SHIFT 25 -#define HEIGHT_MASK 0xfe000000 +#define HEIGHT_INDEX 3 +#define HEIGHT_SHIFT 18 +#define HEIGHT_MASK 0x1fc0000 static inline css_error set_height(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[HEIGHT_INDEX]; + uint32_t *bits = &style->i.bits[HEIGHT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1619,13 +1642,13 @@ static inline css_error set_height(css_computed_style *style, uint8_t type, #undef HEIGHT_MASK #define JUSTIFY_CONTENT_INDEX 9 -#define JUSTIFY_CONTENT_SHIFT 8 -#define JUSTIFY_CONTENT_MASK 0x700 +#define JUSTIFY_CONTENT_SHIFT 26 +#define JUSTIFY_CONTENT_MASK 0x1c000000 static inline css_error set_justify_content(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[JUSTIFY_CONTENT_INDEX]; + uint32_t *bits = &style->i.bits[JUSTIFY_CONTENT_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~JUSTIFY_CONTENT_MASK) | ((type & 0x7) << @@ -1637,14 +1660,14 @@ static inline css_error set_justify_content(css_computed_style *style, uint8_t #undef JUSTIFY_CONTENT_SHIFT #undef JUSTIFY_CONTENT_MASK -#define LEFT_INDEX 1 -#define LEFT_SHIFT 18 -#define LEFT_MASK 0x1fc0000 +#define LEFT_INDEX 3 +#define LEFT_SHIFT 25 +#define LEFT_MASK 0xfe000000 static inline css_error set_left(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[LEFT_INDEX]; + uint32_t *bits = &style->i.bits[LEFT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~LEFT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1658,14 +1681,14 @@ static inline css_error set_left(css_computed_style *style, uint8_t type, #undef LEFT_SHIFT #undef LEFT_MASK -#define LINE_HEIGHT_INDEX 4 +#define LINE_HEIGHT_INDEX 2 #define LINE_HEIGHT_SHIFT 4 #define LINE_HEIGHT_MASK 0x7f0 static inline css_error set_line_height(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[LINE_HEIGHT_INDEX]; + uint32_t *bits = &style->i.bits[LINE_HEIGHT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~LINE_HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1680,13 +1703,13 @@ static inline css_error set_line_height(css_computed_style *style, uint8_t #undef LINE_HEIGHT_MASK #define LIST_STYLE_IMAGE_INDEX 10 -#define LIST_STYLE_IMAGE_SHIFT 29 -#define LIST_STYLE_IMAGE_MASK 0x20000000 +#define LIST_STYLE_IMAGE_SHIFT 25 +#define LIST_STYLE_IMAGE_MASK 0x2000000 static inline css_error set_list_style_image(css_computed_style *style, uint8_t type, lwc_string *string) { - uint32_t bits = &style->i.bits[LIST_STYLE_IMAGE_INDEX]; + uint32_t *bits = &style->i.bits[LIST_STYLE_IMAGE_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~LIST_STYLE_IMAGE_MASK) | ((type & 0x1) << @@ -1698,8 +1721,9 @@ static inline css_error set_list_style_image(css_computed_style *style, uint8_t style->i.list_style_image = lwc_string_ref(string); } else { style->i.list_style_image = NULL; + } - if (old_string != NULL + if (old_string != NULL) lwc_string_unref(old_string); return CSS_OK; @@ -1708,14 +1732,14 @@ static inline css_error set_list_style_image(css_computed_style *style, uint8_t #undef LIST_STYLE_IMAGE_SHIFT #undef LIST_STYLE_IMAGE_MASK -#define LIST_STYLE_POSITION_INDEX 8 -#define LIST_STYLE_POSITION_SHIFT 26 -#define LIST_STYLE_POSITION_MASK 0xc000000 +#define LIST_STYLE_POSITION_INDEX 10 +#define LIST_STYLE_POSITION_SHIFT 30 +#define LIST_STYLE_POSITION_MASK 0xc0000000 static inline css_error set_list_style_position(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[LIST_STYLE_POSITION_INDEX]; + uint32_t *bits = &style->i.bits[LIST_STYLE_POSITION_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~LIST_STYLE_POSITION_MASK) | ((type & 0x3) << @@ -1727,14 +1751,14 @@ static inline css_error set_list_style_position(css_computed_style *style, #undef LIST_STYLE_POSITION_SHIFT #undef LIST_STYLE_POSITION_MASK -#define LIST_STYLE_TYPE_INDEX 1 -#define LIST_STYLE_TYPE_SHIFT 0 -#define LIST_STYLE_TYPE_MASK 0xf +#define LIST_STYLE_TYPE_INDEX 6 +#define LIST_STYLE_TYPE_SHIFT 6 +#define LIST_STYLE_TYPE_MASK 0x3c0 static inline css_error set_list_style_type(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[LIST_STYLE_TYPE_INDEX]; + uint32_t *bits = &style->i.bits[LIST_STYLE_TYPE_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | ((type & 0xf) << @@ -1746,14 +1770,14 @@ static inline css_error set_list_style_type(css_computed_style *style, uint8_t #undef LIST_STYLE_TYPE_SHIFT #undef LIST_STYLE_TYPE_MASK -#define MARGIN_BOTTOM_INDEX 1 +#define MARGIN_BOTTOM_INDEX 2 #define MARGIN_BOTTOM_SHIFT 25 #define MARGIN_BOTTOM_MASK 0xfe000000 static inline css_error set_margin_bottom(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MARGIN_BOTTOM_INDEX]; + uint32_t *bits = &style->i.bits[MARGIN_BOTTOM_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MARGIN_BOTTOM_MASK) | (((type & 0x3) | (unit << 2)) @@ -1767,14 +1791,14 @@ static inline css_error set_margin_bottom(css_computed_style *style, uint8_t #undef MARGIN_BOTTOM_SHIFT #undef MARGIN_BOTTOM_MASK -#define MARGIN_LEFT_INDEX 2 -#define MARGIN_LEFT_SHIFT 4 -#define MARGIN_LEFT_MASK 0x7f0 +#define MARGIN_LEFT_INDEX 3 +#define MARGIN_LEFT_SHIFT 11 +#define MARGIN_LEFT_MASK 0x3f800 static inline css_error set_margin_left(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MARGIN_LEFT_INDEX]; + uint32_t *bits = &style->i.bits[MARGIN_LEFT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MARGIN_LEFT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1788,14 +1812,14 @@ static inline css_error set_margin_left(css_computed_style *style, uint8_t #undef MARGIN_LEFT_SHIFT #undef MARGIN_LEFT_MASK -#define MARGIN_RIGHT_INDEX 4 -#define MARGIN_RIGHT_SHIFT 18 -#define MARGIN_RIGHT_MASK 0x1fc0000 +#define MARGIN_RIGHT_INDEX 2 +#define MARGIN_RIGHT_SHIFT 11 +#define MARGIN_RIGHT_MASK 0x3f800 static inline css_error set_margin_right(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MARGIN_RIGHT_INDEX]; + uint32_t *bits = &style->i.bits[MARGIN_RIGHT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MARGIN_RIGHT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1809,14 +1833,14 @@ static inline css_error set_margin_right(css_computed_style *style, uint8_t #undef MARGIN_RIGHT_SHIFT #undef MARGIN_RIGHT_MASK -#define MARGIN_TOP_INDEX 3 -#define MARGIN_TOP_SHIFT 11 -#define MARGIN_TOP_MASK 0x3f800 +#define MARGIN_TOP_INDEX 4 +#define MARGIN_TOP_SHIFT 18 +#define MARGIN_TOP_MASK 0x1fc0000 static inline css_error set_margin_top(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MARGIN_TOP_INDEX]; + uint32_t *bits = &style->i.bits[MARGIN_TOP_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MARGIN_TOP_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1830,14 +1854,14 @@ static inline css_error set_margin_top(css_computed_style *style, uint8_t type, #undef MARGIN_TOP_SHIFT #undef MARGIN_TOP_MASK -#define MAX_HEIGHT_INDEX 3 -#define MAX_HEIGHT_SHIFT 25 -#define MAX_HEIGHT_MASK 0xfe000000 +#define MAX_HEIGHT_INDEX 1 +#define MAX_HEIGHT_SHIFT 11 +#define MAX_HEIGHT_MASK 0x3f800 static inline css_error set_max_height(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MAX_HEIGHT_INDEX]; + uint32_t *bits = &style->i.bits[MAX_HEIGHT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MAX_HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1858,7 +1882,7 @@ static inline css_error set_max_height(css_computed_style *style, uint8_t type, static inline css_error set_max_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MAX_WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[MAX_WIDTH_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MAX_WIDTH_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1872,14 +1896,14 @@ static inline css_error set_max_width(css_computed_style *style, uint8_t type, #undef MAX_WIDTH_SHIFT #undef MAX_WIDTH_MASK -#define MIN_HEIGHT_INDEX 1 +#define MIN_HEIGHT_INDEX 3 #define MIN_HEIGHT_SHIFT 4 #define MIN_HEIGHT_MASK 0x7f0 static inline css_error set_min_height(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MIN_HEIGHT_INDEX]; + uint32_t *bits = &style->i.bits[MIN_HEIGHT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MIN_HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1893,14 +1917,14 @@ static inline css_error set_min_height(css_computed_style *style, uint8_t type, #undef MIN_HEIGHT_SHIFT #undef MIN_HEIGHT_MASK -#define MIN_WIDTH_INDEX 2 -#define MIN_WIDTH_SHIFT 18 -#define MIN_WIDTH_MASK 0x1fc0000 +#define MIN_WIDTH_INDEX 4 +#define MIN_WIDTH_SHIFT 4 +#define MIN_WIDTH_MASK 0x7f0 static inline css_error set_min_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[MIN_WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[MIN_WIDTH_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~MIN_WIDTH_MASK) | (((type & 0x3) | (unit << 2)) << @@ -1921,7 +1945,7 @@ static inline css_error set_min_width(css_computed_style *style, uint8_t type, static inline css_error set_opacity(css_computed_style *style, uint8_t type, css_fixed fixed) { - uint32_t bits = &style->i.bits[OPACITY_INDEX]; + uint32_t *bits = &style->i.bits[OPACITY_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~OPACITY_MASK) | ((type & 0x1) << OPACITY_SHIFT); @@ -1935,13 +1959,13 @@ static inline css_error set_opacity(css_computed_style *style, uint8_t type, #undef OPACITY_MASK #define ORDER_INDEX 10 -#define ORDER_SHIFT 28 -#define ORDER_MASK 0x10000000 +#define ORDER_SHIFT 23 +#define ORDER_MASK 0x800000 static inline css_error set_order(css_computed_style *style, uint8_t type, int32_t integer) { - uint32_t bits = &style->i.bits[ORDER_INDEX]; + uint32_t *bits = &style->i.bits[ORDER_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~ORDER_MASK) | ((type & 0x1) << ORDER_SHIFT); @@ -1954,14 +1978,14 @@ static inline css_error set_order(css_computed_style *style, uint8_t type, #undef ORDER_SHIFT #undef ORDER_MASK -#define OUTLINE_STYLE_INDEX 2 +#define OUTLINE_STYLE_INDEX 1 #define OUTLINE_STYLE_SHIFT 0 #define OUTLINE_STYLE_MASK 0xf static inline css_error set_outline_style(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[OUTLINE_STYLE_INDEX]; + uint32_t *bits = &style->i.bits[OUTLINE_STYLE_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~OUTLINE_STYLE_MASK) | ((type & 0xf) << @@ -1974,12 +1998,12 @@ static inline css_error set_outline_style(css_computed_style *style, uint8_t #undef OUTLINE_STYLE_MASK #define OVERFLOW_INDEX 9 -#define OVERFLOW_SHIFT 26 -#define OVERFLOW_MASK 0x1c000000 +#define OVERFLOW_SHIFT 14 +#define OVERFLOW_MASK 0x1c000 static inline css_error set_overflow(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[OVERFLOW_INDEX]; + uint32_t *bits = &style->i.bits[OVERFLOW_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~OVERFLOW_MASK) | ((type & 0x7) << OVERFLOW_SHIFT); @@ -1991,13 +2015,13 @@ static inline css_error set_overflow(css_computed_style *style, uint8_t type) #undef OVERFLOW_MASK #define PADDING_BOTTOM_INDEX 7 -#define PADDING_BOTTOM_SHIFT 26 -#define PADDING_BOTTOM_MASK 0xfc000000 +#define PADDING_BOTTOM_SHIFT 8 +#define PADDING_BOTTOM_MASK 0x3f00 static inline css_error set_padding_bottom(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[PADDING_BOTTOM_INDEX]; + uint32_t *bits = &style->i.bits[PADDING_BOTTOM_INDEX]; /* 6bits: uuuuut : unit | type */ *bits = (*bits & ~PADDING_BOTTOM_MASK) | (((type & 0x1) | (unit << 1)) @@ -2012,13 +2036,13 @@ static inline css_error set_padding_bottom(css_computed_style *style, uint8_t #undef PADDING_BOTTOM_MASK #define PADDING_LEFT_INDEX 7 -#define PADDING_LEFT_SHIFT 20 -#define PADDING_LEFT_MASK 0x3f00000 +#define PADDING_LEFT_SHIFT 14 +#define PADDING_LEFT_MASK 0xfc000 static inline css_error set_padding_left(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[PADDING_LEFT_INDEX]; + uint32_t *bits = &style->i.bits[PADDING_LEFT_INDEX]; /* 6bits: uuuuut : unit | type */ *bits = (*bits & ~PADDING_LEFT_MASK) | (((type & 0x1) | (unit << 1)) << @@ -2033,13 +2057,13 @@ static inline css_error set_padding_left(css_computed_style *style, uint8_t #undef PADDING_LEFT_MASK #define PADDING_RIGHT_INDEX 7 -#define PADDING_RIGHT_SHIFT 8 -#define PADDING_RIGHT_MASK 0x3f00 +#define PADDING_RIGHT_SHIFT 2 +#define PADDING_RIGHT_MASK 0xfc static inline css_error set_padding_right(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[PADDING_RIGHT_INDEX]; + uint32_t *bits = &style->i.bits[PADDING_RIGHT_INDEX]; /* 6bits: uuuuut : unit | type */ *bits = (*bits & ~PADDING_RIGHT_MASK) | (((type & 0x1) | (unit << 1)) @@ -2054,13 +2078,13 @@ static inline css_error set_padding_right(css_computed_style *style, uint8_t #undef PADDING_RIGHT_MASK #define PADDING_TOP_INDEX 7 -#define PADDING_TOP_SHIFT 2 -#define PADDING_TOP_MASK 0xfc +#define PADDING_TOP_SHIFT 26 +#define PADDING_TOP_MASK 0xfc000000 static inline css_error set_padding_top(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[PADDING_TOP_INDEX]; + uint32_t *bits = &style->i.bits[PADDING_TOP_INDEX]; /* 6bits: uuuuut : unit | type */ *bits = (*bits & ~PADDING_TOP_MASK) | (((type & 0x1) | (unit << 1)) << @@ -2075,12 +2099,12 @@ static inline css_error set_padding_top(css_computed_style *style, uint8_t #undef PADDING_TOP_MASK #define POSITION_INDEX 9 -#define POSITION_SHIFT 5 -#define POSITION_MASK 0xe0 +#define POSITION_SHIFT 11 +#define POSITION_MASK 0x3800 static inline css_error set_position(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[POSITION_INDEX]; + uint32_t *bits = &style->i.bits[POSITION_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~POSITION_MASK) | ((type & 0x7) << POSITION_SHIFT); @@ -2091,14 +2115,14 @@ static inline css_error set_position(css_computed_style *style, uint8_t type) #undef POSITION_SHIFT #undef POSITION_MASK -#define QUOTES_INDEX 9 -#define QUOTES_SHIFT 0 -#define QUOTES_MASK 0x1 +#define QUOTES_INDEX 10 +#define QUOTES_SHIFT 27 +#define QUOTES_MASK 0x8000000 static inline css_error set_quotes(css_computed_style *style, uint8_t type, lwc_string **string_arr) { - uint32_t bits = &style->i.bits[QUOTES_INDEX]; + uint32_t *bits = &style->i.bits[QUOTES_INDEX]; /* 1bit: t : type */ *bits = (*bits & ~QUOTES_MASK) | ((type & 0x1) << QUOTES_SHIFT); @@ -2126,14 +2150,14 @@ static inline css_error set_quotes(css_computed_style *style, uint8_t type, #undef QUOTES_SHIFT #undef QUOTES_MASK -#define RIGHT_INDEX 3 -#define RIGHT_SHIFT 4 -#define RIGHT_MASK 0x7f0 +#define RIGHT_INDEX 4 +#define RIGHT_SHIFT 11 +#define RIGHT_MASK 0x3f800 static inline css_error set_right(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[RIGHT_INDEX]; + uint32_t *bits = &style->i.bits[RIGHT_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~RIGHT_MASK) | (((type & 0x3) | (unit << 2)) << @@ -2148,13 +2172,13 @@ static inline css_error set_right(css_computed_style *style, uint8_t type, #undef RIGHT_MASK #define TABLE_LAYOUT_INDEX 8 -#define TABLE_LAYOUT_SHIFT 8 -#define TABLE_LAYOUT_MASK 0x300 +#define TABLE_LAYOUT_SHIFT 0 +#define TABLE_LAYOUT_MASK 0x3 static inline css_error set_table_layout(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[TABLE_LAYOUT_INDEX]; + uint32_t *bits = &style->i.bits[TABLE_LAYOUT_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~TABLE_LAYOUT_MASK) | ((type & 0x3) << @@ -2167,12 +2191,12 @@ static inline css_error set_table_layout(css_computed_style *style, uint8_t #undef TABLE_LAYOUT_MASK #define TEXT_ALIGN_INDEX 6 -#define TEXT_ALIGN_SHIFT 18 -#define TEXT_ALIGN_MASK 0x3c0000 +#define TEXT_ALIGN_SHIFT 10 +#define TEXT_ALIGN_MASK 0x3c00 static inline css_error set_text_align(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[TEXT_ALIGN_INDEX]; + uint32_t *bits = &style->i.bits[TEXT_ALIGN_INDEX]; /* 4bits: tttt : type */ *bits = (*bits & ~TEXT_ALIGN_MASK) | ((type & 0xf) << TEXT_ALIGN_SHIFT); @@ -2184,13 +2208,13 @@ static inline css_error set_text_align(css_computed_style *style, uint8_t type) #undef TEXT_ALIGN_MASK #define TEXT_DECORATION_INDEX 6 -#define TEXT_DECORATION_SHIFT 27 -#define TEXT_DECORATION_MASK 0xf8000000 +#define TEXT_DECORATION_SHIFT 22 +#define TEXT_DECORATION_MASK 0x7c00000 static inline css_error set_text_decoration(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[TEXT_DECORATION_INDEX]; + uint32_t *bits = &style->i.bits[TEXT_DECORATION_INDEX]; /* 5bits: ttttt : type */ *bits = (*bits & ~TEXT_DECORATION_MASK) | ((type & 0x1f) << @@ -2203,13 +2227,13 @@ static inline css_error set_text_decoration(css_computed_style *style, uint8_t #undef TEXT_DECORATION_MASK #define TEXT_INDENT_INDEX 7 -#define TEXT_INDENT_SHIFT 14 -#define TEXT_INDENT_MASK 0xfc000 +#define TEXT_INDENT_SHIFT 20 +#define TEXT_INDENT_MASK 0x3f00000 static inline css_error set_text_indent(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[TEXT_INDENT_INDEX]; + uint32_t *bits = &style->i.bits[TEXT_INDENT_INDEX]; /* 6bits: uuuuut : unit | type */ *bits = (*bits & ~TEXT_INDENT_MASK) | (((type & 0x1) | (unit << 1)) << @@ -2223,14 +2247,14 @@ static inline css_error set_text_indent(css_computed_style *style, uint8_t #undef TEXT_INDENT_SHIFT #undef TEXT_INDENT_MASK -#define TEXT_TRANSFORM_INDEX 9 -#define TEXT_TRANSFORM_SHIFT 11 -#define TEXT_TRANSFORM_MASK 0x3800 +#define TEXT_TRANSFORM_INDEX 6 +#define TEXT_TRANSFORM_SHIFT 0 +#define TEXT_TRANSFORM_MASK 0x7 static inline css_error set_text_transform(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[TEXT_TRANSFORM_INDEX]; + uint32_t *bits = &style->i.bits[TEXT_TRANSFORM_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~TEXT_TRANSFORM_MASK) | ((type & 0x7) << @@ -2242,14 +2266,14 @@ static inline css_error set_text_transform(css_computed_style *style, uint8_t #undef TEXT_TRANSFORM_SHIFT #undef TEXT_TRANSFORM_MASK -#define TOP_INDEX 4 -#define TOP_SHIFT 11 -#define TOP_MASK 0x3f800 +#define TOP_INDEX 1 +#define TOP_SHIFT 25 +#define TOP_MASK 0xfe000000 static inline css_error set_top(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[TOP_INDEX]; + uint32_t *bits = &style->i.bits[TOP_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~TOP_MASK) | (((type & 0x3) | (unit << 2)) << @@ -2264,13 +2288,13 @@ static inline css_error set_top(css_computed_style *style, uint8_t type, #undef TOP_MASK #define UNICODE_BIDI_INDEX 8 -#define UNICODE_BIDI_SHIFT 18 -#define UNICODE_BIDI_MASK 0xc0000 +#define UNICODE_BIDI_SHIFT 6 +#define UNICODE_BIDI_MASK 0xc0 static inline css_error set_unicode_bidi(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[UNICODE_BIDI_INDEX]; + uint32_t *bits = &style->i.bits[UNICODE_BIDI_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~UNICODE_BIDI_MASK) | ((type & 0x3) << @@ -2289,7 +2313,7 @@ static inline css_error set_unicode_bidi(css_computed_style *style, uint8_t static inline css_error set_vertical_align(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[VERTICAL_ALIGN_INDEX]; + uint32_t *bits = &style->i.bits[VERTICAL_ALIGN_INDEX]; /* 9bits: uuuuutttt : unit | type */ *bits = (*bits & ~VERTICAL_ALIGN_MASK) | (((type & 0xf) | (unit << 4)) @@ -2303,13 +2327,13 @@ static inline css_error set_vertical_align(css_computed_style *style, uint8_t #undef VERTICAL_ALIGN_SHIFT #undef VERTICAL_ALIGN_MASK -#define VISIBILITY_INDEX 8 -#define VISIBILITY_SHIFT 14 -#define VISIBILITY_MASK 0xc000 +#define VISIBILITY_INDEX 9 +#define VISIBILITY_SHIFT 3 +#define VISIBILITY_MASK 0x18 static inline css_error set_visibility(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[VISIBILITY_INDEX]; + uint32_t *bits = &style->i.bits[VISIBILITY_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~VISIBILITY_MASK) | ((type & 0x3) << VISIBILITY_SHIFT); @@ -2320,13 +2344,13 @@ static inline css_error set_visibility(css_computed_style *style, uint8_t type) #undef VISIBILITY_SHIFT #undef VISIBILITY_MASK -#define WHITE_SPACE_INDEX 6 -#define WHITE_SPACE_SHIFT 0 -#define WHITE_SPACE_MASK 0x7 +#define WHITE_SPACE_INDEX 9 +#define WHITE_SPACE_SHIFT 5 +#define WHITE_SPACE_MASK 0xe0 static inline css_error set_white_space(css_computed_style *style, uint8_t type) { - uint32_t bits = &style->i.bits[WHITE_SPACE_INDEX]; + uint32_t *bits = &style->i.bits[WHITE_SPACE_INDEX]; /* 3bits: ttt : type */ *bits = (*bits & ~WHITE_SPACE_MASK) | ((type & 0x7) << @@ -2338,14 +2362,14 @@ static inline css_error set_white_space(css_computed_style *style, uint8_t type) #undef WHITE_SPACE_SHIFT #undef WHITE_SPACE_MASK -#define WIDTH_INDEX 3 +#define WIDTH_INDEX 2 #define WIDTH_SHIFT 18 #define WIDTH_MASK 0x1fc0000 static inline css_error set_width(css_computed_style *style, uint8_t type, css_fixed length, css_unit unit) { - uint32_t bits = &style->i.bits[WIDTH_INDEX]; + uint32_t *bits = &style->i.bits[WIDTH_INDEX]; /* 7bits: uuuuutt : unit | type */ *bits = (*bits & ~WIDTH_MASK) | (((type & 0x3) | (unit << 2)) << @@ -2360,13 +2384,13 @@ static inline css_error set_width(css_computed_style *style, uint8_t type, #undef WIDTH_MASK #define Z_INDEX_INDEX 8 -#define Z_INDEX_SHIFT 28 -#define Z_INDEX_MASK 0x30000000 +#define Z_INDEX_SHIFT 14 +#define Z_INDEX_MASK 0xc000 static inline css_error set_z_index(css_computed_style *style, uint8_t type, int32_t integer) { - uint32_t bits = &style->i.bits[Z_INDEX_INDEX]; + uint32_t *bits = &style->i.bits[Z_INDEX_INDEX]; /* 2bits: tt : type */ *bits = (*bits & ~Z_INDEX_MASK) | ((type & 0x3) << Z_INDEX_SHIFT); diff --git a/src/select/overrides.py b/src/select/overrides.py index e5ffb8f..31f2f7c 100644 --- a/src/select/overrides.py +++ b/src/select/overrides.py @@ -121,7 +121,7 @@ static inline css_error set_content( css_computed_style *style, uint8_t type, css_computed_content_item *content) { - uint8_t *bits; + uint32_t *bits; css_computed_content_item *oldcontent; css_computed_content_item *c; diff --git a/src/select/select_config.py b/src/select/select_config.py index 7478dac..294ffd1 100644 --- a/src/select/select_config.py +++ b/src/select/select_config.py @@ -130,7 +130,8 @@ uncommon = { ('column_fill', 2, None, None, 'CSS_COLUMN_FILL_BALANCE'), ('column_gap', 2, 'length', 'CSS_COLUMN_GAP_SET', 'CSS_COLUMN_GAP_NORMAL'), - ('column_rule_color', 2, 'color', None, 'CSS_COLUMN_RULE_CURRENT_COLOR'), + ('column_rule_color', 2, 'color', None, + 'CSS_COLUMN_RULE_COLOR_CURRENT_COLOR'), ('column_rule_style', 4, None, None, 'CSS_COLUMN_RULE_STYLE_NONE'), ('column_rule_width', 3, 'length', 'CSS_COLUMN_RULE_WIDTH_WIDTH', 'CSS_COLUMN_RULE_WIDTH_MEDIUM'), @@ -145,6 +146,7 @@ uncommon = { 'CSS_OUTLINE_WIDTH_WIDTH', 'CSS_OUTLINE_WIDTH_MEDIUM'), ('word_spacing', 2, 'length', 'CSS_WORD_SPACING_SET', 'CSS_WORD_SPACING_NORMAL'), + ('writing_mode', 2, None, None, 'CSS_WRITING_MODE_HORIZONTAL_TB'), # Uncommon group, arrays ('counter_increment', 1, 'counter_arr', None, 'CSS_COUNTER_INCREMENT_NONE', 'Encode counter_increment as an array of name, value pairs, ' diff --git a/src/select/select_generator.py b/src/select/select_generator.py index 67be251..a953fbb 100644 --- a/src/select/select_generator.py +++ b/src/select/select_generator.py @@ -502,7 +502,7 @@ class CSSGroup: p.name, params)) t.append('{') t.indent(1) - t.append('uint32_t bits = &style{}->{}bits[{}_INDEX];'.format( + t.append('uint32_t *bits = &style{}->{}bits[{}_INDEX];'.format( grp, i_dot, p.name.upper())) t.append() if self.name is not 'style': @@ -541,8 +541,9 @@ class CSSGroup: t.append('style{}->{}{} = NULL;'.format( grp, i_dot, p.name + v.suffix)) t.indent(-1) + t.append('}') t.append() - t.append('if ({} != NULL'.format(old_n)) + t.append('if ({} != NULL)'.format(old_n)) t.indent(1) t.append('lwc_string_unref({});'.format(old_n)) t.indent(-1) @@ -638,8 +639,9 @@ class CSSGroup: t.indent(1) for v in p.values: + this_idot = '' if v.is_ptr and v.name != 'string' else i_dot t.append('*{} = style{}->{}{};'.format( - v.name + v.suffix, grp, i_dot, p.name + v.suffix)) + v.name + v.suffix, grp, this_idot, p.name + v.suffix)) for i, v in enumerate(list(reversed(shift_list))): if i is 0: t.append('*{} = bits >> {};'.format(v[0], v[1])) |