summaryrefslogtreecommitdiff
path: root/src/select/autogenerated_computed.h
diff options
context:
space:
mode:
authorMichael Drake <Michael Drake tlsa@netsurf-browser.org>2019-05-12 16:17:12 +0100
committerMichael Drake <Michael Drake tlsa@netsurf-browser.org>2019-05-12 16:23:27 +0100
commit4989d72549b53f751d2999a771e0bc6737015810 (patch)
tree744c15bc5403563cc11be3ad1af94a2447b523f2 /src/select/autogenerated_computed.h
parentd09f33131b8079f3886e0827cf458e1fc2c7f2d6 (diff)
downloadlibcss-4989d72549b53f751d2999a771e0bc6737015810.tar.gz
libcss-4989d72549b53f751d2999a771e0bc6737015810.tar.bz2
Computed styles: Drop uncommon extension blocks.
They were a space saving feature, but they became largely redundant with computed style sharing. They also made the code complex and buggy in many places. E.g. the cascade, inheritance / composition, and intial values all needed to behave corretly when they, or their parent, had or didn't have an uncommon block. Also, only the uncommon block was really used. Fixes: https://bugs.netsurf-browser.org/mantis/view.php?id=2641
Diffstat (limited to 'src/select/autogenerated_computed.h')
-rw-r--r--src/select/autogenerated_computed.h265
1 files changed, 109 insertions, 156 deletions
diff --git a/src/select/autogenerated_computed.h b/src/select/autogenerated_computed.h
index 0c2dff1..fab3ae2 100644
--- a/src/select/autogenerated_computed.h
+++ b/src/select/autogenerated_computed.h
@@ -6,127 +6,6 @@
*/
-struct css_computed_uncommon_i {
-/*
- * Property Size (bits) Size (bytes)
- * --- --- ---
- * border_spacing 1 + 10 8
- * break_after 4
- * break_before 4
- * break_inside 4
- * clip 6 + 20 16
- * column_count 2 4
- * column_fill 2
- * column_gap 2 + 5 4
- * column_rule_color 2 4
- * column_rule_style 4
- * column_rule_width 3 + 5 4
- * column_span 2
- * column_width 2 + 5 4
- * letter_spacing 2 + 5 4
- * 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.
- *
- * content 2 sizeof(ptr)
- *
- * Encode counter_increment as an array of name, value pairs, terminated with a
- * blank entry.
- *
- * counter_increment 1 sizeof(ptr)
- *
- * Encode counter_reset as an array of name, value pairs, terminated with a
- * blank entry.
- *
- * counter_reset 1 sizeof(ptr)
- *
- * Encode cursor uri(s) as an array of string objects, terminated with a blank
- * entry
- *
- * cursor 5 sizeof(ptr)
- *
- * --- --- ---
- * 118 bits 60 + 4sizeof(ptr) bytes
- * ===================
- * 75 + 4sizeof(ptr) bytes
- *
- * Bit allocations:
- *
- * 0 bbbbbbbbbbbooooooooccccccccuuuuu
- * border_spacing; outline_width; column_rule_width; cursor
- *
- * 1 cccccccooooooolllllllwwwwwwwbbbb
- * column_width; column_gap; letter_spacing; word_spacing; break_before
- *
- * 2 ccccccccccccccccccccccccccooooll
- * clip; column_rule_style; column_rule_color
- *
- * 3 bbbbrrrrccwwoolluuttne..........
- * break_after; break_inside; content; writing_mode; column_fill; column_span;
- * column_count; outline_color; counter_increment; counter_reset
- */
- uint32_t bits[4];
-
- css_fixed border_spacing_a;
- css_fixed border_spacing_b;
- css_fixed clip_a;
- css_fixed clip_b;
- css_fixed clip_c;
- css_fixed clip_d;
- int32_t column_count;
- css_fixed column_gap;
- css_color column_rule_color;
- css_fixed column_rule_width;
- css_fixed column_width;
- css_fixed letter_spacing;
- css_color outline_color;
- css_fixed outline_width;
- css_fixed word_spacing;
-};
-
-typedef struct css_computed_uncommon {
- struct css_computed_uncommon_i i;
-
- css_computed_content_item *content;
- css_computed_counter *counter_increment;
- css_computed_counter *counter_reset;
- lwc_string **cursor;
-
- struct css_computed_uncommon *next;
- uint32_t count;
- uint32_t bin;
-} css_computed_uncommon;
-
-typedef struct css_computed_page {
-/*
- * Property Size (bits) Size (bytes)
- * --- --- ---
- * orphans 1 4
- * page_break_after 3
- * page_break_before 3
- * page_break_inside 2
- * widows 1 4
- *
- *
- * --- --- ---
- * 10 bits 8 bytes
- * ===================
- * 10 bytes
- *
- * Bit allocations:
- *
- * 0 pppaaaggwo......................
- * page_break_before; page_break_after; page_break_inside; widows; orphans
- */
- uint32_t bits[1];
-
- int32_t orphans;
- int32_t widows;
-} css_computed_page;
-
struct css_computed_style_i {
/*
* Property Size (bits) Size (bytes)
@@ -149,14 +28,27 @@ struct css_computed_style_i {
* border_right_color 2 4
* border_right_style 4
* border_right_width 3 + 5 4
+ * border_spacing 1 + 10 8
* border_top_color 2 4
* border_top_style 4
* border_top_width 3 + 5 4
* bottom 2 + 5 4
* box_sizing 2
+ * break_after 4
+ * break_before 4
+ * break_inside 4
* caption_side 2
* clear 3
+ * clip 6 + 20 16
* color 1 4
+ * column_count 2 4
+ * column_fill 2
+ * column_gap 2 + 5 4
+ * column_rule_color 2 4
+ * column_rule_style 4
+ * column_rule_width 3 + 5 4
+ * column_span 2
+ * column_width 2 + 5 4
* direction 2
* display 5
* empty_cells 2
@@ -173,6 +65,7 @@ struct css_computed_style_i {
* height 2 + 5 4
* justify_content 3
* left 2 + 5 4
+ * letter_spacing 2 + 5 4
* line_height 2 + 5 4
* list_style_image 1 sizeof(ptr)
* list_style_position 2
@@ -187,13 +80,19 @@ struct css_computed_style_i {
* min_width 2 + 5 4
* opacity 1 4
* order 1 4
+ * orphans 1 4
+ * outline_color 2 4
* outline_style 4
+ * outline_width 3 + 5 4
* overflow_x 3
* overflow_y 3
* padding_bottom 1 + 5 4
* padding_left 1 + 5 4
* padding_right 1 + 5 4
* padding_top 1 + 5 4
+ * page_break_after 3
+ * page_break_before 3
+ * page_break_inside 2
* position 3
* right 2 + 5 4
* table_layout 2
@@ -206,9 +105,31 @@ struct css_computed_style_i {
* vertical_align 4 + 5 4
* visibility 2
* white_space 3
+ * widows 1 4
* width 2 + 5 4
+ * word_spacing 2 + 5 4
+ * writing_mode 2
* z_index 2 4
*
+ * Encode content as an array of content items, terminated with a blank entry.
+ *
+ * content 2 sizeof(ptr)
+ *
+ * Encode counter_increment as an array of name, value pairs, terminated with a
+ * blank entry.
+ *
+ * counter_increment 1 sizeof(ptr)
+ *
+ * Encode counter_reset as an array of name, value pairs, terminated with a
+ * blank entry.
+ *
+ * counter_reset 1 sizeof(ptr)
+ *
+ * Encode cursor uri(s) as an array of string objects, terminated with a blank
+ * entry
+ *
+ * cursor 5 sizeof(ptr)
+ *
* Encode font family as an array of string objects, terminated with a blank
* entry.
*
@@ -219,54 +140,67 @@ struct css_computed_style_i {
* quotes 1 sizeof(ptr)
*
* --- --- ---
- * 332 bits 160 + 4sizeof(ptr) bytes
+ * 460 bits 228 + 8sizeof(ptr) bytes
* ===================
- * 202 + 4sizeof(ptr) bytes
+ * 286 + 8sizeof(ptr) bytes
*
* Bit allocations:
*
- * 0 bbbbbbbboooooooorrrrrrrrdddddddd
- * border_top_width; border_bottom_width; border_right_width; border_left_width
+ * 0 bbbbbbbboooooooorrrrrrrruuuuuuuu
+ * border_top_width; border_left_width; border_bottom_width; outline_width
*
- * 1 lllllllrrrrrrrmmmmmmmaaaaaaaoooo
- * line_height; right; min_width; margin_left; outline_style
+ * 1 fffffffffbbbbbbbbccccccccttttttt
+ * font_size; border_right_width; column_rule_width; top
*
- * 2 mmmmmmmaaaaaaafffffffxxxxxxxtttt
- * max_width; margin_right; flex_basis; max_height; text_align
+ * 2 ccccccccccccccccccccccccccpppppp
+ * clip; padding_right
*
- * 3 tttttttmmmmmmmiiiiiiiaaaaaaaffff
- * top; margin_top; min_height; margin_bottom; font_weight
+ * 3 mmmmmmmfffffffwwwwwwwttttttccccc
+ * min_height; flex_basis; word_spacing; text_indent; cursor
*
- * 4 lllllllwwwwwwwbbbbbbbhhhhhhhoooo
- * left; width; bottom; height; border_left_style
+ * 4 lllllllhhhhhhhwwwwwwwmmmmmmmbbbb
+ * line_height; height; width; margin_bottom; break_inside
*
- * 5 bbbbbbbbbbbvvvvvvvvvfffffffffppp
- * background_position; vertical_align; font_size; position
+ * 5 cccccccmmmmmmmaaaaaaalllllllbbbb
+ * column_gap; margin_top; max_height; left; border_top_style
*
- * 6 dddddtttttllllbbbboooorrrreeewww
- * display; text_decoration; list_style_type; border_right_style;
- * border_top_style; border_bottom_style; text_transform; white_space
+ * 6 mmmmmmmcccccccbbbbbbbaaaaaaarrrr
+ * max_width; column_width; bottom; margin_left; break_after
*
- * 7 ppppppaaaaaaddddddiiiiiittttttff
- * padding_left; padding_bottom; padding_top; padding_right; text_indent;
- * font_style
+ * 7 mmmmmmmrrrrrrrlllllllaaaaaaabbbb
+ * min_width; right; letter_spacing; margin_right; border_right_style
*
- * 8 ooofffaaalllbbbiiieeejjjvvvcccrr
- * overflow_y; font_family; align_items; align_self; background_repeat;
- * align_content; flex_direction; justify_content; overflow_x; clear;
- * border_top_color
+ * 8 ppppppaaaaaaddddddiiiiitttttllll
+ * padding_bottom; padding_top; padding_left; display; text_decoration;
+ * list_style_type
*
- * 9 bbffoorrddcceeuuaaxxnnllkkttiiyy
- * border_right_color; flex_wrap; border_collapse; border_left_color;
- * direction; caption_side; empty_cells; unicode_bidi; background_color;
- * box_sizing; font_variant; float; background_attachment; border_bottom_color;
- * list_style_position; table_layout
+ * 9 fffpppwwwcccaaajjjlllgggiiieeebb
+ * font_family; position; white_space; clear; align_items; justify_content;
+ * flex_direction; page_break_after; align_self; page_break_before; box_sizing
*
- * 10 zzvvolbcfpeq....................
- * z_index; visibility; order; list_style_image; background_image; color;
- * flex_shrink; opacity; flex_grow; quotes
+ * 10 ooobbbtttvvviirrddffaaeewwzzccpp
+ * overflow_x; background_repeat; text_transform; overflow_y; visibility;
+ * border_right_color; border_collapse; float; background_attachment;
+ * border_bottom_color; writing_mode; z_index; column_count; border_top_color
+ *
+ * 11 cceeddooffuuttllaabbiinnUUvvkkpp
+ * column_rule_color; empty_cells; direction; column_span; font_style;
+ * outline_color; table_layout; column_fill; caption_side; border_left_color;
+ * list_style_position; content; unicode_bidi; font_variant; background_color;
+ * page_break_inside
+ *
+ * 12 bbbbbbbbbbbooooooooooovvvvvvvvvr
+ * background_position; border_spacing; vertical_align; order
+ *
+ * 13 ffffoooobbbbccccrrrrddddttttaaaq
+ * font_weight; outline_style; border_left_style; column_rule_style;
+ * break_before; border_bottom_style; text_align; align_content; quotes
+ *
+ * 14 fflbceworuip....................
+ * flex_wrap; flex_grow; background_image; counter_reset; flex_shrink; widows;
+ * opacity; color; counter_increment; list_style_image; orphans
*/
- uint32_t bits[11];
+ uint32_t bits[15];
css_color background_color;
lwc_string *background_image;
@@ -278,16 +212,28 @@ struct css_computed_style_i {
css_fixed border_left_width;
css_color border_right_color;
css_fixed border_right_width;
+ css_fixed border_spacing_a;
+ css_fixed border_spacing_b;
css_color border_top_color;
css_fixed border_top_width;
css_fixed bottom;
+ css_fixed clip_a;
+ css_fixed clip_b;
+ css_fixed clip_c;
+ css_fixed clip_d;
css_color color;
+ int32_t column_count;
+ css_fixed column_gap;
+ css_color column_rule_color;
+ css_fixed column_rule_width;
+ css_fixed column_width;
css_fixed flex_basis;
css_fixed flex_grow;
css_fixed flex_shrink;
css_fixed font_size;
css_fixed height;
css_fixed left;
+ css_fixed letter_spacing;
css_fixed line_height;
lwc_string *list_style_image;
css_fixed margin_bottom;
@@ -300,6 +246,9 @@ struct css_computed_style_i {
css_fixed min_width;
css_fixed opacity;
int32_t order;
+ int32_t orphans;
+ css_color outline_color;
+ css_fixed outline_width;
css_fixed padding_bottom;
css_fixed padding_left;
css_fixed padding_right;
@@ -308,20 +257,24 @@ struct css_computed_style_i {
css_fixed text_indent;
css_fixed top;
css_fixed vertical_align;
+ int32_t widows;
css_fixed width;
+ css_fixed word_spacing;
int32_t z_index;
- css_computed_uncommon *uncommon;
void *aural;
};
struct css_computed_style {
struct css_computed_style_i i;
+ css_computed_content_item *content;
+ css_computed_counter *counter_increment;
+ css_computed_counter *counter_reset;
+ lwc_string **cursor;
lwc_string **font_family;
lwc_string **quotes;
- css_computed_page *page;
struct css_computed_style *next;
uint32_t count;
uint32_t bin;