summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--README14
-rw-r--r--docs/Bytecode120
-rw-r--r--include/libcss/computed.h35
-rw-r--r--include/libcss/properties.h96
-rw-r--r--include/libcss/types.h53
-rw-r--r--src/bytecode/bytecode.h13
-rw-r--r--src/bytecode/opcodes.h78
-rw-r--r--src/parse/important.c20
-rw-r--r--src/parse/parse.c4
-rw-r--r--src/parse/properties/Makefile2
-rw-r--r--src/parse/properties/flex.c213
-rw-r--r--src/parse/properties/flex_flow.c137
-rw-r--r--src/parse/properties/properties.c13
-rw-r--r--src/parse/properties/properties.gen26
-rw-r--r--src/parse/properties/properties.h37
-rw-r--r--src/parse/properties/utils.c26
-rw-r--r--src/parse/propstrings.c26
-rw-r--r--src/parse/propstrings.h48
-rw-r--r--src/select/.gitignore3
-rw-r--r--src/select/Makefile3
-rw-r--r--src/select/arena_hash.h4
-rw-r--r--src/select/assets.py30
-rw-r--r--src/select/autogenerated_computed.h328
-rw-r--r--src/select/autogenerated_propget.h2288
-rw-r--r--src/select/autogenerated_propset.h2631
-rw-r--r--src/select/computed.c91
-rw-r--r--src/select/computed.h317
-rw-r--r--src/select/dispatch.c50
-rw-r--r--src/select/overrides.py226
-rw-r--r--src/select/properties/Makefile10
-rw-r--r--src/select/properties/align_content.c81
-rw-r--r--src/select/properties/align_items.c75
-rw-r--r--src/select/properties/align_self.c78
-rw-r--r--src/select/properties/display.c6
-rw-r--r--src/select/properties/flex_basis.c79
-rw-r--r--src/select/properties/flex_direction.c72
-rw-r--r--src/select/properties/flex_grow.c62
-rw-r--r--src/select/properties/flex_shrink.c62
-rw-r--r--src/select/properties/flex_wrap.c69
-rw-r--r--src/select/properties/helpers.c13
-rw-r--r--src/select/properties/justify_content.c79
-rw-r--r--src/select/properties/min_height.c4
-rw-r--r--src/select/properties/min_width.c5
-rw-r--r--src/select/properties/order.c62
-rw-r--r--src/select/properties/properties.h10
-rw-r--r--src/select/propget.h2179
-rw-r--r--src/select/propset.h2313
-rw-r--r--src/select/select_config.py176
-rw-r--r--src/select/select_generator.py831
-rw-r--r--test/data/parse2/INDEX2
-rw-r--r--test/data/parse2/flexbox.dat1713
-rw-r--r--test/data/parse2/tests1.dat8
-rw-r--r--test/data/parse2/units.dat182
-rw-r--r--test/data/select/tests1.dat8500
-rw-r--r--test/dump.h273
-rw-r--r--test/dump_computed.h418
-rw-r--r--test/select.c2
58 files changed, 19349 insertions, 4949 deletions
diff --git a/Makefile b/Makefile
index cb35966..a4f0844 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
# Component settings
COMPONENT := css
-COMPONENT_VERSION := 0.6.1
+COMPONENT_VERSION := 0.7.0
# Default to a static library
COMPONENT_TYPE ?= lib-static
diff --git a/README b/README
index ea20b12..0f45b87 100644
--- a/README
+++ b/README
@@ -16,6 +16,7 @@ Requirements
+ GNU make or compatible
+ Pkg-config
+ Perl (for the testcases)
+ + Python3 (minimum 3.6, for generated selection code)
LibCSS also requires the following libraries to be installed:
@@ -27,7 +28,16 @@ Compilation
If necessary, modify the toolchain settings in the Makefile.
Invoke make:
- $ make
+
+ $ make
+
+Regenerating generated selection source code
+--------------------------------------------
+
+ To regenerate the selection sources (computed style data accesses),
+ note this requires python3:
+
+ $ make select_generator
Verification
------------
@@ -35,7 +45,7 @@ Verification
To verify that the parser is working, it is necessary to specify a
different makefile target than that used for normal compilation, thus:
- $ make test
+ $ make test
API documentation
-----------------
diff --git a/docs/Bytecode b/docs/Bytecode
index 852a918..f64656a 100644
--- a/docs/Bytecode
+++ b/docs/Bytecode
@@ -44,6 +44,19 @@ Length is a 32bit numeric value (as described above) and unit is as follows:
00000101 => mm
00000110 => pt
00000111 => pc
+ 00001000 => cap
+ 00001001 => ch
+ 00001010 => ic
+ 00001011 => rem
+ 00001100 => lh
+ 00001101 => rlh
+ 00001110 => vh
+ 00001111 => vw
+ 00010000 => vi
+ 00010001 => vb
+ 00010010 => vmin
+ 00010011 => vmax
+ 00010100 => q
bit 8 set => percentage unit
bits 9-31: MBZ
@@ -464,6 +477,8 @@ Opcodes
d => table-cell,
e => table-caption,
f => none,
+ 10 => flex,
+ 11 => inline-flex,
other => Reserved for future expansion.
21 - elevation
@@ -678,8 +693,9 @@ Opcodes
bits 0-7 :
bit 7: set => length or percentage follows
bits 0-6: MBZ
- clear => Reserved for future expansion
- bits 0-6: MBZ
+ bit 7 clear => keywords:
+ bits 0-6: 0000000 => auto,
+ other => rffe.
37 - min-width
<value> (14bits) :
@@ -687,8 +703,9 @@ Opcodes
bits 0-7 :
bit 7: set => length or percentage follows
bits 0-6: MBZ
- clear => Reserved for future expansion
- bits 0-6: MBZ
+ bit 7 clear => keywords:
+ bits 0-6: 0000000 => auto,
+ other => rffe.
38 - orphans
<value> (14bits) :
@@ -1255,5 +1272,98 @@ Opcodes
1 => border-box,
other => Reserved for future expansion.
-72-3ff - Reserved for future expansion.
+72 - align-content
+ <value> (14bits) :
+ 0 => stretch,
+ 1 => flex-start,
+ 2 => flex-end,
+ 3 => center,
+ 4 => space-between,
+ 5 => space-around,
+ 6 => space-evenly
+ other => Reserved for future expansion.
+
+73 - align-items
+ <value> (14bits) :
+ 0 => stretch,
+ 1 => flex-start,
+ 2 => flex-end,
+ 3 => center,
+ 4 => baseline,
+ other => Reserved for future expansion.
+
+74 - align-self
+ <value> (14bits) :
+ 0 => stretch,
+ 1 => flex-start,
+ 2 => flex-end,
+ 3 => center,
+ 4 => baseline,
+ 5 => auto,
+ other => Reserved for future expansion.
+
+75 - flex-basis
+ <value> (14bits) :
+ bits 8-13: MBZ
+ bits 0-7 :
+ bit 7 set => length or percentage follows
+ bits 0-6: MBZ
+ bit 7 clear => keywords:
+ bits 0-6:
+ 0000000 => auto,
+ 0000001 => content,
+ other => rffe.
+
+76 - flex-direction
+ <value> (14bits) :
+ 0 => row,
+ 1 => row-reverse,
+ 2 => column,
+ 3 => column-reverse,
+ other => Reserved for future expansion.
+
+77 - flex-grow
+ <value> (14bits) :
+ bits 8-13: MBZ
+ bits 0-7 :
+ bit 7 set => number follows
+ bits 0-6: MBZ
+ bit 7 clear => Reserved for future expansion
+ bits 0-6: MBZ
+
+78 - flex-shrink
+ <value> (14bits) :
+ bits 8-13: MBZ
+ bits 0-7 :
+ bit 7 set => number follows
+ bits 0-6: MBZ
+ bit 7 clear => Reserved for future expansion
+ bits 0-6: MBZ
+
+79 - flex-wrap
+ <value> (14bits) :
+ 0 => nowrap,
+ 1 => wrap,
+ 2 => wrap-reverse,
+ other => Reserved for future expansion.
+
+7a - justify-content
+ <value> (14bits) :
+ 0 => flex-start,
+ 1 => flex-end,
+ 2 => center,
+ 3 => space-between,
+ 4 => space-around,
+ 5 => space-evenly,
+ other => Reserved for future expansion.
+
+7b - order
+ <value> (14bits) :
+ bits 8-13: MBZ
+ bits 0-7 :
+ bit 7 set => integer follows
+ bits 0-6: MBZ
+ bit 7 clear => Reserved for future expansion
+ bits 0-6: MBZ
+7c-3ff - Reserved for future expansion.
diff --git a/include/libcss/computed.h b/include/libcss/computed.h
index e15d0b0..af40abf 100644
--- a/include/libcss/computed.h
+++ b/include/libcss/computed.h
@@ -439,6 +439,41 @@ uint8_t css_computed_widows(
const css_computed_style *style,
int32_t *widows);
+uint8_t css_computed_align_content(
+ const css_computed_style *style);
+
+uint8_t css_computed_align_items(
+ const css_computed_style *style);
+
+uint8_t css_computed_align_self(
+ const css_computed_style *style);
+
+uint8_t css_computed_flex_basis(
+ const css_computed_style *style,
+ css_fixed *length,
+ css_unit *unit);
+
+uint8_t css_computed_flex_direction(
+ const css_computed_style *style);
+
+uint8_t css_computed_flex_grow(
+ const css_computed_style *style,
+ css_fixed *number);
+
+uint8_t css_computed_flex_shrink(
+ const css_computed_style *style,
+ css_fixed *number);
+
+uint8_t css_computed_flex_wrap(
+ const css_computed_style *style);
+
+uint8_t css_computed_justify_content(
+ const css_computed_style *style);
+
+uint8_t css_computed_order(
+ const css_computed_style *style,
+ int32_t *order);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libcss/properties.h b/include/libcss/properties.h
index 06c033f..577bed0 100644
--- a/include/libcss/properties.h
+++ b/include/libcss/properties.h
@@ -128,10 +128,49 @@ enum css_properties_e {
CSS_PROP_WRITING_MODE = 0x06f,
CSS_PROP_OVERFLOW_Y = 0x070,
CSS_PROP_BOX_SIZING = 0x071,
+ CSS_PROP_ALIGN_CONTENT = 0x072,
+ CSS_PROP_ALIGN_ITEMS = 0x073,
+ CSS_PROP_ALIGN_SELF = 0x074,
+ CSS_PROP_FLEX_BASIS = 0x075,
+ CSS_PROP_FLEX_DIRECTION = 0x076,
+ CSS_PROP_FLEX_GROW = 0x077,
+ CSS_PROP_FLEX_SHRINK = 0x078,
+ CSS_PROP_FLEX_WRAP = 0x079,
+ CSS_PROP_JUSTIFY_CONTENT = 0x07a,
+ CSS_PROP_ORDER = 0x07b,
CSS_N_PROPERTIES
};
+enum css_align_content_e {
+ CSS_ALIGN_CONTENT_INHERIT = 0x0,
+ CSS_ALIGN_CONTENT_STRETCH = 0x1,
+ CSS_ALIGN_CONTENT_FLEX_START = 0x2,
+ CSS_ALIGN_CONTENT_FLEX_END = 0x3,
+ CSS_ALIGN_CONTENT_CENTER = 0x4,
+ CSS_ALIGN_CONTENT_SPACE_BETWEEN = 0x5,
+ CSS_ALIGN_CONTENT_SPACE_AROUND = 0x6,
+ CSS_ALIGN_CONTENT_SPACE_EVENLY = 0x7
+};
+
+enum css_align_items_e {
+ CSS_ALIGN_ITEMS_INHERIT = 0x0,
+ CSS_ALIGN_ITEMS_STRETCH = 0x1,
+ CSS_ALIGN_ITEMS_FLEX_START = 0x2,
+ CSS_ALIGN_ITEMS_FLEX_END = 0x3,
+ CSS_ALIGN_ITEMS_CENTER = 0x4,
+ CSS_ALIGN_ITEMS_BASELINE = 0x5
+};
+
+enum css_align_self_e {
+ CSS_ALIGN_SELF_INHERIT = 0x0,
+ CSS_ALIGN_SELF_STRETCH = 0x1,
+ CSS_ALIGN_SELF_FLEX_START = 0x2,
+ CSS_ALIGN_SELF_FLEX_END = 0x3,
+ CSS_ALIGN_SELF_CENTER = 0x4,
+ CSS_ALIGN_SELF_BASELINE = 0x5,
+ CSS_ALIGN_SELF_AUTO = 0x6
+};
enum css_background_attachment_e {
CSS_BACKGROUND_ATTACHMENT_INHERIT = 0x0,
@@ -399,7 +438,9 @@ enum css_display_e {
CSS_DISPLAY_TABLE_COLUMN = 0x0d,
CSS_DISPLAY_TABLE_CELL = 0x0e,
CSS_DISPLAY_TABLE_CAPTION = 0x0f,
- CSS_DISPLAY_NONE = 0x10
+ CSS_DISPLAY_NONE = 0x10,
+ CSS_DISPLAY_FLEX = 0x11,
+ CSS_DISPLAY_INLINE_FLEX = 0x12
};
enum css_empty_cells_e {
@@ -408,6 +449,38 @@ enum css_empty_cells_e {
CSS_EMPTY_CELLS_HIDE = 0x2
};
+enum css_flex_basis_e {
+ CSS_FLEX_BASIS_INHERIT = 0x0,
+ CSS_FLEX_BASIS_SET = 0x1,
+ CSS_FLEX_BASIS_AUTO = 0x2,
+ CSS_FLEX_BASIS_CONTENT = 0x3
+};
+
+enum css_flex_direction_e {
+ CSS_FLEX_DIRECTION_INHERIT = 0x0,
+ CSS_FLEX_DIRECTION_ROW = 0x1,
+ CSS_FLEX_DIRECTION_ROW_REVERSE = 0x2,
+ CSS_FLEX_DIRECTION_COLUMN = 0x3,
+ CSS_FLEX_DIRECTION_COLUMN_REVERSE = 0x4
+};
+
+enum css_flex_grow_e {
+ CSS_FLEX_GROW_INHERIT = 0x0,
+ CSS_FLEX_GROW_SET = 0x1
+};
+
+enum css_flex_shrink_e {
+ CSS_FLEX_SHRINK_INHERIT = 0x0,
+ CSS_FLEX_SHRINK_SET = 0x1
+};
+
+enum css_flex_wrap_e {
+ CSS_FLEX_WRAP_INHERIT = 0x0,
+ CSS_FLEX_WRAP_NOWRAP = 0x1,
+ CSS_FLEX_WRAP_WRAP = 0x2,
+ CSS_FLEX_WRAP_WRAP_REVERSE = 0x3
+};
+
enum css_float_e {
CSS_FLOAT_INHERIT = 0x0,
CSS_FLOAT_LEFT = 0x1,
@@ -475,6 +548,16 @@ enum css_height_e {
CSS_HEIGHT_AUTO = 0x2
};
+enum css_justify_content_e {
+ CSS_JUSTIFY_CONTENT_INHERIT = 0x0,
+ CSS_JUSTIFY_CONTENT_FLEX_START = 0x1,
+ CSS_JUSTIFY_CONTENT_FLEX_END = 0x2,
+ CSS_JUSTIFY_CONTENT_CENTER = 0x3,
+ CSS_JUSTIFY_CONTENT_SPACE_BETWEEN = 0x4,
+ CSS_JUSTIFY_CONTENT_SPACE_AROUND = 0x5,
+ CSS_JUSTIFY_CONTENT_SPACE_EVENLY = 0x6
+};
+
enum css_left_e {
CSS_LEFT_INHERIT = 0x0,
CSS_LEFT_SET = 0x1,
@@ -546,12 +629,14 @@ enum css_max_width_e {
enum css_min_height_e {
CSS_MIN_HEIGHT_INHERIT = 0x0,
- CSS_MIN_HEIGHT_SET = 0x1
+ CSS_MIN_HEIGHT_SET = 0x1,
+ CSS_MIN_HEIGHT_AUTO = 0x2
};
enum css_min_width_e {
CSS_MIN_WIDTH_INHERIT = 0x0,
- CSS_MIN_WIDTH_SET = 0x1
+ CSS_MIN_WIDTH_SET = 0x1,
+ CSS_MIN_WIDTH_AUTO = 0x2
};
enum css_opacity_e {
@@ -559,6 +644,11 @@ enum css_opacity_e {
CSS_OPACITY_SET = 0x1
};
+enum css_order_e {
+ CSS_ORDER_INHERIT = 0x0,
+ CSS_ORDER_SET = 0x1
+};
+
enum css_outline_color_e {
CSS_OUTLINE_COLOR_INHERIT = CSS_BACKGROUND_COLOR_INHERIT,
CSS_OUTLINE_COLOR_COLOR = CSS_BACKGROUND_COLOR_COLOR,
diff --git a/include/libcss/types.h b/include/libcss/types.h
index ffaf13c..4f35737 100644
--- a/include/libcss/types.h
+++ b/include/libcss/types.h
@@ -80,26 +80,39 @@ typedef uint32_t css_color;
/* CSS unit */
typedef enum css_unit {
- CSS_UNIT_PX = 0x0,
- CSS_UNIT_EX = 0x1,
- CSS_UNIT_EM = 0x2,
- CSS_UNIT_IN = 0x3,
- CSS_UNIT_CM = 0x4,
- CSS_UNIT_MM = 0x5,
- CSS_UNIT_PT = 0x6,
- CSS_UNIT_PC = 0x7,
-
- CSS_UNIT_PCT = 0x8, /* Percentage */
-
- CSS_UNIT_DEG = 0x9,
- CSS_UNIT_GRAD = 0xa,
- CSS_UNIT_RAD = 0xb,
-
- CSS_UNIT_MS = 0xc,
- CSS_UNIT_S = 0xd,
-
- CSS_UNIT_HZ = 0xe,
- CSS_UNIT_KHZ = 0xf
+ CSS_UNIT_PX = 0x00,
+ CSS_UNIT_EX = 0x01,
+ CSS_UNIT_EM = 0x02,
+ CSS_UNIT_IN = 0x03,
+ CSS_UNIT_CM = 0x04,
+ CSS_UNIT_MM = 0x05,
+ CSS_UNIT_PT = 0x06,
+ CSS_UNIT_PC = 0x07,
+ CSS_UNIT_CAP = 0x08,
+ CSS_UNIT_CH = 0x09,
+ CSS_UNIT_IC = 0x0a,
+ CSS_UNIT_REM = 0x0b,
+ CSS_UNIT_LH = 0x0c,
+ CSS_UNIT_RLH = 0x0d,
+ CSS_UNIT_VH = 0x0e,
+ CSS_UNIT_VW = 0x0f,
+ CSS_UNIT_VI = 0x10,
+ CSS_UNIT_VB = 0x11,
+ CSS_UNIT_VMIN = 0x12,
+ CSS_UNIT_VMAX = 0x13,
+ CSS_UNIT_Q = 0x14,
+
+ CSS_UNIT_PCT = 0x15, /* Percentage */
+
+ CSS_UNIT_DEG = 0x16,
+ CSS_UNIT_GRAD = 0x17,
+ CSS_UNIT_RAD = 0x18,
+
+ CSS_UNIT_MS = 0x19,
+ CSS_UNIT_S = 0x1a,
+
+ CSS_UNIT_HZ = 0x1b,
+ CSS_UNIT_KHZ = 0x1c
} css_unit;
/**
diff --git a/src/bytecode/bytecode.h b/src/bytecode/bytecode.h
index 656d7a5..422f141 100644
--- a/src/bytecode/bytecode.h
+++ b/src/bytecode/bytecode.h
@@ -32,6 +32,19 @@ typedef enum unit {
UNIT_MM = 5,
UNIT_PT = 6,
UNIT_PC = 7,
+ UNIT_CAP = 8,
+ UNIT_CH = 9,
+ UNIT_IC = 10,
+ UNIT_REM = 11,
+ UNIT_LH = 12,
+ UNIT_RLH = 13,
+ UNIT_VH = 14,
+ UNIT_VW = 15,
+ UNIT_VI = 16,
+ UNIT_VB = 17,
+ UNIT_VMIN = 18,
+ UNIT_VMAX = 19,
+ UNIT_Q = 20,
UNIT_PCT = (1 << 8),
diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h
index 64ea482..82bf75f 100644
--- a/src/bytecode/opcodes.h
+++ b/src/bytecode/opcodes.h
@@ -10,6 +10,33 @@
#include <inttypes.h>
+enum op_align_content {
+ ALIGN_CONTENT_STRETCH = 0x0000,
+ ALIGN_CONTENT_FLEX_START = 0x0001,
+ ALIGN_CONTENT_FLEX_END = 0x0002,
+ ALIGN_CONTENT_CENTER = 0x0003,
+ ALIGN_CONTENT_SPACE_BETWEEN = 0x0004,
+ ALIGN_CONTENT_SPACE_AROUND = 0x0005,
+ ALIGN_CONTENT_SPACE_EVENLY = 0x0006
+};
+
+enum op_align_items {
+ ALIGN_ITEMS_STRETCH = 0x0000,
+ ALIGN_ITEMS_FLEX_START = 0x0001,
+ ALIGN_ITEMS_FLEX_END = 0x0002,
+ ALIGN_ITEMS_CENTER = 0x0003,
+ ALIGN_ITEMS_BASELINE = 0x0004
+};
+
+enum op_align_self {
+ ALIGN_SELF_STRETCH = 0x0000,
+ ALIGN_SELF_FLEX_START = 0x0001,
+ ALIGN_SELF_FLEX_END = 0x0002,
+ ALIGN_SELF_CENTER = 0x0003,
+ ALIGN_SELF_BASELINE = 0x0004,
+ ALIGN_SELF_AUTO = 0x0005
+};
+
enum op_azimuth {
AZIMUTH_ANGLE = 0x0080,
@@ -303,7 +330,9 @@ enum op_display {
DISPLAY_TABLE_COLUMN = 0x000c,
DISPLAY_TABLE_CELL = 0x000d,
DISPLAY_TABLE_CAPTION = 0x000e,
- DISPLAY_NONE = 0x000f
+ DISPLAY_NONE = 0x000f,
+ DISPLAY_FLEX = 0x0010,
+ DISPLAY_INLINE_FLEX = 0x0011
};
enum op_elevation {
@@ -320,6 +349,33 @@ enum op_empty_cells {
EMPTY_CELLS_HIDE = 0x0001
};
+enum op_flex_basis {
+ FLEX_BASIS_AUTO = 0x0000,
+ FLEX_BASIS_CONTENT = 0x0001,
+ FLEX_BASIS_SET = 0x0080
+};
+
+enum op_flex_direction {
+ FLEX_DIRECTION_ROW = 0x0000,
+ FLEX_DIRECTION_ROW_REVERSE = 0x0001,
+ FLEX_DIRECTION_COLUMN = 0x0002,
+ FLEX_DIRECTION_COLUMN_REVERSE = 0x0003
+};
+
+enum op_flex_grow {
+ FLEX_GROW_SET = 0x0080
+};
+
+enum op_flex_shrink {
+ FLEX_SHRINK_SET = 0x0080
+};
+
+enum op_flex_wrap {
+ FLEX_WRAP_NOWRAP = 0x0000,
+ FLEX_WRAP_WRAP = 0x0001,
+ FLEX_WRAP_WRAP_REVERSE = 0x0002
+};
+
enum op_float {
FLOAT_LEFT = 0x0000,
FLOAT_RIGHT = 0x0001,
@@ -385,6 +441,15 @@ enum op_height {
HEIGHT_AUTO = 0x0000
};
+enum op_justify_content {
+ JUSTIFY_CONTENT_FLEX_START = 0x0000,
+ JUSTIFY_CONTENT_FLEX_END = 0x0001,
+ JUSTIFY_CONTENT_CENTER = 0x0002,
+ JUSTIFY_CONTENT_SPACE_BETWEEN = 0x0003,
+ JUSTIFY_CONTENT_SPACE_AROUND = 0x0004,
+ JUSTIFY_CONTENT_SPACE_EVENLY = 0x0005
+};
+
enum op_left {
LEFT_SET = BOTTOM_SET,
LEFT_AUTO = BOTTOM_AUTO
@@ -445,17 +510,23 @@ enum op_max_width {
};
enum op_min_height {
- MIN_HEIGHT_SET = 0x0080
+ MIN_HEIGHT_SET = 0x0080,
+ MIN_HEIGHT_AUTO = 0x0000
};
enum op_min_width {
- MIN_WIDTH_SET = 0x0080
+ MIN_WIDTH_SET = 0x0080,
+ MIN_WIDTH_AUTO = 0x0000
};
enum op_opacity {
OPACITY_SET = 0x0080
};
+enum op_order {
+ ORDER_SET = 0x0080
+};
+
enum op_orphans {
ORPHANS_SET = 0x0080
};
@@ -735,4 +806,3 @@ enum op_z_index {
};
#endif
-
diff --git a/src/parse/important.c b/src/parse/important.c
index ca4d60c..e0e8620 100644
--- a/src/parse/important.c
+++ b/src/parse/important.c
@@ -258,6 +258,21 @@ void css__make_style_important(css_style *style)
offset += 2; /* length + units */
break;
+ case CSS_PROP_FLEX_BASIS:
+ if (value == FLEX_BASIS_SET)
+ offset += 2; /* length + units */
+ break;
+
+ case CSS_PROP_FLEX_GROW:
+ if (value == FLEX_GROW_SET)
+ offset++; /* value */
+ break;
+
+ case CSS_PROP_FLEX_SHRINK:
+ if (value == FLEX_SHRINK_SET)
+ offset++; /* value */
+ break;
+
case CSS_PROP_FONT_FAMILY:
while (value != FONT_FAMILY_END) {
switch (value) {
@@ -331,6 +346,11 @@ void css__make_style_important(css_style *style)
offset++; /* value */
break;
+ case CSS_PROP_ORDER:
+ if (value == ORDER_SET)
+ offset++; /* value */
+ break;
+
case CSS_PROP_ORPHANS:
case CSS_PROP_PITCH_RANGE:
case CSS_PROP_RICHNESS:
diff --git a/src/parse/parse.c b/src/parse/parse.c
index 68492d4..4cc1c98 100644
--- a/src/parse/parse.c
+++ b/src/parse/parse.c
@@ -2098,8 +2098,8 @@ css_error parseMalformedDeclaration(css_parser *parser)
;
state->substate = Go;
- /* Fall through */
}
+ /* Fall through */
case Go:
while (1) {
char want;
@@ -2296,8 +2296,8 @@ css_error parseMalformedAtRule(css_parser *parser)
;
state->substate = Go;
- /* Fall through */
}
+ /* Fall through */
case Go:
while (1) {
char want;
diff --git a/src/parse/properties/Makefile b/src/parse/properties/Makefile
index 6d6cff0..6461dda 100644
--- a/src/parse/properties/Makefile
+++ b/src/parse/properties/Makefile
@@ -45,6 +45,8 @@ DIR_SOURCES := \
cue.c \
cursor.c \
elevation.c \
+ flex.c \
+ flex_flow.c \
font.c \
font_family.c \
font_weight.c \
diff --git a/src/parse/properties/flex.c b/src/parse/properties/flex.c
new file mode 100644
index 0000000..9e284d9
--- a/dev/null
+++ b/src/parse/properties/flex.c
@@ -0,0 +1,213 @@
+/*
+ * This file is part of LibCSS.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "parse/properties/properties.h"
+#include "parse/properties/utils.h"
+
+/**
+ * Parse list-style
+ *
+ * \param c Parsing context
+ * \param vector Vector of tokens to process
+ * \param ctx Pointer to vector iteration context
+ * \param result Pointer to location to receive resulting style
+ * \return CSS_OK on success,
+ * CSS_NOMEM on memory exhaustion,
+ * CSS_INVALID if the input is not valid
+ *
+ * Post condition: \a *ctx is updated with the next token to process
+ * If the input is invalid, then \a *ctx remains unchanged.
+ */
+
+css_error css__parse_flex(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result)
+{
+ int orig_ctx = *ctx;
+ int prev_ctx;
+ const css_token *token;
+ css_error error;
+ bool grow = true;
+ bool shrink = true;
+ bool basis = true;
+ css_style *grow_style;
+ css_style *shrink_style;
+ css_style *basis_style;
+ bool short_auto = false;
+ bool short_none = false;
+ bool match;
+
+ /* Firstly, handle inherit */
+ token = parserutils_vector_peek(vector, *ctx);
+ if (token == NULL)
+ return CSS_INVALID;
+
+ if (is_css_inherit(c, token)) {
+ error = css_stylesheet_style_inherit(result,
+ CSS_PROP_FLEX_GROW);
+ if (error != CSS_OK)
+ return error;
+
+ error = css_stylesheet_style_inherit(result,
+ CSS_PROP_FLEX_SHRINK);
+
+ if (error != CSS_OK)
+ return error;
+
+ error = css_stylesheet_style_inherit(result,
+ CSS_PROP_FLEX_BASIS);
+
+ if (error == CSS_OK)
+ parserutils_vector_iterate(vector, ctx);
+
+ return error;
+ }
+
+ /* allocate styles */
+ error = css__stylesheet_style_create(c->sheet, &grow_style);
+ if (error != CSS_OK)
+ return error;
+
+ error = css__stylesheet_style_create(c->sheet, &shrink_style);
+ if (error != CSS_OK) {
+ css__stylesheet_style_destroy(grow_style);
+ return error;
+ }
+
+ error = css__stylesheet_style_create(c->sheet, &basis_style);
+ if (error != CSS_OK) {
+ css__stylesheet_style_destroy(grow_style);
+ css__stylesheet_style_destroy(shrink_style);
+ return error;
+ }
+
+ /* Handle shorthand none, equivalent of flex: 0 0 auto; */
+ if ((token->type == CSS_TOKEN_IDENT) &&
+ (lwc_string_caseless_isequal(
+ token->idata, c->strings[NONE],
+ &match) == lwc_error_ok && match)) {
+ short_none = true;
+ parserutils_vector_iterate(vector, ctx);
+
+ } else if ((token->type == CSS_TOKEN_IDENT) &&
+ (lwc_string_caseless_isequal(
+ token->idata, c->strings[AUTO],
+ &match) == lwc_error_ok && match)) {
+ /* Handle shorthand auto, equivalent of flex: 1 1 auto; */
+ short_auto = true;
+ parserutils_vector_iterate(vector, ctx);
+
+ } else do {
+ /* Attempt to parse the various longhand properties */
+ prev_ctx = *ctx;
+ error = CSS_OK;
+
+ /* Ensure that we're not about to parse another inherit */
+ token = parserutils_vector_peek(vector, *ctx);
+ if (token != NULL && is_css_inherit(c, token)) {
+ error = CSS_INVALID;
+ goto css__parse_flex_cleanup;
+ }
+
+ if ((grow) &&
+ (error = css__parse_flex_grow(c, vector,
+ ctx, grow_style)) == CSS_OK) {
+ grow = false;
+ } else if ((basis) &&
+ (error = css__parse_flex_basis(c, vector,
+ ctx, basis_style)) == CSS_OK) {
+ basis = false;
+ } else if ((shrink) &&
+ (error = css__parse_flex_shrink(c, vector,
+ ctx, shrink_style)) == CSS_OK) {
+ shrink = false;
+ }
+
+ if (error == CSS_OK) {
+ consumeWhitespace(vector, ctx);
+ token = parserutils_vector_peek(vector, *ctx);
+ } else {
+ /* Forcibly cause loop to exit */
+ token = NULL;
+ }
+ } while (*ctx != prev_ctx && token != NULL);
+
+ /* defaults */
+ if (grow) {
+ error = css__stylesheet_style_appendOPV(grow_style,
+ CSS_PROP_FLEX_GROW, 0, FLEX_GROW_SET);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+
+ css_fixed grow_num = short_auto ? INTTOFIX(1) : 0;
+ error = css__stylesheet_style_append(grow_style, grow_num);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+ }
+
+ if (shrink) {
+ error = css__stylesheet_style_appendOPV(shrink_style,
+ CSS_PROP_FLEX_SHRINK, 0, FLEX_SHRINK_SET);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+
+ css_fixed shrink_num = short_none ? 0 : INTTOFIX(1);
+ error = css__stylesheet_style_append(shrink_style, shrink_num);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+ }
+
+ if (basis) {
+ /* Default is auto, but zero if grow or shrink are set */
+ if (!grow || !shrink) {
+ error = css__stylesheet_style_appendOPV(basis_style,
+ CSS_PROP_FLEX_BASIS, 0,
+ FLEX_BASIS_SET);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+
+ error = css__stylesheet_style_vappend(
+ basis_style, 2, 0, UNIT_PX);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+
+ } else {
+ error = css__stylesheet_style_appendOPV(basis_style,
+ CSS_PROP_FLEX_BASIS, 0,
+ FLEX_BASIS_AUTO);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+ }
+ }
+
+ error = css__stylesheet_merge_style(result, grow_style);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+
+ error = css__stylesheet_merge_style(result, shrink_style);
+ if (error != CSS_OK)
+ goto css__parse_flex_cleanup;
+
+ error = css__stylesheet_merge_style(result, basis_style);
+
+css__parse_flex_cleanup:
+
+ css__stylesheet_style_destroy(basis_style);
+ css__stylesheet_style_destroy(shrink_style);
+ css__stylesheet_style_destroy(grow_style);
+
+ if (error != CSS_OK)
+ *ctx = orig_ctx;
+
+ return error;
+}
+
diff --git a/src/parse/properties/flex_flow.c b/src/parse/properties/flex_flow.c
new file mode 100644
index 0000000..6a83e15
--- a/dev/null
+++ b/src/parse/properties/flex_flow.c
@@ -0,0 +1,137 @@
+/*
+ * This file is part of LibCSS.
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include <assert.h>
+#include <string.h>
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "parse/properties/properties.h"
+#include "parse/properties/utils.h"
+
+/**
+ * Parse flex-flow
+ *
+ * \param c Parsing context
+ * \param vector Vector of tokens to process
+ * \param ctx Pointer to vector iteration context
+ * \param result Pointer to location to receive resulting style
+ * \return CSS_OK on success,
+ * CSS_NOMEM on memory exhaustion,
+ * CSS_INVALID if the input is not valid
+ *
+ * Post condition: \a *ctx is updated with the next token to process
+ * If the input is invalid, then \a *ctx remains unchanged.
+ */
+
+css_error css__parse_flex_flow(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result)
+{
+ int orig_ctx = *ctx;
+ int prev_ctx;
+ const css_token *token;
+ css_error error;
+ bool direction = true;
+ bool wrap = true;
+ css_style *direction_style;
+ css_style *wrap_style;
+
+ /* Firstly, handle inherit */
+ token = parserutils_vector_peek(vector, *ctx);
+ if (token == NULL)
+ return CSS_INVALID;
+
+ if (is_css_inherit(c, token)) {
+ error = css_stylesheet_style_inherit(result,
+ CSS_PROP_FLEX_DIRECTION);
+ if (error != CSS_OK)
+ return error;
+
+ error = css_stylesheet_style_inherit(result,
+ CSS_PROP_FLEX_WRAP);
+
+ if (error == CSS_OK)
+ parserutils_vector_iterate(vector, ctx);
+
+ return error;
+ }
+
+ /* allocate styles */
+ error = css__stylesheet_style_create(c->sheet, &direction_style);
+ if (error != CSS_OK)
+ return error;
+
+ error = css__stylesheet_style_create(c->sheet, &wrap_style);
+ if (error != CSS_OK) {
+ css__stylesheet_style_destroy(direction_style);
+ return error;
+ }
+
+ /* Attempt to parse the various longhand properties */
+ do {
+ prev_ctx = *ctx;
+ error = CSS_OK;
+
+ /* Ensure that we're not about to parse another inherit */
+ token = parserutils_vector_peek(vector, *ctx);
+ if (token != NULL && is_css_inherit(c, token)) {
+ error = CSS_INVALID;
+ goto css__parse_flex_flow_cleanup;
+ }
+
+ if ((wrap) &&
+ (error = css__parse_flex_wrap(c, vector,
+ ctx, wrap_style)) == CSS_OK) {
+ wrap = false;
+ } else if ((direction) &&
+ (error = css__parse_flex_direction(c, vector,
+ ctx, direction_style)) == CSS_OK) {
+ direction = false;
+ }
+
+ if (error == CSS_OK) {
+ consumeWhitespace(vector, ctx);
+
+ token = parserutils_vector_peek(vector, *ctx);
+ } else {
+ /* Forcibly cause loop to exit */
+ token = NULL;
+ }
+ } while (*ctx != prev_ctx && token != NULL);
+
+
+ /* defaults */
+ if (direction) {
+ error = css__stylesheet_style_appendOPV(direction_style,
+ CSS_PROP_FLEX_DIRECTION,
+ 0, FLEX_DIRECTION_ROW);
+ }
+
+ if (wrap) {
+ error = css__stylesheet_style_appendOPV(wrap_style,
+ CSS_PROP_FLEX_WRAP,
+ 0, FLEX_WRAP_NOWRAP);
+ }
+
+ error = css__stylesheet_merge_style(result, direction_style);
+ if (error != CSS_OK)
+ goto css__parse_flex_flow_cleanup;
+
+ error = css__stylesheet_merge_style(result, wrap_style);
+
+css__parse_flex_flow_cleanup:
+
+ css__stylesheet_style_destroy(wrap_style);
+ css__stylesheet_style_destroy(direction_style);
+
+ if (error != CSS_OK)
+ *ctx = orig_ctx;
+
+ return error;
+}
+
diff --git a/src/parse/properties/properties.c b/src/parse/properties/properties.c
index f32e374..3f374fa 100644
--- a/src/parse/properties/properties.c
+++ b/src/parse/properties/properties.c
@@ -12,6 +12,9 @@
*/
const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
{
+ css__parse_align_content,
+ css__parse_align_items,
+ css__parse_align_self,
css__parse_azimuth,
css__parse_background,
css__parse_background_attachment,
@@ -71,6 +74,13 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
css__parse_display,
css__parse_elevation,
css__parse_empty_cells,
+ css__parse_flex,
+ css__parse_flex_basis,
+ css__parse_flex_direction,
+ css__parse_flex_flow,
+ css__parse_flex_grow,
+ css__parse_flex_shrink,
+ css__parse_flex_wrap,
css__parse_float,
css__parse_font,
css__parse_font_family,
@@ -79,6 +89,7 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
css__parse_font_variant,
css__parse_font_weight,
css__parse_height,
+ css__parse_justify_content,
css__parse_left,
css__parse_letter_spacing,
css__parse_line_height,
@@ -96,6 +107,7 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
css__parse_min_height,
css__parse_min_width,
css__parse_opacity,
+ css__parse_order,
css__parse_orphans,
css__parse_outline,
css__parse_outline_color,
@@ -146,4 +158,3 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] =
css__parse_writing_mode,
css__parse_z_index
};
-
diff --git a/src/parse/properties/properties.gen b/src/parse/properties/properties.gen
index 60d5536..61dcd5e 100644
--- a/src/parse/properties/properties.gen
+++ b/src/parse/properties/properties.gen
@@ -16,7 +16,7 @@ cue_before:CSS_PROP_CUE_BEFORE IDENT:( INHERIT: NONE:0,CUE_BEFORE_NONE IDENT:) U
direction:CSS_PROP_DIRECTION IDENT:( INHERIT: LTR:0,DIRECTION_LTR RTL:0,DIRECTION_RTL IDENT:)
-display:CSS_PROP_DISPLAY IDENT:( INHERIT: INLINE:0,DISPLAY_INLINE BLOCK:0,DISPLAY_BLOCK LIST_ITEM:0,DISPLAY_LIST_ITEM RUN_IN:0,DISPLAY_RUN_IN INLINE_BLOCK:0,DISPLAY_INLINE_BLOCK TABLE:0,DISPLAY_TABLE INLINE_TABLE:0,DISPLAY_INLINE_TABLE TABLE_ROW_GROUP:0,DISPLAY_TABLE_ROW_GROUP TABLE_HEADER_GROUP:0,DISPLAY_TABLE_HEADER_GROUP TABLE_FOOTER_GROUP:0,DISPLAY_TABLE_FOOTER_GROUP TABLE_ROW:0,DISPLAY_TABLE_ROW TABLE_COLUMN_GROUP:0,DISPLAY_TABLE_COLUMN_GROUP TABLE_COLUMN:0,DISPLAY_TABLE_COLUMN TABLE_CELL:0,DISPLAY_TABLE_CELL TABLE_CAPTION:0,DISPLAY_TABLE_CAPTION NONE:0,DISPLAY_NONE IDENT:)
+display:CSS_PROP_DISPLAY IDENT:( INHERIT: INLINE:0,DISPLAY_INLINE BLOCK:0,DISPLAY_BLOCK LIST_ITEM:0,DISPLAY_LIST_ITEM RUN_IN:0,DISPLAY_RUN_IN INLINE_BLOCK:0,DISPLAY_INLINE_BLOCK TABLE:0,DISPLAY_TABLE INLINE_TABLE:0,DISPLAY_INLINE_TABLE TABLE_ROW_GROUP:0,DISPLAY_TABLE_ROW_GROUP TABLE_HEADER_GROUP:0,DISPLAY_TABLE_HEADER_GROUP TABLE_FOOTER_GROUP:0,DISPLAY_TABLE_FOOTER_GROUP TABLE_ROW:0,DISPLAY_TABLE_ROW TABLE_COLUMN_GROUP:0,DISPLAY_TABLE_COLUMN_GROUP TABLE_COLUMN:0,DISPLAY_TABLE_COLUMN TABLE_CELL:0,DISPLAY_TABLE_CELL TABLE_CAPTION:0,DISPLAY_TABLE_CAPTION NONE:0,DISPLAY_NONE FLEX:0,DISPLAY_FLEX INLINE_FLEX:0,DISPLAY_INLINE_FLEX IDENT:)
empty_cells:CSS_PROP_EMPTY_CELLS IDENT:( INHERIT: SHOW:0,EMPTY_CELLS_SHOW HIDE:0,EMPTY_CELLS_HIDE IDENT:)
@@ -43,9 +43,9 @@ max_height:CSS_PROP_MAX_HEIGHT IDENT:( INHERIT: NONE:0,MAX_HEIGHT_NONE IDENT:) L
max_width:CSS_PROP_MAX_WIDTH IDENT:( INHERIT: NONE:0,MAX_WIDTH_NONE IDENT:) LENGTH_UNIT:( UNIT_PX:MAX_WIDTH_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ RANGE:<0 LENGTH_UNIT:)
-min_height:CSS_PROP_MIN_HEIGHT IDENT:INHERIT LENGTH_UNIT:( UNIT_PX:MIN_HEIGHT_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ RANGE:<0 LENGTH_UNIT:)
+min_height:CSS_PROP_MIN_HEIGHT IDENT:( INHERIT: AUTO:0,MIN_HEIGHT_AUTO IDENT:) LENGTH_UNIT:( UNIT_PX:MIN_HEIGHT_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ RANGE:<0 LENGTH_UNIT:)
-min_width:CSS_PROP_MIN_WIDTH IDENT:INHERIT LENGTH_UNIT:( UNIT_PX:MIN_WIDTH_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ RANGE:<0 LENGTH_UNIT:)
+min_width:CSS_PROP_MIN_WIDTH IDENT:( INHERIT: AUTO:0,MIN_WIDTH_AUTO IDENT:) LENGTH_UNIT:( UNIT_PX:MIN_WIDTH_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ RANGE:<0 LENGTH_UNIT:)
color:CSS_PROP_COLOR IDENT:INHERIT COLOR:COLOR_SET
@@ -217,3 +217,23 @@ column_width:CSS_PROP_COLUMN_WIDTH IDENT:( INHERIT: AUTO:0,COLUMN_WIDTH_AUTO IDE
writing_mode:CSS_PROP_WRITING_MODE IDENT:( INHERIT: HORIZONTAL_TB:0,WRITING_MODE_HORIZONTAL_TB VERTICAL_RL:0,WRITING_MODE_VERTICAL_RL VERTICAL_LR:0,WRITING_MODE_VERTICAL_LR IDENT:)
box_sizing:CSS_PROP_BOX_SIZING IDENT:( INHERIT: CONTENT_BOX:0,BOX_SIZING_CONTENT_BOX BORDER_BOX:0,BOX_SIZING_BORDER_BOX IDENT:)
+
+align_content:CSS_PROP_ALIGN_CONTENT IDENT:( INHERIT: STRETCH:0,ALIGN_CONTENT_STRETCH FLEX_START:0,ALIGN_CONTENT_FLEX_START FLEX_END:0,ALIGN_CONTENT_FLEX_END CENTER:0,ALIGN_CONTENT_CENTER SPACE_BETWEEN:0,ALIGN_CONTENT_SPACE_BETWEEN SPACE_AROUND:0,ALIGN_CONTENT_SPACE_AROUND SPACE_EVENLY:0,ALIGN_CONTENT_SPACE_EVENLY IDENT:)
+
+align_items:CSS_PROP_ALIGN_ITEMS IDENT:( INHERIT: STRETCH:0,ALIGN_ITEMS_STRETCH FLEX_START:0,ALIGN_ITEMS_FLEX_START FLEX_END:0,ALIGN_ITEMS_FLEX_END CENTER:0,ALIGN_ITEMS_CENTER BASELINE:0,ALIGN_ITEMS_BASELINE IDENT:)
+
+align_self:CSS_PROP_ALIGN_SELF IDENT:( INHERIT: STRETCH:0,ALIGN_SELF_STRETCH FLEX_START:0,ALIGN_SELF_FLEX_START FLEX_END:0,ALIGN_SELF_FLEX_END CENTER:0,ALIGN_SELF_CENTER BASELINE:0,ALIGN_SELF_BASELINE AUTO:0,ALIGN_SELF_AUTO IDENT:)
+
+flex_basis:CSS_PROP_FLEX_BASIS IDENT:( INHERIT: AUTO:0,FLEX_BASIS_AUTO CONTENT:0,FLEX_BASIS_CONTENT IDENT:) LENGTH_UNIT:( UNIT_PX:FLEX_BASIS_SET DISALLOW:unit&UNIT_ANGLE||unit&UNIT_TIME||unit&UNIT_FREQ RANGE:<0 LENGTH_UNIT:)
+
+flex_direction:CSS_PROP_FLEX_DIRECTION IDENT:( INHERIT: ROW:0,FLEX_DIRECTION_ROW ROW_REVERSE:0,FLEX_DIRECTION_ROW_REVERSE COLUMN:0,FLEX_DIRECTION_COLUMN COLUMN_REVERSE:0,FLEX_DIRECTION_COLUMN_REVERSE IDENT:)
+
+flex_grow:CSS_PROP_FLEX_GROW IDENT:INHERIT NUMBER:( false:FLEX_GROW_SET RANGE:num<0 NUMBER:)
+
+flex_shrink:CSS_PROP_FLEX_SHRINK IDENT:INHERIT NUMBER:( false:FLEX_SHRINK_SET RANGE:num<0 NUMBER:)
+
+flex_wrap:CSS_PROP_FLEX_WRAP IDENT:( INHERIT: NOWRAP:0,FLEX_WRAP_NOWRAP WRAP_STRING:0,FLEX_WRAP_WRAP WRAP_REVERSE:0,FLEX_WRAP_WRAP_REVERSE IDENT:)
+
+justify_content:CSS_PROP_JUSTIFY_CONTENT IDENT:( INHERIT: FLEX_START:0,JUSTIFY_CONTENT_FLEX_START FLEX_END:0,JUSTIFY_CONTENT_FLEX_END CENTER:0,JUSTIFY_CONTENT_CENTER SPACE_BETWEEN:0,JUSTIFY_CONTENT_SPACE_BETWEEN SPACE_AROUND:0,JUSTIFY_CONTENT_SPACE_AROUND SPACE_EVENLY:0,JUSTIFY_CONTENT_SPACE_EVENLY IDENT:)
+
+order:CSS_PROP_ORDER IDENT:INHERIT NUMBER:( true:ORDER_SET NUMBER:)
diff --git a/src/parse/properties/properties.h b/src/parse/properties/properties.h
index 4517515..1e085c5 100644
--- a/src/parse/properties/properties.h
+++ b/src/parse/properties/properties.h
@@ -22,6 +22,15 @@ typedef css_error (*css_prop_handler)(css_language *c,
extern const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP];
+css_error css__parse_align_content(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_align_items(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_align_self(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
css_error css__parse_azimuth(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
@@ -199,6 +208,27 @@ css_error css__parse_elevation(css_language *c,
css_error css__parse_empty_cells(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
+css_error css__parse_flex(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_flex_basis(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_flex_direction(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_flex_flow(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_flex_grow(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_flex_shrink(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
+css_error css__parse_flex_wrap(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
css_error css__parse_float(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
@@ -223,6 +253,9 @@ css_error css__parse_font_weight(css_language *c,
css_error css__parse_height(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
+css_error css__parse_justify_content(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
css_error css__parse_left(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
@@ -274,6 +307,9 @@ css_error css__parse_min_width(css_language *c,
css_error css__parse_opacity(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
+css_error css__parse_order(css_language *c,
+ const parserutils_vector *vector, int *ctx,
+ css_style *result);
css_error css__parse_orphans(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style *result);
@@ -423,4 +459,3 @@ css_error css__parse_z_index(css_language *c,
css_style *result);
#endif
-
diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c
index 47b06e3..76b406b 100644
--- a/src/parse/properties/utils.c
+++ b/src/parse/properties/utils.c
@@ -1007,6 +1007,10 @@ css_error css__parse_unit_keyword(const char *ptr, size_t len, uint32_t *unit)
if (len == 4) {
if (strncasecmp(ptr, "grad", 4) == 0)
*unit = UNIT_GRAD;
+ else if (strncasecmp(ptr, "vmin", 4) == 0)
+ *unit = UNIT_VMIN;
+ else if (strncasecmp(ptr, "vmax", 4) == 0)
+ *unit = UNIT_VMAX;
else
return CSS_INVALID;
} else if (len == 3) {
@@ -1016,6 +1020,12 @@ css_error css__parse_unit_keyword(const char *ptr, size_t len, uint32_t *unit)
*unit = UNIT_DEG;
else if (strncasecmp(ptr, "rad", 3) == 0)
*unit = UNIT_RAD;
+ else if (strncasecmp(ptr, "cap", 3) == 0)
+ *unit = UNIT_CAP;
+ else if (strncasecmp(ptr, "rem", 3) == 0)
+ *unit = UNIT_REM;
+ else if (strncasecmp(ptr, "rlh", 3) == 0)
+ *unit = UNIT_RLH;
else
return CSS_INVALID;
} else if (len == 2) {
@@ -1039,11 +1049,27 @@ css_error css__parse_unit_keyword(const char *ptr, size_t len, uint32_t *unit)
*unit = UNIT_PT;
else if (strncasecmp(ptr, "pc", 2) == 0)
*unit = UNIT_PC;
+ else if (strncasecmp(ptr, "ch", 2) == 0)
+ *unit = UNIT_CH;
+ else if (strncasecmp(ptr, "ic", 2) == 0)
+ *unit = UNIT_IC;
+ else if (strncasecmp(ptr, "lh", 2) == 0)
+ *unit = UNIT_LH;
+ else if (strncasecmp(ptr, "vh", 2) == 0)
+ *unit = UNIT_VH;
+ else if (strncasecmp(ptr, "vw", 2) == 0)
+ *unit = UNIT_VW;
+ else if (strncasecmp(ptr, "vi", 2) == 0)
+ *unit = UNIT_VI;
+ else if (strncasecmp(ptr, "vb", 2) == 0)
+ *unit = UNIT_VB;
else
return CSS_INVALID;
} else if (len == 1) {
if (strncasecmp(ptr, "s", 1) == 0)
*unit = UNIT_S;
+ else if (strncasecmp(ptr, "q", 1) == 0)
+ *unit = UNIT_Q;
else
return CSS_INVALID;
} else
diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c
index dd6bee4..bfd2965 100644
--- a/src/parse/propstrings.c
+++ b/src/parse/propstrings.c
@@ -82,6 +82,9 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "before", SLEN("before") },
{ "after", SLEN("after") },
+ { "align-content", SLEN("align-content") },
+ { "align-items", SLEN("align-items") },
+ { "align-self", SLEN("align-self") },
{ "azimuth", SLEN("azimuth") },
{ "background", SLEN("background") },
{ "background-attachment", SLEN("background-attachment") },
@@ -141,6 +144,13 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "display", SLEN("display") },
{ "elevation", SLEN("elevation") },
{ "empty-cells", SLEN("empty-cells") },
+ { "flex", SLEN("flex") },
+ { "flex-basis", SLEN("flex-basis") },
+ { "flex-direction", SLEN("flex-direction") },
+ { "flex-flow", SLEN("flex-flow") },
+ { "flex-grow", SLEN("flex-grow") },
+ { "flex-shrink", SLEN("flex-shrink") },
+ { "flex-wrap", SLEN("flex-wrap") },
{ "float", SLEN("float") },
{ "font", SLEN("font") },
{ "font-family", SLEN("font-family") },
@@ -149,6 +159,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "font-variant", SLEN("font-variant") },
{ "font-weight", SLEN("font-weight") },
{ "height", SLEN("height") },
+ { "justify-content", SLEN("justify-content") },
{ "left", SLEN("left") },
{ "letter-spacing", SLEN("letter-spacing") },
{ "line-height", SLEN("line-height") },
@@ -166,6 +177,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "min-height", SLEN("min-height") },
{ "min-width", SLEN("min-width") },
{ "opacity", SLEN("opacity") },
+ { "order", SLEN("order") },
{ "orphans", SLEN("orphans") },
{ "outline", SLEN("outline") },
{ "outline-color", SLEN("outline-color") },
@@ -415,6 +427,18 @@ const stringmap_entry stringmap[LAST_KNOWN] = {
{ "vertical-lr", SLEN("vertical-lr") },
{ "content-box", SLEN("content-box") },
{ "border-box", SLEN("border-box") },
+ { "stretch", SLEN("stretch") },
+ { "inline-flex", SLEN("inline-flex") },
+ { "flex-start", SLEN("flex-start") },
+ { "flex-end", SLEN("flex-end") },
+ { "space-between", SLEN("space-between") },
+ { "space-around", SLEN("space-around") },
+ { "space-evenly", SLEN("space-evenly") },
+ { "row", SLEN("row") },
+ { "row-reverse", SLEN("row-reverse") },
+ { "column-reverse", SLEN("column-reverse") },
+ { "wrap", SLEN("wrap") },
+ { "wrap-reverse", SLEN("wrap-reverse") },
{ "aliceblue", SLEN("aliceblue") },
{ "antiquewhite", SLEN("antiquewhite") },
@@ -621,5 +645,3 @@ void css__propstrings_unref(void)
lwc_string_unref(css__propstrings.strings[i]);
}
}
-
-
diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h
index e0d16e2..67eaa5f 100644
--- a/src/parse/propstrings.h
+++ b/src/parse/propstrings.h
@@ -38,12 +38,12 @@ enum {
/* Properties */
FIRST_PROP,
- AZIMUTH = FIRST_PROP, BACKGROUND, BACKGROUND_ATTACHMENT,
- BACKGROUND_COLOR, BACKGROUND_IMAGE, BACKGROUND_POSITION,
- BACKGROUND_REPEAT, BORDER, BORDER_BOTTOM, BORDER_BOTTOM_COLOR,
- BORDER_BOTTOM_STYLE, BORDER_BOTTOM_WIDTH, BORDER_COLLAPSE,
- BORDER_COLOR, BORDER_LEFT, BORDER_LEFT_COLOR, BORDER_LEFT_STYLE,
- BORDER_LEFT_WIDTH, BORDER_RIGHT, BORDER_RIGHT_COLOR,
+ ALIGN_CONTENT = FIRST_PROP, ALIGN_ITEMS, ALIGN_SELF, AZIMUTH,
+ BACKGROUND, BACKGROUND_ATTACHMENT, BACKGROUND_COLOR, BACKGROUND_IMAGE,
+ BACKGROUND_POSITION, BACKGROUND_REPEAT, BORDER, BORDER_BOTTOM,
+ BORDER_BOTTOM_COLOR, BORDER_BOTTOM_STYLE, BORDER_BOTTOM_WIDTH,
+ BORDER_COLLAPSE, BORDER_COLOR, BORDER_LEFT, BORDER_LEFT_COLOR,
+ BORDER_LEFT_STYLE, BORDER_LEFT_WIDTH, BORDER_RIGHT, BORDER_RIGHT_COLOR,
BORDER_RIGHT_STYLE, BORDER_RIGHT_WIDTH, BORDER_SPACING,
BORDER_STYLE, BORDER_TOP, BORDER_TOP_COLOR, BORDER_TOP_STYLE,
BORDER_TOP_WIDTH, BORDER_WIDTH, BOTTOM, BOX_SIZING, BREAK_AFTER,
@@ -51,21 +51,22 @@ enum {
COLUMN_COUNT, COLUMN_FILL, COLUMN_GAP, COLUMN_RULE, COLUMN_RULE_COLOR,
COLUMN_RULE_STYLE, COLUMN_RULE_WIDTH, COLUMN_SPAN, COLUMN_WIDTH,
CONTENT, COUNTER_INCREMENT, COUNTER_RESET, CUE, CUE_AFTER, CUE_BEFORE,
- CURSOR, DIRECTION, DISPLAY, ELEVATION, EMPTY_CELLS, LIBCSS_FLOAT, FONT,
- FONT_FAMILY, FONT_SIZE, FONT_STYLE, FONT_VARIANT, FONT_WEIGHT, HEIGHT,
- LEFT, LETTER_SPACING, LINE_HEIGHT, LIST_STYLE, LIST_STYLE_IMAGE,
- LIST_STYLE_POSITION, LIST_STYLE_TYPE, MARGIN, MARGIN_BOTTOM,
- MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, MAX_HEIGHT, MAX_WIDTH,
- MIN_HEIGHT, MIN_WIDTH, OPACITY, ORPHANS, OUTLINE, OUTLINE_COLOR,
- OUTLINE_STYLE, OUTLINE_WIDTH, OVERFLOW, OVERFLOW_X, OVERFLOW_Y, PADDING,
- PADDING_BOTTOM, PADDING_LEFT, PADDING_RIGHT, PADDING_TOP,
- PAGE_BREAK_AFTER, PAGE_BREAK_BEFORE, PAGE_BREAK_INSIDE, PAUSE,
- PAUSE_AFTER, PAUSE_BEFORE, PITCH_RANGE, PITCH, PLAY_DURING, POSITION,
- QUOTES, RICHNESS, RIGHT, SPEAK_HEADER, SPEAK_NUMERAL, SPEAK_PUNCTUATION,
- SPEAK, SPEECH_RATE, STRESS, TABLE_LAYOUT, TEXT_ALIGN, TEXT_DECORATION,
- TEXT_INDENT, TEXT_TRANSFORM, TOP, UNICODE_BIDI, VERTICAL_ALIGN,
- VISIBILITY, VOICE_FAMILY, VOLUME, WHITE_SPACE, WIDOWS, WIDTH,
- WORD_SPACING, WRITING_MODE, Z_INDEX,
+ CURSOR, DIRECTION, DISPLAY, ELEVATION, EMPTY_CELLS, FLEX, FLEX_BASIS,
+ FLEX_DIRECTION, FLEX_FLOW, FLEX_GROW, FLEX_SHRINK, FLEX_WRAP,
+ LIBCSS_FLOAT, FONT, FONT_FAMILY, FONT_SIZE, FONT_STYLE, FONT_VARIANT,
+ FONT_WEIGHT, HEIGHT, JUSTIFY_CONTENT, LEFT, LETTER_SPACING, LINE_HEIGHT,
+ LIST_STYLE, LIST_STYLE_IMAGE, LIST_STYLE_POSITION, LIST_STYLE_TYPE,
+ MARGIN, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP,
+ MAX_HEIGHT, MAX_WIDTH, MIN_HEIGHT, MIN_WIDTH, OPACITY, ORDER, ORPHANS,
+ OUTLINE, OUTLINE_COLOR, OUTLINE_STYLE, OUTLINE_WIDTH, OVERFLOW,
+ OVERFLOW_X, OVERFLOW_Y, PADDING, PADDING_BOTTOM, PADDING_LEFT,
+ PADDING_RIGHT, PADDING_TOP, PAGE_BREAK_AFTER, PAGE_BREAK_BEFORE,
+ PAGE_BREAK_INSIDE, PAUSE, PAUSE_AFTER, PAUSE_BEFORE, PITCH_RANGE, PITCH,
+ PLAY_DURING, POSITION, QUOTES, RICHNESS, RIGHT, SPEAK_HEADER,
+ SPEAK_NUMERAL, SPEAK_PUNCTUATION, SPEAK, SPEECH_RATE, STRESS,
+ TABLE_LAYOUT, TEXT_ALIGN, TEXT_DECORATION, TEXT_INDENT, TEXT_TRANSFORM,
+ TOP, UNICODE_BIDI, VERTICAL_ALIGN, VISIBILITY, VOICE_FAMILY, VOLUME,
+ WHITE_SPACE, WIDOWS, WIDTH, WORD_SPACING, WRITING_MODE, Z_INDEX,
LAST_PROP = Z_INDEX,
@@ -98,7 +99,9 @@ enum {
LIBCSS_RIGHT, CURRENTCOLOR, ODD, EVEN, SRC, LOCAL, INITIAL,
FORMAT, WOFF, TRUETYPE, OPENTYPE, EMBEDDED_OPENTYPE, SVG, COLUMN,
AVOID_PAGE, AVOID_COLUMN, BALANCE, HORIZONTAL_TB, VERTICAL_RL,
- VERTICAL_LR, CONTENT_BOX, BORDER_BOX,
+ VERTICAL_LR, CONTENT_BOX, BORDER_BOX, STRETCH, INLINE_FLEX, FLEX_START,
+ FLEX_END, SPACE_BETWEEN, SPACE_AROUND, SPACE_EVENLY, ROW, ROW_REVERSE,
+ COLUMN_REVERSE, WRAP_STRING, WRAP_REVERSE,
/* Named colours */
FIRST_COLOUR,
@@ -138,4 +141,3 @@ css_error css__propstrings_get(lwc_string ***strings);
void css__propstrings_unref(void);
#endif
-
diff --git a/src/select/.gitignore b/src/select/.gitignore
new file mode 100644
index 0000000..3901713
--- a/dev/null
+++ b/src/select/.gitignore
@@ -0,0 +1,3 @@
+__pycache__
+*.pyc
+
diff --git a/src/select/Makefile b/src/select/Makefile
index e937191..025ad39 100644
--- a/src/select/Makefile
+++ b/src/select/Makefile
@@ -1,4 +1,7 @@
# Sources
+select_generator:
+ python3 src/select/select_generator.py
+
DIR_SOURCES := arena.c computed.c dispatch.c hash.c select.c font_face.c
include $(NSBUILD)/Makefile.subdir
diff --git a/src/select/arena_hash.h b/src/select/arena_hash.h
index 58abcd4..449284f 100644
--- a/src/select/arena_hash.h
+++ b/src/select/arena_hash.h
@@ -49,8 +49,8 @@ static inline uint32_t css__arena_hash(const uint8_t *data, size_t len)
/* Hash any left over bytes */
switch (len) {
- case 3: h ^= data[2] << 16;
- case 2: h ^= data[1] << 8;
+ case 3: h ^= data[2] << 16; /* Fall through */
+ case 2: h ^= data[1] << 8; /* Fall through */
case 1: h ^= data[0];
h *= m;
}
diff --git a/src/select/assets.py b/src/select/assets.py
new file mode 100644
index 0000000..67c6b6b
--- a/dev/null
+++ b/src/select/assets.py
@@ -0,0 +1,30 @@
+# This file is part of LibCSS.
+# Licensed under the MIT License,
+# http://www.opensource.org/licenses/mit-license.php
+# Copyright 2017 Lucas Neves <lcneves@gmail.com>
+
+copyright = '''\
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 The NetSurf Project
+ */
+'''
+
+assets = {}
+
+assets['computed.h'] = {}
+assets['computed.h']['header'] = copyright
+assets['computed.h']['footer'] = ''
+
+assets['propset.h'] = {}
+assets['propset.h']['header'] = copyright + '''
+/** Default values are 'initial value', unless the property is inherited,
+ * in which case it is 'inherit'. */'''
+assets['propset.h']['footer'] = ''
+
+assets['propget.h'] = {}
+assets['propget.h']['header'] = copyright
+assets['propget.h']['footer'] = ''
+
diff --git a/src/select/autogenerated_computed.h b/src/select/autogenerated_computed.h
new file mode 100644
index 0000000..11f4808
--- a/dev/null
+++ b/src/select/autogenerated_computed.h
@@ -0,0 +1,328 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 The NetSurf Project
+ */
+
+
+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 bbbbbbbbbbbccccccccoooooooouuuuu
+ * border_spacing; column_rule_width; outline_width; cursor
+ *
+ * 1 lllllllcccccccooooooowwwwwwwbbbb
+ * letter_spacing; column_gap; column_width; word_spacing; break_after
+ *
+ * 2 ccccccccccccccccccccccccccbbbboo
+ * clip; break_before; column_count
+ *
+ * 3 bbbbccccwwoolluunnmmte..........
+ * break_inside; column_rule_style; writing_mode; column_span;
+ * column_rule_color; outline_color; content; column_fill; 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)
+ * --- --- ---
+ * align_content 3
+ * align_items 3
+ * align_self 3
+ * background_attachment 2
+ * background_color 2 4
+ * background_image 1 sizeof(ptr)
+ * background_position 1 + 10 8
+ * background_repeat 3
+ * border_bottom_color 2 4
+ * border_bottom_style 4
+ * border_bottom_width 3 + 5 4
+ * border_collapse 2
+ * border_left_color 2 4
+ * border_left_style 4
+ * border_left_width 3 + 5 4
+ * border_right_color 2 4
+ * border_right_style 4
+ * border_right_width 3 + 5 4
+ * border_top_color 2 4
+ * border_top_style 4
+ * border_top_width 3 + 5 4
+ * bottom 2 + 5 4
+ * box_sizing 2
+ * caption_side 2
+ * clear 3
+ * color 1 4
+ * direction 2
+ * display 5
+ * empty_cells 2
+ * flex_basis 2 + 5 4
+ * flex_direction 3
+ * flex_grow 1 4
+ * flex_shrink 1 4
+ * flex_wrap 2
+ * float 2
+ * font_size 4 + 5 4
+ * font_style 2
+ * font_variant 2
+ * font_weight 4
+ * height 2 + 5 4
+ * justify_content 3
+ * left 2 + 5 4
+ * line_height 2 + 5 4
+ * list_style_image 1 sizeof(ptr)
+ * list_style_position 2
+ * list_style_type 4
+ * margin_bottom 2 + 5 4
+ * margin_left 2 + 5 4
+ * margin_right 2 + 5 4
+ * margin_top 2 + 5 4
+ * max_height 2 + 5 4
+ * max_width 2 + 5 4
+ * min_height 2 + 5 4
+ * min_width 2 + 5 4
+ * opacity 1 4
+ * order 1 4
+ * outline_style 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
+ * position 3
+ * right 2 + 5 4
+ * table_layout 2
+ * text_align 4
+ * text_decoration 5
+ * text_indent 1 + 5 4
+ * text_transform 3
+ * top 2 + 5 4
+ * unicode_bidi 2
+ * vertical_align 4 + 5 4
+ * visibility 2
+ * white_space 3
+ * width 2 + 5 4
+ * z_index 2 4
+ *
+ * Encode font family as an array of string objects, terminated with a blank
+ * entry.
+ *
+ * font_family 3 sizeof(ptr)
+ *
+ * Encode quotes as an array of string objects, terminated with a blank entry.
+ *
+ * quotes 1 sizeof(ptr)
+ *
+ * --- --- ---
+ * 332 bits 160 + 4sizeof(ptr) bytes
+ * ===================
+ * 202 + 4sizeof(ptr) bytes
+ *
+ * Bit allocations:
+ *
+ * 0 bbbbbbbboooooooorrrrrrrrdddddddd
+ * border_bottom_width; border_left_width; border_top_width; border_right_width
+ *
+ * 1 mmmmmmmaaaaaaawwwwwwwfffffffbbbb
+ * margin_right; max_width; width; flex_basis; border_top_style
+ *
+ * 2 mmmmmmmiiiiiiilllllllhhhhhhhbbbb
+ * margin_bottom; min_width; line_height; height; border_right_style
+ *
+ * 3 lllllllbbbbbbbmmmmmmmiiiiiiissss
+ * left; bottom; max_height; min_height; list_style_type
+ *
+ * 4 rrrrrrrmmmmmmmtttttttaaaaaaaffff
+ * right; margin_top; top; margin_left; font_weight
+ *
+ * 5 bbbbbbbbbbbvvvvvvvvvfffffffffwww
+ * background_position; vertical_align; font_size; white_space
+ *
+ * 6 dddddtttttbbbbooooeeeeuuuuaaafff
+ * display; text_decoration; border_bottom_style; border_left_style;
+ * text_align; outline_style; background_repeat; flex_direction
+ *
+ * 7 ppppppaaaaaaddddddttttttiiiiiibb
+ * padding_top; padding_left; padding_right; text_indent; padding_bottom;
+ * background_color
+ *
+ * 8 tttfffoooaaalllpppccciiijjjvvvdd
+ * text_transform; font_family; overflow_y; align_self; align_items; position;
+ * clear; align_content; justify_content; overflow_x; direction
+ *
+ * 9 ttbbaazzffllvvooFFeeccrrnnuuxxii
+ * table_layout; border_right_color; background_attachment; z_index;
+ * font_style; flex_wrap; visibility; border_top_color; float; empty_cells;
+ * caption_side; border_bottom_color; font_variant; unicode_bidi; box_sizing;
+ * list_style_position
+ *
+ * 10 bbooaclqfrpe....................
+ * border_left_color; border_collapse; background_image; color;
+ * list_style_image; quotes; flex_grow; order; opacity; flex_shrink
+ */
+ uint32_t bits[11];
+
+ css_color background_color;
+ lwc_string *background_image;
+ css_fixed background_position_a;
+ css_fixed background_position_b;
+ css_color border_bottom_color;
+ css_fixed border_bottom_width;
+ css_color border_left_color;
+ css_fixed border_left_width;
+ css_color border_right_color;
+ css_fixed border_right_width;
+ css_color border_top_color;
+ css_fixed border_top_width;
+ css_fixed bottom;
+ css_color color;
+ css_fixed flex_basis;
+ css_fixed flex_grow;
+ css_fixed flex_shrink;
+ css_fixed font_size;
+ css_fixed height;
+ css_fixed left;
+ css_fixed line_height;
+ lwc_string *list_style_image;
+ css_fixed margin_bottom;
+ css_fixed margin_left;
+ css_fixed margin_right;
+ css_fixed margin_top;
+ css_fixed max_height;
+ css_fixed max_width;
+ css_fixed min_height;
+ css_fixed min_width;
+ css_fixed opacity;
+ int32_t order;
+ css_fixed padding_bottom;
+ css_fixed padding_left;
+ css_fixed padding_right;
+ css_fixed padding_top;
+ css_fixed right;
+ css_fixed text_indent;
+ css_fixed top;
+ css_fixed vertical_align;
+ css_fixed width;
+ int32_t z_index;
+
+ css_computed_uncommon *uncommon;
+ void *aural;
+};
+
+struct css_computed_style {
+ struct css_computed_style_i i;
+
+ lwc_string **font_family;
+ lwc_string **quotes;
+
+ css_computed_page *page;
+ struct css_computed_style *next;
+ uint32_t count;
+ uint32_t bin;
+};
diff --git a/src/select/autogenerated_propget.h b/src/select/autogenerated_propget.h
new file mode 100644
index 0000000..202f7de
--- a/dev/null
+++ b/src/select/autogenerated_propget.h
@@ -0,0 +1,2288 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 The NetSurf Project
+ */
+
+
+#define BORDER_SPACING_INDEX 0
+#define BORDER_SPACING_SHIFT 21
+#define BORDER_SPACING_MASK 0xffe00000
+static inline uint8_t get_border_spacing(const css_computed_style *style,
+ css_fixed *length_a, css_unit *unit_a, css_fixed *length_b,
+ css_unit *unit_b)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[BORDER_SPACING_INDEX];
+ bits &= BORDER_SPACING_MASK;
+ bits >>= BORDER_SPACING_SHIFT;
+
+ /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */
+ if ((bits & 0x1) == CSS_BORDER_SPACING_SET) {
+ *length_a = style->i.uncommon->i.border_spacing_a;
+ *length_b = style->i.uncommon->i.border_spacing_b;
+ *unit_a = bits >> 6;
+ *unit_b = (bits & 0x3e) >> 1;
+ }
+
+ return (bits & 0x1);
+ }
+
+ /* Initial value */
+ *length_a = 0;
+ *unit_a = CSS_UNIT_PX;
+ *length_b = 0;
+ *unit_b = CSS_UNIT_PX;
+ return CSS_BORDER_SPACING_SET;
+}
+#undef BORDER_SPACING_INDEX
+#undef BORDER_SPACING_SHIFT
+#undef BORDER_SPACING_MASK
+
+#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) {
+ uint32_t bits = style->i.uncommon->i.bits[BREAK_AFTER_INDEX];
+ bits &= BREAK_AFTER_MASK;
+ bits >>= BREAK_AFTER_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+ }
+
+ /* Initial value */
+ return CSS_BREAK_AFTER_AUTO;
+}
+#undef BREAK_AFTER_INDEX
+#undef BREAK_AFTER_SHIFT
+#undef BREAK_AFTER_MASK
+
+#define BREAK_BEFORE_INDEX 2
+#define BREAK_BEFORE_SHIFT 2
+#define BREAK_BEFORE_MASK 0x3c
+static inline uint8_t get_break_before(const css_computed_style *style)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[BREAK_BEFORE_INDEX];
+ bits &= BREAK_BEFORE_MASK;
+ bits >>= BREAK_BEFORE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+ }
+
+ /* Initial value */
+ return CSS_BREAK_BEFORE_AUTO;
+}
+#undef BREAK_BEFORE_INDEX
+#undef BREAK_BEFORE_SHIFT
+#undef BREAK_BEFORE_MASK
+
+#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) {
+ uint32_t bits = style->i.uncommon->i.bits[BREAK_INSIDE_INDEX];
+ bits &= BREAK_INSIDE_MASK;
+ bits >>= BREAK_INSIDE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+ }
+
+ /* Initial value */
+ return CSS_BREAK_INSIDE_AUTO;
+}
+#undef BREAK_INSIDE_INDEX
+#undef BREAK_INSIDE_SHIFT
+#undef BREAK_INSIDE_MASK
+
+#define CLIP_INDEX 2
+#define CLIP_SHIFT 6
+#define CLIP_MASK 0xffffffc0
+static inline uint8_t get_clip(
+ const css_computed_style *style,
+ css_computed_clip_rect *rect)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[CLIP_INDEX];
+ bits &= CLIP_MASK;
+ bits >>= CLIP_SHIFT;
+
+ /*
+ 26bits: tt tttr rrrr bbbb blll llTR BLyy:
+ units: top | right | bottom | left
+ opcodes: top | right | bottom | left | type
+ */
+
+ if ((bits & 0x3) == CSS_CLIP_RECT) {
+ rect->left_auto = (bits & 0x4);
+ rect->bottom_auto = (bits & 0x8);
+ rect->right_auto = (bits & 0x10);
+ rect->top_auto = (bits & 0x20);
+
+ rect->top = style->i.uncommon->i.clip_a;
+ rect->tunit = bits & 0x3e00000 >> 21;
+
+ rect->right = style->i.uncommon->i.clip_b;
+ rect->runit = bits & 0x1f0000 >> 16;
+
+ rect->bottom = style->i.uncommon->i.clip_c;
+ rect->bunit = (bits & 0xf800) >> 11;
+
+ rect->left = style->i.uncommon->i.clip_d;
+ rect->lunit = (bits & 0x7c0) >> 6;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ return CSS_CLIP_AUTO;
+}
+#undef CLIP_INDEX
+#undef CLIP_SHIFT
+#undef CLIP_MASK
+
+#define COLUMN_COUNT_INDEX 2
+#define COLUMN_COUNT_SHIFT 0
+#define COLUMN_COUNT_MASK 0x3
+static inline uint8_t get_column_count(const css_computed_style *style, int32_t
+ *integer)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[COLUMN_COUNT_INDEX];
+ bits &= COLUMN_COUNT_MASK;
+ bits >>= COLUMN_COUNT_SHIFT;
+
+ /* 2bits: tt : type */
+ *integer = style->i.uncommon->i.column_count;
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *integer = 0;
+ return CSS_COLUMN_COUNT_AUTO;
+}
+#undef COLUMN_COUNT_INDEX
+#undef COLUMN_COUNT_SHIFT
+#undef COLUMN_COUNT_MASK
+
+#define COLUMN_FILL_INDEX 3
+#define COLUMN_FILL_SHIFT 12
+#define COLUMN_FILL_MASK 0x3000
+static inline uint8_t get_column_fill(const css_computed_style *style)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[COLUMN_FILL_INDEX];
+ bits &= COLUMN_FILL_MASK;
+ bits >>= COLUMN_FILL_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ return CSS_COLUMN_FILL_BALANCE;
+}
+#undef COLUMN_FILL_INDEX
+#undef COLUMN_FILL_SHIFT
+#undef COLUMN_FILL_MASK
+
+#define COLUMN_GAP_INDEX 1
+#define COLUMN_GAP_SHIFT 18
+#define COLUMN_GAP_MASK 0x1fc0000
+static inline uint8_t get_column_gap(const css_computed_style *style, css_fixed
+ *length, css_unit *unit)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[COLUMN_GAP_INDEX];
+ bits &= COLUMN_GAP_MASK;
+ bits >>= COLUMN_GAP_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_COLUMN_GAP_SET) {
+ *length = style->i.uncommon->i.column_gap;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ return CSS_COLUMN_GAP_NORMAL;
+}
+#undef COLUMN_GAP_INDEX
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_MASK
+
+#define COLUMN_RULE_COLOR_INDEX 3
+#define COLUMN_RULE_COLOR_SHIFT 18
+#define COLUMN_RULE_COLOR_MASK 0xc0000
+static inline uint8_t get_column_rule_color(const css_computed_style *style,
+ css_color *color)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[
+ COLUMN_RULE_COLOR_INDEX];
+ bits &= COLUMN_RULE_COLOR_MASK;
+ bits >>= COLUMN_RULE_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ *color = style->i.uncommon->i.column_rule_color;
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *color = 0;
+ 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 3
+#define COLUMN_RULE_STYLE_SHIFT 24
+#define COLUMN_RULE_STYLE_MASK 0xf000000
+static inline uint8_t get_column_rule_style(const css_computed_style *style)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[
+ COLUMN_RULE_STYLE_INDEX];
+ bits &= COLUMN_RULE_STYLE_MASK;
+ bits >>= COLUMN_RULE_STYLE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+ }
+
+ /* Initial value */
+ return CSS_COLUMN_RULE_STYLE_NONE;
+}
+#undef COLUMN_RULE_STYLE_INDEX
+#undef COLUMN_RULE_STYLE_SHIFT
+#undef COLUMN_RULE_STYLE_MASK
+
+#define COLUMN_RULE_WIDTH_INDEX 0
+#define COLUMN_RULE_WIDTH_SHIFT 13
+#define COLUMN_RULE_WIDTH_MASK 0x1fe000
+static inline uint8_t get_column_rule_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[
+ COLUMN_RULE_WIDTH_INDEX];
+ bits &= COLUMN_RULE_WIDTH_MASK;
+ bits >>= COLUMN_RULE_WIDTH_SHIFT;
+
+ /* 8bits: uuuuuttt : unit | type */
+ if ((bits & 0x7) == CSS_COLUMN_RULE_WIDTH_WIDTH) {
+ *length = style->i.uncommon->i.column_rule_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+ }
+
+ /* Initial value */
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ return CSS_COLUMN_RULE_WIDTH_MEDIUM;
+}
+#undef COLUMN_RULE_WIDTH_INDEX
+#undef COLUMN_RULE_WIDTH_SHIFT
+#undef COLUMN_RULE_WIDTH_MASK
+
+#define COLUMN_SPAN_INDEX 3
+#define COLUMN_SPAN_SHIFT 20
+#define COLUMN_SPAN_MASK 0x300000
+static inline uint8_t get_column_span(const css_computed_style *style)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[COLUMN_SPAN_INDEX];
+ bits &= COLUMN_SPAN_MASK;
+ bits >>= COLUMN_SPAN_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ return CSS_COLUMN_SPAN_NONE;
+}
+#undef COLUMN_SPAN_INDEX
+#undef COLUMN_SPAN_SHIFT
+#undef COLUMN_SPAN_MASK
+
+#define COLUMN_WIDTH_INDEX 1
+#define COLUMN_WIDTH_SHIFT 11
+#define COLUMN_WIDTH_MASK 0x3f800
+static inline uint8_t get_column_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[COLUMN_WIDTH_INDEX];
+ bits &= COLUMN_WIDTH_MASK;
+ bits >>= COLUMN_WIDTH_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_COLUMN_WIDTH_SET) {
+ *length = style->i.uncommon->i.column_width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ return CSS_COLUMN_WIDTH_AUTO;
+}
+#undef COLUMN_WIDTH_INDEX
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_MASK
+
+#define CONTENT_INDEX 3
+#define CONTENT_SHIFT 14
+#define CONTENT_MASK 0xc000
+static inline uint8_t get_content(const css_computed_style *style, const
+ css_computed_content_item **content_item)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[CONTENT_INDEX];
+ bits &= CONTENT_MASK;
+ bits >>= CONTENT_SHIFT;
+
+ /* 2bits: tt : type */
+ if ((bits & 0x3) == CSS_CONTENT_SET) {
+ *content_item = style->i.uncommon->content;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *content_item = NULL;
+ return CSS_CONTENT_NORMAL;
+}
+#undef CONTENT_INDEX
+#undef CONTENT_SHIFT
+#undef CONTENT_MASK
+
+#define COUNTER_INCREMENT_INDEX 3
+#define COUNTER_INCREMENT_SHIFT 11
+#define COUNTER_INCREMENT_MASK 0x800
+static inline uint8_t get_counter_increment(const css_computed_style *style,
+ const css_computed_counter **counter_arr)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[
+ COUNTER_INCREMENT_INDEX];
+ bits &= COUNTER_INCREMENT_MASK;
+ bits >>= COUNTER_INCREMENT_SHIFT;
+
+ /* 1bit: t : type */
+ *counter_arr = style->i.uncommon->counter_increment;
+
+ return (bits & 0x1);
+ }
+
+ /* Initial value */
+ *counter_arr = NULL;
+ return CSS_COUNTER_INCREMENT_NONE;
+}
+#undef COUNTER_INCREMENT_INDEX
+#undef COUNTER_INCREMENT_SHIFT
+#undef COUNTER_INCREMENT_MASK
+
+#define COUNTER_RESET_INDEX 3
+#define COUNTER_RESET_SHIFT 10
+#define COUNTER_RESET_MASK 0x400
+static inline uint8_t get_counter_reset(const css_computed_style *style, const
+ css_computed_counter **counter_arr)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[COUNTER_RESET_INDEX];
+ bits &= COUNTER_RESET_MASK;
+ bits >>= COUNTER_RESET_SHIFT;
+
+ /* 1bit: t : type */
+ *counter_arr = style->i.uncommon->counter_reset;
+
+ return (bits & 0x1);
+ }
+
+ /* Initial value */
+ *counter_arr = NULL;
+ return CSS_COUNTER_RESET_NONE;
+}
+#undef COUNTER_RESET_INDEX
+#undef COUNTER_RESET_SHIFT
+#undef COUNTER_RESET_MASK
+
+#define CURSOR_INDEX 0
+#define CURSOR_SHIFT 0
+#define CURSOR_MASK 0x1f
+static inline uint8_t get_cursor(const css_computed_style *style, lwc_string
+ ***string_arr)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[CURSOR_INDEX];
+ bits &= CURSOR_MASK;
+ bits >>= CURSOR_SHIFT;
+
+ /* 5bits: ttttt : type */
+ *string_arr = style->i.uncommon->cursor;
+
+ return (bits & 0x1f);
+ }
+
+ /* Initial value */
+ *string_arr = NULL;
+ return CSS_CURSOR_AUTO;
+}
+#undef CURSOR_INDEX
+#undef CURSOR_SHIFT
+#undef CURSOR_MASK
+
+#define LETTER_SPACING_INDEX 1
+#define LETTER_SPACING_SHIFT 25
+#define LETTER_SPACING_MASK 0xfe000000
+static inline uint8_t get_letter_spacing(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[LETTER_SPACING_INDEX];
+ bits &= LETTER_SPACING_MASK;
+ bits >>= LETTER_SPACING_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_LETTER_SPACING_SET) {
+ *length = style->i.uncommon->i.letter_spacing;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ return CSS_LETTER_SPACING_NORMAL;
+}
+#undef LETTER_SPACING_INDEX
+#undef LETTER_SPACING_SHIFT
+#undef LETTER_SPACING_MASK
+
+#define OUTLINE_COLOR_INDEX 3
+#define OUTLINE_COLOR_SHIFT 16
+#define OUTLINE_COLOR_MASK 0x30000
+static inline uint8_t get_outline_color(const css_computed_style *style,
+ css_color *color)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[OUTLINE_COLOR_INDEX];
+ bits &= OUTLINE_COLOR_MASK;
+ bits >>= OUTLINE_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ if ((bits & 0x3) == CSS_OUTLINE_COLOR_COLOR) {
+ *color = style->i.uncommon->i.outline_color;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *color = 0;
+ return CSS_OUTLINE_COLOR_INVERT;
+}
+#undef OUTLINE_COLOR_INDEX
+#undef OUTLINE_COLOR_SHIFT
+#undef OUTLINE_COLOR_MASK
+
+#define OUTLINE_WIDTH_INDEX 0
+#define OUTLINE_WIDTH_SHIFT 5
+#define OUTLINE_WIDTH_MASK 0x1fe0
+static inline uint8_t get_outline_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[OUTLINE_WIDTH_INDEX];
+ bits &= OUTLINE_WIDTH_MASK;
+ bits >>= OUTLINE_WIDTH_SHIFT;
+
+ /* 8bits: uuuuuttt : unit | type */
+ if ((bits & 0x7) == CSS_OUTLINE_WIDTH_WIDTH) {
+ *length = style->i.uncommon->i.outline_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+ }
+
+ /* Initial value */
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ return CSS_OUTLINE_WIDTH_MEDIUM;
+}
+#undef OUTLINE_WIDTH_INDEX
+#undef OUTLINE_WIDTH_SHIFT
+#undef OUTLINE_WIDTH_MASK
+
+#define WORD_SPACING_INDEX 1
+#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)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[WORD_SPACING_INDEX];
+ bits &= WORD_SPACING_MASK;
+ bits >>= WORD_SPACING_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_WORD_SPACING_SET) {
+ *length = style->i.uncommon->i.word_spacing;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ return CSS_WORD_SPACING_NORMAL;
+}
+#undef WORD_SPACING_INDEX
+#undef WORD_SPACING_SHIFT
+#undef WORD_SPACING_MASK
+
+#define WRITING_MODE_INDEX 3
+#define WRITING_MODE_SHIFT 22
+#define WRITING_MODE_MASK 0xc00000
+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
+static inline uint8_t get_orphans(const css_computed_style *style, int32_t
+ *integer)
+{
+ if (style->page != NULL) {
+ uint32_t bits = style->page->bits[ORPHANS_INDEX];
+ bits &= ORPHANS_MASK;
+ bits >>= ORPHANS_SHIFT;
+
+ /* 1bit: t : type */
+ *integer = style->page->orphans;
+
+ return (bits & 0x1);
+ }
+
+ /* Initial value */
+ *integer = 2;
+ return CSS_ORPHANS_SET;
+}
+#undef ORPHANS_INDEX
+#undef ORPHANS_SHIFT
+#undef ORPHANS_MASK
+
+#define PAGE_BREAK_AFTER_INDEX 0
+#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) {
+ uint32_t bits = style->page->bits[PAGE_BREAK_AFTER_INDEX];
+ bits &= PAGE_BREAK_AFTER_MASK;
+ bits >>= PAGE_BREAK_AFTER_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+ }
+
+ /* Initial value */
+ return CSS_PAGE_BREAK_AFTER_AUTO;
+}
+#undef PAGE_BREAK_AFTER_INDEX
+#undef PAGE_BREAK_AFTER_SHIFT
+#undef PAGE_BREAK_AFTER_MASK
+
+#define PAGE_BREAK_BEFORE_INDEX 0
+#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) {
+ uint32_t bits = style->page->bits[PAGE_BREAK_BEFORE_INDEX];
+ bits &= PAGE_BREAK_BEFORE_MASK;
+ bits >>= PAGE_BREAK_BEFORE_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+ }
+
+ /* Initial value */
+ return CSS_PAGE_BREAK_BEFORE_AUTO;
+}
+#undef PAGE_BREAK_BEFORE_INDEX
+#undef PAGE_BREAK_BEFORE_SHIFT
+#undef PAGE_BREAK_BEFORE_MASK
+
+#define PAGE_BREAK_INSIDE_INDEX 0
+#define PAGE_BREAK_INSIDE_SHIFT 24
+#define PAGE_BREAK_INSIDE_MASK 0x3000000
+static inline uint8_t get_page_break_inside(const css_computed_style *style)
+{
+ if (style->page != NULL) {
+ uint32_t bits = style->page->bits[PAGE_BREAK_INSIDE_INDEX];
+ bits &= PAGE_BREAK_INSIDE_MASK;
+ bits >>= PAGE_BREAK_INSIDE_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ return CSS_PAGE_BREAK_INSIDE_AUTO;
+}
+#undef PAGE_BREAK_INSIDE_INDEX
+#undef PAGE_BREAK_INSIDE_SHIFT
+#undef PAGE_BREAK_INSIDE_MASK
+
+#define WIDOWS_INDEX 0
+#define WIDOWS_SHIFT 23
+#define WIDOWS_MASK 0x800000
+static inline uint8_t get_widows(const css_computed_style *style, int32_t
+ *integer)
+{
+ if (style->page != NULL) {
+ uint32_t bits = style->page->bits[WIDOWS_INDEX];
+ bits &= WIDOWS_MASK;
+ bits >>= WIDOWS_SHIFT;
+
+ /* 1bit: t : type */
+ *integer = style->page->widows;
+
+ return (bits & 0x1);
+ }
+
+ /* Initial value */
+ *integer = 2;
+ return CSS_WIDOWS_SET;
+}
+#undef WIDOWS_INDEX
+#undef WIDOWS_SHIFT
+#undef WIDOWS_MASK
+
+#define ALIGN_CONTENT_INDEX 8
+#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];
+ bits &= ALIGN_CONTENT_MASK;
+ bits >>= ALIGN_CONTENT_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef ALIGN_CONTENT_INDEX
+#undef ALIGN_CONTENT_SHIFT
+#undef ALIGN_CONTENT_MASK
+
+#define ALIGN_ITEMS_INDEX 8
+#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];
+ bits &= ALIGN_ITEMS_MASK;
+ bits >>= ALIGN_ITEMS_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef ALIGN_ITEMS_INDEX
+#undef ALIGN_ITEMS_SHIFT
+#undef ALIGN_ITEMS_MASK
+
+#define ALIGN_SELF_INDEX 8
+#define ALIGN_SELF_SHIFT 20
+#define ALIGN_SELF_MASK 0x700000
+static inline uint8_t get_align_self(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[ALIGN_SELF_INDEX];
+ bits &= ALIGN_SELF_MASK;
+ bits >>= ALIGN_SELF_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef ALIGN_SELF_INDEX
+#undef ALIGN_SELF_SHIFT
+#undef ALIGN_SELF_MASK
+
+#define BACKGROUND_ATTACHMENT_INDEX 9
+#define BACKGROUND_ATTACHMENT_SHIFT 26
+#define BACKGROUND_ATTACHMENT_MASK 0xc000000
+static inline uint8_t get_background_attachment(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[BACKGROUND_ATTACHMENT_INDEX];
+ bits &= BACKGROUND_ATTACHMENT_MASK;
+ bits >>= BACKGROUND_ATTACHMENT_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef BACKGROUND_ATTACHMENT_INDEX
+#undef BACKGROUND_ATTACHMENT_SHIFT
+#undef BACKGROUND_ATTACHMENT_MASK
+
+#define BACKGROUND_COLOR_INDEX 7
+#define BACKGROUND_COLOR_SHIFT 0
+#define BACKGROUND_COLOR_MASK 0x3
+static inline uint8_t get_background_color(const css_computed_style *style,
+ css_color *color)
+{
+ uint32_t bits = style->i.bits[BACKGROUND_COLOR_INDEX];
+ bits &= BACKGROUND_COLOR_MASK;
+ bits >>= BACKGROUND_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ *color = style->i.background_color;
+
+ return (bits & 0x3);
+}
+#undef BACKGROUND_COLOR_INDEX
+#undef BACKGROUND_COLOR_SHIFT
+#undef BACKGROUND_COLOR_MASK
+
+#define BACKGROUND_IMAGE_INDEX 10
+#define BACKGROUND_IMAGE_SHIFT 27
+#define BACKGROUND_IMAGE_MASK 0x8000000
+static inline uint8_t get_background_image(const css_computed_style *style,
+ lwc_string **string)
+{
+ uint32_t bits = style->i.bits[BACKGROUND_IMAGE_INDEX];
+ bits &= BACKGROUND_IMAGE_MASK;
+ bits >>= BACKGROUND_IMAGE_SHIFT;
+
+ /* 1bit: t : type */
+ *string = style->i.background_image;
+
+ return (bits & 0x1);
+}
+#undef BACKGROUND_IMAGE_INDEX
+#undef BACKGROUND_IMAGE_SHIFT
+#undef BACKGROUND_IMAGE_MASK
+
+#define BACKGROUND_POSITION_INDEX 5
+#define BACKGROUND_POSITION_SHIFT 21
+#define BACKGROUND_POSITION_MASK 0xffe00000
+static inline uint8_t get_background_position(const css_computed_style *style,
+ 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];
+ bits &= BACKGROUND_POSITION_MASK;
+ bits >>= BACKGROUND_POSITION_SHIFT;
+
+ /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */
+ if ((bits & 0x1) == CSS_BACKGROUND_POSITION_SET) {
+ *length_a = style->i.background_position_a;
+ *length_b = style->i.background_position_b;
+ *unit_a = bits >> 6;
+ *unit_b = (bits & 0x3e) >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef BACKGROUND_POSITION_INDEX
+#undef BACKGROUND_POSITION_SHIFT
+#undef BACKGROUND_POSITION_MASK
+
+#define BACKGROUND_REPEAT_INDEX 6
+#define BACKGROUND_REPEAT_SHIFT 3
+#define BACKGROUND_REPEAT_MASK 0x38
+static inline uint8_t get_background_repeat(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[BACKGROUND_REPEAT_INDEX];
+ bits &= BACKGROUND_REPEAT_MASK;
+ bits >>= BACKGROUND_REPEAT_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef BACKGROUND_REPEAT_INDEX
+#undef BACKGROUND_REPEAT_SHIFT
+#undef BACKGROUND_REPEAT_MASK
+
+#define BORDER_BOTTOM_COLOR_INDEX 9
+#define BORDER_BOTTOM_COLOR_SHIFT 8
+#define BORDER_BOTTOM_COLOR_MASK 0x300
+static inline uint8_t get_border_bottom_color(const css_computed_style *style,
+ css_color *color)
+{
+ uint32_t bits = style->i.bits[BORDER_BOTTOM_COLOR_INDEX];
+ bits &= BORDER_BOTTOM_COLOR_MASK;
+ bits >>= BORDER_BOTTOM_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ *color = style->i.border_bottom_color;
+
+ return (bits & 0x3);
+}
+#undef BORDER_BOTTOM_COLOR_INDEX
+#undef BORDER_BOTTOM_COLOR_SHIFT
+#undef BORDER_BOTTOM_COLOR_MASK
+
+#define BORDER_BOTTOM_STYLE_INDEX 6
+#define BORDER_BOTTOM_STYLE_SHIFT 18
+#define BORDER_BOTTOM_STYLE_MASK 0x3c0000
+static inline uint8_t get_border_bottom_style(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
+ bits &= BORDER_BOTTOM_STYLE_MASK;
+ bits >>= BORDER_BOTTOM_STYLE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef BORDER_BOTTOM_STYLE_INDEX
+#undef BORDER_BOTTOM_STYLE_SHIFT
+#undef BORDER_BOTTOM_STYLE_MASK
+
+#define BORDER_BOTTOM_WIDTH_INDEX 0
+#define BORDER_BOTTOM_WIDTH_SHIFT 24
+#define BORDER_BOTTOM_WIDTH_MASK 0xff000000
+static inline uint8_t get_border_bottom_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[BORDER_BOTTOM_WIDTH_INDEX];
+ bits &= BORDER_BOTTOM_WIDTH_MASK;
+ bits >>= BORDER_BOTTOM_WIDTH_SHIFT;
+
+ /* 8bits: uuuuuttt : unit | type */
+ if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
+ *length = style->i.border_bottom_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+}
+#undef BORDER_BOTTOM_WIDTH_INDEX
+#undef BORDER_BOTTOM_WIDTH_SHIFT
+#undef BORDER_BOTTOM_WIDTH_MASK
+
+#define BORDER_COLLAPSE_INDEX 10
+#define BORDER_COLLAPSE_SHIFT 28
+#define BORDER_COLLAPSE_MASK 0x30000000
+static inline uint8_t get_border_collapse(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[BORDER_COLLAPSE_INDEX];
+ bits &= BORDER_COLLAPSE_MASK;
+ bits >>= BORDER_COLLAPSE_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef BORDER_COLLAPSE_INDEX
+#undef BORDER_COLLAPSE_SHIFT
+#undef BORDER_COLLAPSE_MASK
+
+#define BORDER_LEFT_COLOR_INDEX 10
+#define BORDER_LEFT_COLOR_SHIFT 30
+#define BORDER_LEFT_COLOR_MASK 0xc0000000
+static inline uint8_t get_border_left_color(const css_computed_style *style,
+ css_color *color)
+{
+ uint32_t bits = style->i.bits[BORDER_LEFT_COLOR_INDEX];
+ bits &= BORDER_LEFT_COLOR_MASK;
+ bits >>= BORDER_LEFT_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ *color = style->i.border_left_color;
+
+ return (bits & 0x3);
+}
+#undef BORDER_LEFT_COLOR_INDEX
+#undef BORDER_LEFT_COLOR_SHIFT
+#undef BORDER_LEFT_COLOR_MASK
+
+#define BORDER_LEFT_STYLE_INDEX 6
+#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];
+ bits &= BORDER_LEFT_STYLE_MASK;
+ bits >>= BORDER_LEFT_STYLE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef BORDER_LEFT_STYLE_INDEX
+#undef BORDER_LEFT_STYLE_SHIFT
+#undef BORDER_LEFT_STYLE_MASK
+
+#define BORDER_LEFT_WIDTH_INDEX 0
+#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)
+{
+ uint32_t bits = style->i.bits[BORDER_LEFT_WIDTH_INDEX];
+ bits &= BORDER_LEFT_WIDTH_MASK;
+ bits >>= BORDER_LEFT_WIDTH_SHIFT;
+
+ /* 8bits: uuuuuttt : unit | type */
+ if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
+ *length = style->i.border_left_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+}
+#undef BORDER_LEFT_WIDTH_INDEX
+#undef BORDER_LEFT_WIDTH_SHIFT
+#undef BORDER_LEFT_WIDTH_MASK
+
+#define BORDER_RIGHT_COLOR_INDEX 9
+#define BORDER_RIGHT_COLOR_SHIFT 28
+#define BORDER_RIGHT_COLOR_MASK 0x30000000
+static inline uint8_t get_border_right_color(const css_computed_style *style,
+ css_color *color)
+{
+ uint32_t bits = style->i.bits[BORDER_RIGHT_COLOR_INDEX];
+ bits &= BORDER_RIGHT_COLOR_MASK;
+ bits >>= BORDER_RIGHT_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ *color = style->i.border_right_color;
+
+ return (bits & 0x3);
+}
+#undef BORDER_RIGHT_COLOR_INDEX
+#undef BORDER_RIGHT_COLOR_SHIFT
+#undef BORDER_RIGHT_COLOR_MASK
+
+#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)
+{
+ uint32_t bits = style->i.bits[BORDER_RIGHT_STYLE_INDEX];
+ bits &= BORDER_RIGHT_STYLE_MASK;
+ bits >>= BORDER_RIGHT_STYLE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef BORDER_RIGHT_STYLE_INDEX
+#undef BORDER_RIGHT_STYLE_SHIFT
+#undef BORDER_RIGHT_STYLE_MASK
+
+#define BORDER_RIGHT_WIDTH_INDEX 0
+#define BORDER_RIGHT_WIDTH_SHIFT 0
+#define BORDER_RIGHT_WIDTH_MASK 0xff
+static inline uint8_t get_border_right_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[BORDER_RIGHT_WIDTH_INDEX];
+ bits &= BORDER_RIGHT_WIDTH_MASK;
+ bits >>= BORDER_RIGHT_WIDTH_SHIFT;
+
+ /* 8bits: uuuuuttt : unit | type */
+ if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
+ *length = style->i.border_right_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+}
+#undef BORDER_RIGHT_WIDTH_INDEX
+#undef BORDER_RIGHT_WIDTH_SHIFT
+#undef BORDER_RIGHT_WIDTH_MASK
+
+#define BORDER_TOP_COLOR_INDEX 9
+#define BORDER_TOP_COLOR_SHIFT 16
+#define BORDER_TOP_COLOR_MASK 0x30000
+static inline uint8_t get_border_top_color(const css_computed_style *style,
+ css_color *color)
+{
+ uint32_t bits = style->i.bits[BORDER_TOP_COLOR_INDEX];
+ bits &= BORDER_TOP_COLOR_MASK;
+ bits >>= BORDER_TOP_COLOR_SHIFT;
+
+ /* 2bits: tt : type */
+ *color = style->i.border_top_color;
+
+ return (bits & 0x3);
+}
+#undef BORDER_TOP_COLOR_INDEX
+#undef BORDER_TOP_COLOR_SHIFT
+#undef BORDER_TOP_COLOR_MASK
+
+#define BORDER_TOP_STYLE_INDEX 1
+#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];
+ bits &= BORDER_TOP_STYLE_MASK;
+ bits >>= BORDER_TOP_STYLE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef BORDER_TOP_STYLE_INDEX
+#undef BORDER_TOP_STYLE_SHIFT
+#undef BORDER_TOP_STYLE_MASK
+
+#define BORDER_TOP_WIDTH_INDEX 0
+#define BORDER_TOP_WIDTH_SHIFT 8
+#define BORDER_TOP_WIDTH_MASK 0xff00
+static inline uint8_t get_border_top_width(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[BORDER_TOP_WIDTH_INDEX];
+ bits &= BORDER_TOP_WIDTH_MASK;
+ bits >>= BORDER_TOP_WIDTH_SHIFT;
+
+ /* 8bits: uuuuuttt : unit | type */
+ if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
+ *length = style->i.border_top_width;
+ *unit = bits >> 3;
+ }
+
+ return (bits & 0x7);
+}
+#undef BORDER_TOP_WIDTH_INDEX
+#undef BORDER_TOP_WIDTH_SHIFT
+#undef BORDER_TOP_WIDTH_MASK
+
+#define BOTTOM_INDEX 3
+#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)
+{
+ uint32_t bits = style->i.bits[BOTTOM_INDEX];
+ bits &= BOTTOM_MASK;
+ bits >>= BOTTOM_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_BOTTOM_SET) {
+ *length = style->i.bottom;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+static inline uint8_t get_bottom_bits(
+ const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[BOTTOM_INDEX];
+ bits &= BOTTOM_MASK;
+ bits >>= BOTTOM_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ return bits;
+}
+#undef BOTTOM_INDEX
+#undef BOTTOM_SHIFT
+#undef BOTTOM_MASK
+
+#define BOX_SIZING_INDEX 9
+#define BOX_SIZING_SHIFT 2
+#define BOX_SIZING_MASK 0xc
+static inline uint8_t get_box_sizing(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[BOX_SIZING_INDEX];
+ bits &= BOX_SIZING_MASK;
+ bits >>= BOX_SIZING_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef BOX_SIZING_INDEX
+#undef BOX_SIZING_SHIFT
+#undef BOX_SIZING_MASK
+
+#define CAPTION_SIDE_INDEX 9
+#define CAPTION_SIDE_SHIFT 10
+#define CAPTION_SIDE_MASK 0xc00
+static inline uint8_t get_caption_side(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[CAPTION_SIDE_INDEX];
+ bits &= CAPTION_SIDE_MASK;
+ bits >>= CAPTION_SIDE_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef CAPTION_SIDE_INDEX
+#undef CAPTION_SIDE_SHIFT
+#undef CAPTION_SIDE_MASK
+
+#define CLEAR_INDEX 8
+#define CLEAR_SHIFT 11
+#define CLEAR_MASK 0x3800
+static inline uint8_t get_clear(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[CLEAR_INDEX];
+ bits &= CLEAR_MASK;
+ bits >>= CLEAR_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef CLEAR_INDEX
+#undef CLEAR_SHIFT
+#undef CLEAR_MASK
+
+#define COLOR_INDEX 10
+#define COLOR_SHIFT 26
+#define COLOR_MASK 0x4000000
+static inline uint8_t get_color(const css_computed_style *style, css_color
+ *color)
+{
+ uint32_t bits = style->i.bits[COLOR_INDEX];
+ bits &= COLOR_MASK;
+ bits >>= COLOR_SHIFT;
+
+ /* 1bit: t : type */
+ *color = style->i.color;
+
+ return (bits & 0x1);
+}
+#undef COLOR_INDEX
+#undef COLOR_SHIFT
+#undef COLOR_MASK
+
+#define DIRECTION_INDEX 8
+#define DIRECTION_SHIFT 0
+#define DIRECTION_MASK 0x3
+static inline uint8_t get_direction(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[DIRECTION_INDEX];
+ bits &= DIRECTION_MASK;
+ bits >>= DIRECTION_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef DIRECTION_INDEX
+#undef DIRECTION_SHIFT
+#undef DIRECTION_MASK
+
+#define DISPLAY_INDEX 6
+#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];
+ bits &= DISPLAY_MASK;
+ bits >>= DISPLAY_SHIFT;
+
+ /* 5bits: ttttt : type */
+
+ return (bits & 0x1f);
+}
+#undef DISPLAY_INDEX
+#undef DISPLAY_SHIFT
+#undef DISPLAY_MASK
+
+#define EMPTY_CELLS_INDEX 9
+#define EMPTY_CELLS_SHIFT 12
+#define EMPTY_CELLS_MASK 0x3000
+static inline uint8_t get_empty_cells(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[EMPTY_CELLS_INDEX];
+ bits &= EMPTY_CELLS_MASK;
+ bits >>= EMPTY_CELLS_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef EMPTY_CELLS_INDEX
+#undef EMPTY_CELLS_SHIFT
+#undef EMPTY_CELLS_MASK
+
+#define FLEX_BASIS_INDEX 1
+#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)
+{
+ uint32_t bits = style->i.bits[FLEX_BASIS_INDEX];
+ bits &= FLEX_BASIS_MASK;
+ bits >>= FLEX_BASIS_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_FLEX_BASIS_SET) {
+ *length = style->i.flex_basis;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef FLEX_BASIS_INDEX
+#undef FLEX_BASIS_SHIFT
+#undef FLEX_BASIS_MASK
+
+#define FLEX_DIRECTION_INDEX 6
+#define FLEX_DIRECTION_SHIFT 0
+#define FLEX_DIRECTION_MASK 0x7
+static inline uint8_t get_flex_direction(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[FLEX_DIRECTION_INDEX];
+ bits &= FLEX_DIRECTION_MASK;
+ bits >>= FLEX_DIRECTION_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef FLEX_DIRECTION_INDEX
+#undef FLEX_DIRECTION_SHIFT
+#undef FLEX_DIRECTION_MASK
+
+#define FLEX_GROW_INDEX 10
+#define FLEX_GROW_SHIFT 23
+#define FLEX_GROW_MASK 0x800000
+static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed
+ *fixed)
+{
+ uint32_t bits = style->i.bits[FLEX_GROW_INDEX];
+ bits &= FLEX_GROW_MASK;
+ bits >>= FLEX_GROW_SHIFT;
+
+ /* 1bit: t : type */
+ if ((bits & 0x1) == CSS_FLEX_GROW_SET) {
+ *fixed = style->i.flex_grow;
+ }
+
+ return (bits & 0x1);
+}
+#undef FLEX_GROW_INDEX
+#undef FLEX_GROW_SHIFT
+#undef FLEX_GROW_MASK
+
+#define FLEX_SHRINK_INDEX 10
+#define FLEX_SHRINK_SHIFT 20
+#define FLEX_SHRINK_MASK 0x100000
+static inline uint8_t get_flex_shrink(const css_computed_style *style,
+ css_fixed *fixed)
+{
+ uint32_t bits = style->i.bits[FLEX_SHRINK_INDEX];
+ bits &= FLEX_SHRINK_MASK;
+ bits >>= FLEX_SHRINK_SHIFT;
+
+ /* 1bit: t : type */
+ if ((bits & 0x1) == CSS_FLEX_SHRINK_SET) {
+ *fixed = style->i.flex_shrink;
+ }
+
+ return (bits & 0x1);
+}
+#undef FLEX_SHRINK_INDEX
+#undef FLEX_SHRINK_SHIFT
+#undef FLEX_SHRINK_MASK
+
+#define FLEX_WRAP_INDEX 9
+#define FLEX_WRAP_SHIFT 20
+#define FLEX_WRAP_MASK 0x300000
+static inline uint8_t get_flex_wrap(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[FLEX_WRAP_INDEX];
+ bits &= FLEX_WRAP_MASK;
+ bits >>= FLEX_WRAP_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef FLEX_WRAP_INDEX
+#undef FLEX_WRAP_SHIFT
+#undef FLEX_WRAP_MASK
+
+#define FLOAT_INDEX 9
+#define FLOAT_SHIFT 14
+#define FLOAT_MASK 0xc000
+static inline uint8_t get_float(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[FLOAT_INDEX];
+ bits &= FLOAT_MASK;
+ bits >>= FLOAT_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef FLOAT_INDEX
+#undef FLOAT_SHIFT
+#undef FLOAT_MASK
+
+#define FONT_FAMILY_INDEX 8
+#define FONT_FAMILY_SHIFT 26
+#define FONT_FAMILY_MASK 0x1c000000
+static inline uint8_t get_font_family(const css_computed_style *style,
+ lwc_string ***string_arr)
+{
+ uint32_t bits = style->i.bits[FONT_FAMILY_INDEX];
+ bits &= FONT_FAMILY_MASK;
+ bits >>= FONT_FAMILY_SHIFT;
+
+ /* 3bits: ttt : type */
+ *string_arr = style->font_family;
+
+ return (bits & 0x7);
+}
+#undef FONT_FAMILY_INDEX
+#undef FONT_FAMILY_SHIFT
+#undef FONT_FAMILY_MASK
+
+#define FONT_SIZE_INDEX 5
+#define FONT_SIZE_SHIFT 3
+#define FONT_SIZE_MASK 0xff8
+static inline uint8_t get_font_size(const css_computed_style *style, css_fixed
+ *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[FONT_SIZE_INDEX];
+ bits &= FONT_SIZE_MASK;
+ bits >>= FONT_SIZE_SHIFT;
+
+ /* 9bits: uuuuutttt : unit | type */
+ if ((bits & 0xf) == CSS_FONT_SIZE_DIMENSION) {
+ *length = style->i.font_size;
+ *unit = bits >> 4;
+ }
+
+ return (bits & 0xf);
+}
+#undef FONT_SIZE_INDEX
+#undef FONT_SIZE_SHIFT
+#undef FONT_SIZE_MASK
+
+#define FONT_STYLE_INDEX 9
+#define FONT_STYLE_SHIFT 22
+#define FONT_STYLE_MASK 0xc00000
+static inline uint8_t get_font_style(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[FONT_STYLE_INDEX];
+ bits &= FONT_STYLE_MASK;
+ bits >>= FONT_STYLE_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef FONT_STYLE_INDEX
+#undef FONT_STYLE_SHIFT
+#undef FONT_STYLE_MASK
+
+#define FONT_VARIANT_INDEX 9
+#define FONT_VARIANT_SHIFT 6
+#define FONT_VARIANT_MASK 0xc0
+static inline uint8_t get_font_variant(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[FONT_VARIANT_INDEX];
+ bits &= FONT_VARIANT_MASK;
+ bits >>= FONT_VARIANT_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef FONT_VARIANT_INDEX
+#undef FONT_VARIANT_SHIFT
+#undef FONT_VARIANT_MASK
+
+#define FONT_WEIGHT_INDEX 4
+#define FONT_WEIGHT_SHIFT 0
+#define FONT_WEIGHT_MASK 0xf
+static inline uint8_t get_font_weight(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[FONT_WEIGHT_INDEX];
+ bits &= FONT_WEIGHT_MASK;
+ bits >>= FONT_WEIGHT_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef FONT_WEIGHT_INDEX
+#undef FONT_WEIGHT_SHIFT
+#undef FONT_WEIGHT_MASK
+
+#define HEIGHT_INDEX 2
+#define HEIGHT_SHIFT 4
+#define HEIGHT_MASK 0x7f0
+static inline uint8_t get_height(const css_computed_style *style, css_fixed
+ *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[HEIGHT_INDEX];
+ bits &= HEIGHT_MASK;
+ bits >>= HEIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_HEIGHT_SET) {
+ *length = style->i.height;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef HEIGHT_INDEX
+#undef HEIGHT_SHIFT
+#undef HEIGHT_MASK
+
+#define JUSTIFY_CONTENT_INDEX 8
+#define JUSTIFY_CONTENT_SHIFT 5
+#define JUSTIFY_CONTENT_MASK 0xe0
+static inline uint8_t get_justify_content(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[JUSTIFY_CONTENT_INDEX];
+ bits &= JUSTIFY_CONTENT_MASK;
+ bits >>= JUSTIFY_CONTENT_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef JUSTIFY_CONTENT_INDEX
+#undef JUSTIFY_CONTENT_SHIFT
+#undef JUSTIFY_CONTENT_MASK
+
+#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)
+{
+ uint32_t bits = style->i.bits[LEFT_INDEX];
+ bits &= LEFT_MASK;
+ bits >>= LEFT_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_LEFT_SET) {
+ *length = style->i.left;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+static inline uint8_t get_left_bits(
+ const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[LEFT_INDEX];
+ bits &= LEFT_MASK;
+ bits >>= LEFT_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ return bits;
+}
+#undef LEFT_INDEX
+#undef LEFT_SHIFT
+#undef LEFT_MASK
+
+#define LINE_HEIGHT_INDEX 2
+#define LINE_HEIGHT_SHIFT 11
+#define LINE_HEIGHT_MASK 0x3f800
+static inline uint8_t get_line_height(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[LINE_HEIGHT_INDEX];
+ bits &= LINE_HEIGHT_MASK;
+ bits >>= LINE_HEIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
+ (bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
+ *length = style->i.line_height;
+ }
+
+ if ((bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef LINE_HEIGHT_INDEX
+#undef LINE_HEIGHT_SHIFT
+#undef LINE_HEIGHT_MASK
+
+#define LIST_STYLE_IMAGE_INDEX 10
+#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)
+{
+ uint32_t bits = style->i.bits[LIST_STYLE_IMAGE_INDEX];
+ bits &= LIST_STYLE_IMAGE_MASK;
+ bits >>= LIST_STYLE_IMAGE_SHIFT;
+
+ /* 1bit: t : type */
+ *string = style->i.list_style_image;
+
+ return (bits & 0x1);
+}
+#undef LIST_STYLE_IMAGE_INDEX
+#undef LIST_STYLE_IMAGE_SHIFT
+#undef LIST_STYLE_IMAGE_MASK
+
+#define LIST_STYLE_POSITION_INDEX 9
+#define LIST_STYLE_POSITION_SHIFT 0
+#define LIST_STYLE_POSITION_MASK 0x3
+static inline uint8_t get_list_style_position(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[LIST_STYLE_POSITION_INDEX];
+ bits &= LIST_STYLE_POSITION_MASK;
+ bits >>= LIST_STYLE_POSITION_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef LIST_STYLE_POSITION_INDEX
+#undef LIST_STYLE_POSITION_SHIFT
+#undef LIST_STYLE_POSITION_MASK
+
+#define LIST_STYLE_TYPE_INDEX 3
+#define LIST_STYLE_TYPE_SHIFT 0
+#define LIST_STYLE_TYPE_MASK 0xf
+static inline uint8_t get_list_style_type(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[LIST_STYLE_TYPE_INDEX];
+ bits &= LIST_STYLE_TYPE_MASK;
+ bits >>= LIST_STYLE_TYPE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef LIST_STYLE_TYPE_INDEX
+#undef LIST_STYLE_TYPE_SHIFT
+#undef LIST_STYLE_TYPE_MASK
+
+#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,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[MARGIN_BOTTOM_INDEX];
+ bits &= MARGIN_BOTTOM_MASK;
+ bits >>= MARGIN_BOTTOM_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MARGIN_SET) {
+ *length = style->i.margin_bottom;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MARGIN_BOTTOM_INDEX
+#undef MARGIN_BOTTOM_SHIFT
+#undef MARGIN_BOTTOM_MASK
+
+#define MARGIN_LEFT_INDEX 4
+#define MARGIN_LEFT_SHIFT 4
+#define MARGIN_LEFT_MASK 0x7f0
+static inline uint8_t get_margin_left(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[MARGIN_LEFT_INDEX];
+ bits &= MARGIN_LEFT_MASK;
+ bits >>= MARGIN_LEFT_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MARGIN_SET) {
+ *length = style->i.margin_left;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MARGIN_LEFT_INDEX
+#undef MARGIN_LEFT_SHIFT
+#undef MARGIN_LEFT_MASK
+
+#define MARGIN_RIGHT_INDEX 1
+#define MARGIN_RIGHT_SHIFT 25
+#define MARGIN_RIGHT_MASK 0xfe000000
+static inline uint8_t get_margin_right(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[MARGIN_RIGHT_INDEX];
+ bits &= MARGIN_RIGHT_MASK;
+ bits >>= MARGIN_RIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MARGIN_SET) {
+ *length = style->i.margin_right;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MARGIN_RIGHT_INDEX
+#undef MARGIN_RIGHT_SHIFT
+#undef MARGIN_RIGHT_MASK
+
+#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)
+{
+ uint32_t bits = style->i.bits[MARGIN_TOP_INDEX];
+ bits &= MARGIN_TOP_MASK;
+ bits >>= MARGIN_TOP_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MARGIN_SET) {
+ *length = style->i.margin_top;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MARGIN_TOP_INDEX
+#undef MARGIN_TOP_SHIFT
+#undef MARGIN_TOP_MASK
+
+#define MAX_HEIGHT_INDEX 3
+#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)
+{
+ uint32_t bits = style->i.bits[MAX_HEIGHT_INDEX];
+ bits &= MAX_HEIGHT_MASK;
+ bits >>= MAX_HEIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MAX_HEIGHT_SET) {
+ *length = style->i.max_height;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MAX_HEIGHT_INDEX
+#undef MAX_HEIGHT_SHIFT
+#undef MAX_HEIGHT_MASK
+
+#define MAX_WIDTH_INDEX 1
+#define MAX_WIDTH_SHIFT 18
+#define MAX_WIDTH_MASK 0x1fc0000
+static inline uint8_t get_max_width(const css_computed_style *style, css_fixed
+ *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[MAX_WIDTH_INDEX];
+ bits &= MAX_WIDTH_MASK;
+ bits >>= MAX_WIDTH_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MAX_WIDTH_SET) {
+ *length = style->i.max_width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MAX_WIDTH_INDEX
+#undef MAX_WIDTH_SHIFT
+#undef MAX_WIDTH_MASK
+
+#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
+ *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[MIN_HEIGHT_INDEX];
+ bits &= MIN_HEIGHT_MASK;
+ bits >>= MIN_HEIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MIN_HEIGHT_SET) {
+ *length = style->i.min_height;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MIN_HEIGHT_INDEX
+#undef MIN_HEIGHT_SHIFT
+#undef MIN_HEIGHT_MASK
+
+#define MIN_WIDTH_INDEX 2
+#define MIN_WIDTH_SHIFT 18
+#define MIN_WIDTH_MASK 0x1fc0000
+static inline uint8_t get_min_width(const css_computed_style *style, css_fixed
+ *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[MIN_WIDTH_INDEX];
+ bits &= MIN_WIDTH_MASK;
+ bits >>= MIN_WIDTH_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_MIN_WIDTH_SET) {
+ *length = style->i.min_width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef MIN_WIDTH_INDEX
+#undef MIN_WIDTH_SHIFT
+#undef MIN_WIDTH_MASK
+
+#define OPACITY_INDEX 10
+#define OPACITY_SHIFT 21
+#define OPACITY_MASK 0x200000
+static inline uint8_t get_opacity(const css_computed_style *style, css_fixed
+ *fixed)
+{
+ uint32_t bits = style->i.bits[OPACITY_INDEX];
+ bits &= OPACITY_MASK;
+ bits >>= OPACITY_SHIFT;
+
+ /* 1bit: t : type */
+ if ((bits & 0x1) == CSS_OPACITY_SET) {
+ *fixed = style->i.opacity;
+ }
+
+ return (bits & 0x1);
+}
+#undef OPACITY_INDEX
+#undef OPACITY_SHIFT
+#undef OPACITY_MASK
+
+#define ORDER_INDEX 10
+#define ORDER_SHIFT 22
+#define ORDER_MASK 0x400000
+static inline uint8_t get_order(const css_computed_style *style, int32_t
+ *integer)
+{
+ uint32_t bits = style->i.bits[ORDER_INDEX];
+ bits &= ORDER_MASK;
+ bits >>= ORDER_SHIFT;
+
+ /* 1bit: t : type */
+ if ((bits & 0x1) == CSS_ORDER_SET) {
+ *integer = style->i.order;
+ }
+
+ return (bits & 0x1);
+}
+#undef ORDER_INDEX
+#undef ORDER_SHIFT
+#undef ORDER_MASK
+
+#define OUTLINE_STYLE_INDEX 6
+#define OUTLINE_STYLE_SHIFT 6
+#define OUTLINE_STYLE_MASK 0x3c0
+static inline uint8_t get_outline_style(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[OUTLINE_STYLE_INDEX];
+ bits &= OUTLINE_STYLE_MASK;
+ bits >>= OUTLINE_STYLE_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef OUTLINE_STYLE_INDEX
+#undef OUTLINE_STYLE_SHIFT
+#undef OUTLINE_STYLE_MASK
+
+#define OVERFLOW_X_INDEX 8
+#define OVERFLOW_X_SHIFT 2
+#define OVERFLOW_X_MASK 0x1c
+static inline uint8_t get_overflow_x(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[OVERFLOW_X_INDEX];
+ bits &= OVERFLOW_X_MASK;
+ bits >>= OVERFLOW_X_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef OVERFLOW_X_INDEX
+#undef OVERFLOW_X_SHIFT
+#undef OVERFLOW_X_MASK
+
+#define OVERFLOW_Y_INDEX 8
+#define OVERFLOW_Y_SHIFT 23
+#define OVERFLOW_Y_MASK 0x3800000
+static inline uint8_t get_overflow_y(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[OVERFLOW_Y_INDEX];
+ bits &= OVERFLOW_Y_MASK;
+ bits >>= OVERFLOW_Y_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef OVERFLOW_Y_INDEX
+#undef OVERFLOW_Y_SHIFT
+#undef OVERFLOW_Y_MASK
+
+#define PADDING_BOTTOM_INDEX 7
+#define PADDING_BOTTOM_SHIFT 2
+#define PADDING_BOTTOM_MASK 0xfc
+static inline uint8_t get_padding_bottom(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[PADDING_BOTTOM_INDEX];
+ bits &= PADDING_BOTTOM_MASK;
+ bits >>= PADDING_BOTTOM_SHIFT;
+
+ /* 6bits: uuuuut : unit | type */
+ if ((bits & 0x1) == CSS_PADDING_SET) {
+ *length = style->i.padding_bottom;
+ *unit = bits >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef PADDING_BOTTOM_INDEX
+#undef PADDING_BOTTOM_SHIFT
+#undef PADDING_BOTTOM_MASK
+
+#define PADDING_LEFT_INDEX 7
+#define PADDING_LEFT_SHIFT 20
+#define PADDING_LEFT_MASK 0x3f00000
+static inline uint8_t get_padding_left(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[PADDING_LEFT_INDEX];
+ bits &= PADDING_LEFT_MASK;
+ bits >>= PADDING_LEFT_SHIFT;
+
+ /* 6bits: uuuuut : unit | type */
+ if ((bits & 0x1) == CSS_PADDING_SET) {
+ *length = style->i.padding_left;
+ *unit = bits >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef PADDING_LEFT_INDEX
+#undef PADDING_LEFT_SHIFT
+#undef PADDING_LEFT_MASK
+
+#define PADDING_RIGHT_INDEX 7
+#define PADDING_RIGHT_SHIFT 14
+#define PADDING_RIGHT_MASK 0xfc000
+static inline uint8_t get_padding_right(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[PADDING_RIGHT_INDEX];
+ bits &= PADDING_RIGHT_MASK;
+ bits >>= PADDING_RIGHT_SHIFT;
+
+ /* 6bits: uuuuut : unit | type */
+ if ((bits & 0x1) == CSS_PADDING_SET) {
+ *length = style->i.padding_right;
+ *unit = bits >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef PADDING_RIGHT_INDEX
+#undef PADDING_RIGHT_SHIFT
+#undef PADDING_RIGHT_MASK
+
+#define PADDING_TOP_INDEX 7
+#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)
+{
+ uint32_t bits = style->i.bits[PADDING_TOP_INDEX];
+ bits &= PADDING_TOP_MASK;
+ bits >>= PADDING_TOP_SHIFT;
+
+ /* 6bits: uuuuut : unit | type */
+ if ((bits & 0x1) == CSS_PADDING_SET) {
+ *length = style->i.padding_top;
+ *unit = bits >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef PADDING_TOP_INDEX
+#undef PADDING_TOP_SHIFT
+#undef PADDING_TOP_MASK
+
+#define POSITION_INDEX 8
+#define POSITION_SHIFT 14
+#define POSITION_MASK 0x1c000
+static inline uint8_t get_position(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[POSITION_INDEX];
+ bits &= POSITION_MASK;
+ bits >>= POSITION_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef POSITION_INDEX
+#undef POSITION_SHIFT
+#undef POSITION_MASK
+
+#define QUOTES_INDEX 10
+#define QUOTES_SHIFT 24
+#define QUOTES_MASK 0x1000000
+static inline uint8_t get_quotes(const css_computed_style *style, lwc_string
+ ***string_arr)
+{
+ uint32_t bits = style->i.bits[QUOTES_INDEX];
+ bits &= QUOTES_MASK;
+ bits >>= QUOTES_SHIFT;
+
+ /* 1bit: t : type */
+ *string_arr = style->quotes;
+
+ return (bits & 0x1);
+}
+#undef QUOTES_INDEX
+#undef QUOTES_SHIFT
+#undef QUOTES_MASK
+
+#define RIGHT_INDEX 4
+#define RIGHT_SHIFT 25
+#define RIGHT_MASK 0xfe000000
+static inline uint8_t get_right(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[RIGHT_INDEX];
+ bits &= RIGHT_MASK;
+ bits >>= RIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_RIGHT_SET) {
+ *length = style->i.right;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+static inline uint8_t get_right_bits(
+ const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[RIGHT_INDEX];
+ bits &= RIGHT_MASK;
+ bits >>= RIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ return bits;
+}
+#undef RIGHT_INDEX
+#undef RIGHT_SHIFT
+#undef RIGHT_MASK
+
+#define TABLE_LAYOUT_INDEX 9
+#define TABLE_LAYOUT_SHIFT 30
+#define TABLE_LAYOUT_MASK 0xc0000000
+static inline uint8_t get_table_layout(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[TABLE_LAYOUT_INDEX];
+ bits &= TABLE_LAYOUT_MASK;
+ bits >>= TABLE_LAYOUT_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef TABLE_LAYOUT_INDEX
+#undef TABLE_LAYOUT_SHIFT
+#undef TABLE_LAYOUT_MASK
+
+#define TEXT_ALIGN_INDEX 6
+#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];
+ bits &= TEXT_ALIGN_MASK;
+ bits >>= TEXT_ALIGN_SHIFT;
+
+ /* 4bits: tttt : type */
+
+ return (bits & 0xf);
+}
+#undef TEXT_ALIGN_INDEX
+#undef TEXT_ALIGN_SHIFT
+#undef TEXT_ALIGN_MASK
+
+#define TEXT_DECORATION_INDEX 6
+#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];
+ bits &= TEXT_DECORATION_MASK;
+ bits >>= TEXT_DECORATION_SHIFT;
+
+ /* 5bits: ttttt : type */
+
+ return (bits & 0x1f);
+}
+#undef TEXT_DECORATION_INDEX
+#undef TEXT_DECORATION_SHIFT
+#undef TEXT_DECORATION_MASK
+
+#define TEXT_INDENT_INDEX 7
+#define TEXT_INDENT_SHIFT 8
+#define TEXT_INDENT_MASK 0x3f00
+static inline uint8_t get_text_indent(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[TEXT_INDENT_INDEX];
+ bits &= TEXT_INDENT_MASK;
+ bits >>= TEXT_INDENT_SHIFT;
+
+ /* 6bits: uuuuut : unit | type */
+ if ((bits & 0x1) == CSS_TEXT_INDENT_SET) {
+ *length = style->i.text_indent;
+ *unit = bits >> 1;
+ }
+
+ return (bits & 0x1);
+}
+#undef TEXT_INDENT_INDEX
+#undef TEXT_INDENT_SHIFT
+#undef TEXT_INDENT_MASK
+
+#define TEXT_TRANSFORM_INDEX 8
+#define TEXT_TRANSFORM_SHIFT 29
+#define TEXT_TRANSFORM_MASK 0xe0000000
+static inline uint8_t get_text_transform(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[TEXT_TRANSFORM_INDEX];
+ bits &= TEXT_TRANSFORM_MASK;
+ bits >>= TEXT_TRANSFORM_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef TEXT_TRANSFORM_INDEX
+#undef TEXT_TRANSFORM_SHIFT
+#undef TEXT_TRANSFORM_MASK
+
+#define TOP_INDEX 4
+#define TOP_SHIFT 11
+#define TOP_MASK 0x3f800
+static inline uint8_t get_top(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[TOP_INDEX];
+ bits &= TOP_MASK;
+ bits >>= TOP_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_TOP_SET) {
+ *length = style->i.top;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+static inline uint8_t get_top_bits(
+ const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[TOP_INDEX];
+ bits &= TOP_MASK;
+ bits >>= TOP_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ return bits;
+}
+#undef TOP_INDEX
+#undef TOP_SHIFT
+#undef TOP_MASK
+
+#define UNICODE_BIDI_INDEX 9
+#define UNICODE_BIDI_SHIFT 4
+#define UNICODE_BIDI_MASK 0x30
+static inline uint8_t get_unicode_bidi(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[UNICODE_BIDI_INDEX];
+ bits &= UNICODE_BIDI_MASK;
+ bits >>= UNICODE_BIDI_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef UNICODE_BIDI_INDEX
+#undef UNICODE_BIDI_SHIFT
+#undef UNICODE_BIDI_MASK
+
+#define VERTICAL_ALIGN_INDEX 5
+#define VERTICAL_ALIGN_SHIFT 12
+#define VERTICAL_ALIGN_MASK 0x1ff000
+static inline uint8_t get_vertical_align(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[VERTICAL_ALIGN_INDEX];
+ bits &= VERTICAL_ALIGN_MASK;
+ bits >>= VERTICAL_ALIGN_SHIFT;
+
+ /* 9bits: uuuuutttt : unit | type */
+ if ((bits & 0xf) == CSS_VERTICAL_ALIGN_SET) {
+ *length = style->i.vertical_align;
+ *unit = bits >> 4;
+ }
+
+ return (bits & 0xf);
+}
+#undef VERTICAL_ALIGN_INDEX
+#undef VERTICAL_ALIGN_SHIFT
+#undef VERTICAL_ALIGN_MASK
+
+#define VISIBILITY_INDEX 9
+#define VISIBILITY_SHIFT 18
+#define VISIBILITY_MASK 0xc0000
+static inline uint8_t get_visibility(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[VISIBILITY_INDEX];
+ bits &= VISIBILITY_MASK;
+ bits >>= VISIBILITY_SHIFT;
+
+ /* 2bits: tt : type */
+
+ return (bits & 0x3);
+}
+#undef VISIBILITY_INDEX
+#undef VISIBILITY_SHIFT
+#undef VISIBILITY_MASK
+
+#define WHITE_SPACE_INDEX 5
+#define WHITE_SPACE_SHIFT 0
+#define WHITE_SPACE_MASK 0x7
+static inline uint8_t get_white_space(const css_computed_style *style)
+{
+ uint32_t bits = style->i.bits[WHITE_SPACE_INDEX];
+ bits &= WHITE_SPACE_MASK;
+ bits >>= WHITE_SPACE_SHIFT;
+
+ /* 3bits: ttt : type */
+
+ return (bits & 0x7);
+}
+#undef WHITE_SPACE_INDEX
+#undef WHITE_SPACE_SHIFT
+#undef WHITE_SPACE_MASK
+
+#define WIDTH_INDEX 1
+#define WIDTH_SHIFT 11
+#define WIDTH_MASK 0x3f800
+static inline uint8_t get_width(const css_computed_style *style, css_fixed
+ *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[WIDTH_INDEX];
+ bits &= WIDTH_MASK;
+ bits >>= WIDTH_SHIFT;
+
+ /* 7bits: uuuuutt : unit | type */
+ if ((bits & 0x3) == CSS_WIDTH_SET) {
+ *length = style->i.width;
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}
+#undef WIDTH_INDEX
+#undef WIDTH_SHIFT
+#undef WIDTH_MASK
+
+#define Z_INDEX_INDEX 9
+#define Z_INDEX_SHIFT 24
+#define Z_INDEX_MASK 0x3000000
+static inline uint8_t get_z_index(const css_computed_style *style, int32_t
+ *integer)
+{
+ uint32_t bits = style->i.bits[Z_INDEX_INDEX];
+ bits &= Z_INDEX_MASK;
+ bits >>= Z_INDEX_SHIFT;
+
+ /* 2bits: tt : type */
+ *integer = style->i.z_index;
+
+ return (bits & 0x3);
+}
+#undef Z_INDEX_INDEX
+#undef Z_INDEX_SHIFT
+#undef Z_INDEX_MASK
diff --git a/src/select/autogenerated_propset.h b/src/select/autogenerated_propset.h
new file mode 100644
index 0000000..41acaa8
--- a/dev/null
+++ b/src/select/autogenerated_propset.h
@@ -0,0 +1,2631 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 The NetSurf Project
+ */
+
+/** Default values are 'initial value', unless the property is inherited,
+ * in which case it is 'inherit'. */
+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_CURSOR_AUTO,
+ (CSS_LETTER_SPACING_NORMAL << 25) | (
+ CSS_COLUMN_GAP_NORMAL << 18) | (
+ CSS_COLUMN_WIDTH_AUTO << 11) | (
+ CSS_WORD_SPACING_NORMAL << 4) |
+ CSS_BREAK_AFTER_AUTO,
+ (CSS_CLIP_AUTO << 6) | (CSS_BREAK_BEFORE_AUTO << 2) |
+ CSS_COLUMN_COUNT_AUTO,
+ (CSS_BREAK_INSIDE_AUTO << 28) | (
+ CSS_COLUMN_RULE_STYLE_NONE << 24) | (
+ CSS_WRITING_MODE_HORIZONTAL_TB << 22) |
+ (CSS_COLUMN_SPAN_NONE << 20) | (
+ CSS_COLUMN_RULE_COLOR_CURRENT_COLOR <<
+ 18) | (CSS_OUTLINE_COLOR_INVERT << 16)
+ | (CSS_CONTENT_NORMAL << 14) | (
+ CSS_COLUMN_FILL_BALANCE << 12) | (
+ CSS_COUNTER_INCREMENT_NONE << 11) | (
+ CSS_COUNTER_RESET_NONE << 10)
+ },
+ .border_spacing_a = 0,
+ .border_spacing_b = 0,
+ .clip_a = 0,
+ .clip_b = 0,
+ .clip_c = 0,
+ .clip_d = 0,
+ .column_count = 0,
+ .column_gap = 0,
+ .column_rule_color = 0,
+ .column_rule_width = 0,
+ .column_width = 0,
+ .letter_spacing = 0,
+ .outline_color = 0,
+ .outline_width = 0,
+ .word_spacing = 0
+ },
+ .content = NULL,
+ .counter_increment = NULL,
+ .counter_reset = NULL,
+ .cursor = NULL,
+ .next = NULL,
+ .count = 0,
+ .bin = UINT32_MAX
+};
+
+#define ENSURE_UNCOMMON do { \
+ if (style->i.uncommon == NULL) { \
+ style->i.uncommon = malloc(sizeof( \
+ css_computed_uncommon)); \
+ if (style->i.uncommon == NULL) \
+ return CSS_NOMEM; \
+ \
+ memcpy(style->i.uncommon, &default_uncommon, sizeof( \
+ css_computed_uncommon)); \
+ } \
+} while(0) \
+
+
+#define BORDER_SPACING_INDEX 0
+#define BORDER_SPACING_SHIFT 21
+#define BORDER_SPACING_MASK 0xffe00000
+
+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;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[BORDER_SPACING_INDEX];
+
+ /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */
+ *bits = (*bits & ~BORDER_SPACING_MASK) | (((type & 0x1) | (unit_b << 1)
+ | (unit_a << 6)) << BORDER_SPACING_SHIFT);
+
+ style->i.uncommon->i.border_spacing_a = length_a;
+
+ style->i.uncommon->i.border_spacing_b = length_b;
+
+ return CSS_OK;
+}
+#undef BORDER_SPACING_INDEX
+#undef BORDER_SPACING_SHIFT
+#undef BORDER_SPACING_MASK
+
+#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;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[BREAK_AFTER_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BREAK_AFTER_MASK) | ((type & 0xf) <<
+ BREAK_AFTER_SHIFT);
+
+ return CSS_OK;
+}
+#undef BREAK_AFTER_INDEX
+#undef BREAK_AFTER_SHIFT
+#undef BREAK_AFTER_MASK
+
+#define BREAK_BEFORE_INDEX 2
+#define BREAK_BEFORE_SHIFT 2
+#define BREAK_BEFORE_MASK 0x3c
+
+static inline css_error set_break_before(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[BREAK_BEFORE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BREAK_BEFORE_MASK) | ((type & 0xf) <<
+ BREAK_BEFORE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BREAK_BEFORE_INDEX
+#undef BREAK_BEFORE_SHIFT
+#undef BREAK_BEFORE_MASK
+
+#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;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[BREAK_INSIDE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BREAK_INSIDE_MASK) | ((type & 0xf) <<
+ BREAK_INSIDE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BREAK_INSIDE_INDEX
+#undef BREAK_INSIDE_SHIFT
+#undef BREAK_INSIDE_MASK
+
+#define CLIP_INDEX 2
+#define CLIP_SHIFT 6
+#define CLIP_MASK 0xffffffc0
+static inline css_error set_clip(
+ css_computed_style *style, uint8_t type,
+ css_computed_clip_rect *rect)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[CLIP_INDEX];
+
+ /*
+ 26bits: tt tttr rrrr bbbb blll llTR BLyy:
+ units: top | right | bottom | left
+ opcodes: top | right | bottom | left | type
+ */
+ *bits = (*bits & ~CLIP_MASK) |
+ ((type & 0x3) << CLIP_SHIFT);
+
+ if (type == CSS_CLIP_RECT) {
+ *bits |= (((rect->top_auto ? 0x20 : 0) |
+ (rect->right_auto ? 0x10 : 0) |
+ (rect->bottom_auto ? 0x8 : 0) |
+ (rect->left_auto ? 0x4 : 0)) << CLIP_SHIFT);
+
+ *bits |= (((rect->tunit << 5) | rect->runit)
+ << (CLIP_SHIFT + 16));
+
+ *bits |= (((rect->bunit << 5) | rect->lunit)
+ << (CLIP_SHIFT + 6));
+
+ style->i.uncommon->i.clip_a = rect->top;
+ style->i.uncommon->i.clip_b = rect->right;
+ style->i.uncommon->i.clip_c = rect->bottom;
+ style->i.uncommon->i.clip_d = rect->left;
+ }
+
+ return CSS_OK;
+}
+#undef CLIP_INDEX
+#undef CLIP_SHIFT
+#undef CLIP_MASK
+
+#define COLUMN_COUNT_INDEX 2
+#define COLUMN_COUNT_SHIFT 0
+#define COLUMN_COUNT_MASK 0x3
+
+static inline css_error set_column_count(css_computed_style *style, uint8_t
+ type, int32_t integer)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_COUNT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_COUNT_MASK) | ((type & 0x3) <<
+ COLUMN_COUNT_SHIFT);
+
+ style->i.uncommon->i.column_count = integer;
+
+ return CSS_OK;
+}
+#undef COLUMN_COUNT_INDEX
+#undef COLUMN_COUNT_SHIFT
+#undef COLUMN_COUNT_MASK
+
+#define COLUMN_FILL_INDEX 3
+#define COLUMN_FILL_SHIFT 12
+#define COLUMN_FILL_MASK 0x3000
+
+static inline css_error set_column_fill(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_FILL_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_FILL_MASK) | ((type & 0x3) <<
+ COLUMN_FILL_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_FILL_INDEX
+#undef COLUMN_FILL_SHIFT
+#undef COLUMN_FILL_MASK
+
+#define COLUMN_GAP_INDEX 1
+#define COLUMN_GAP_SHIFT 18
+#define COLUMN_GAP_MASK 0x1fc0000
+
+static inline css_error set_column_gap(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_GAP_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~COLUMN_GAP_MASK) | (((type & 0x3) | (unit << 2)) <<
+ COLUMN_GAP_SHIFT);
+
+ style->i.uncommon->i.column_gap = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_GAP_INDEX
+#undef COLUMN_GAP_SHIFT
+#undef COLUMN_GAP_MASK
+
+#define COLUMN_RULE_COLOR_INDEX 3
+#define COLUMN_RULE_COLOR_SHIFT 18
+#define COLUMN_RULE_COLOR_MASK 0xc0000
+
+static inline css_error set_column_rule_color(css_computed_style *style,
+ uint8_t type, css_color color)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_RULE_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_RULE_COLOR_MASK) | ((type & 0x3) <<
+ COLUMN_RULE_COLOR_SHIFT);
+
+ style->i.uncommon->i.column_rule_color = color;
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_COLOR_INDEX
+#undef COLUMN_RULE_COLOR_SHIFT
+#undef COLUMN_RULE_COLOR_MASK
+
+#define COLUMN_RULE_STYLE_INDEX 3
+#define COLUMN_RULE_STYLE_SHIFT 24
+#define COLUMN_RULE_STYLE_MASK 0xf000000
+
+static inline css_error set_column_rule_style(css_computed_style *style,
+ uint8_t type)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_RULE_STYLE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~COLUMN_RULE_STYLE_MASK) | ((type & 0xf) <<
+ COLUMN_RULE_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_STYLE_INDEX
+#undef COLUMN_RULE_STYLE_SHIFT
+#undef COLUMN_RULE_STYLE_MASK
+
+#define COLUMN_RULE_WIDTH_INDEX 0
+#define COLUMN_RULE_WIDTH_SHIFT 13
+#define COLUMN_RULE_WIDTH_MASK 0x1fe000
+
+static inline css_error set_column_rule_width(css_computed_style *style,
+ uint8_t type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_RULE_WIDTH_INDEX];
+
+ /* 8bits: uuuuuttt : unit | type */
+ *bits = (*bits & ~COLUMN_RULE_WIDTH_MASK) | (((type & 0x7) | (unit <<
+ 3)) << COLUMN_RULE_WIDTH_SHIFT);
+
+ style->i.uncommon->i.column_rule_width = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_RULE_WIDTH_INDEX
+#undef COLUMN_RULE_WIDTH_SHIFT
+#undef COLUMN_RULE_WIDTH_MASK
+
+#define COLUMN_SPAN_INDEX 3
+#define COLUMN_SPAN_SHIFT 20
+#define COLUMN_SPAN_MASK 0x300000
+
+static inline css_error set_column_span(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_SPAN_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~COLUMN_SPAN_MASK) | ((type & 0x3) <<
+ COLUMN_SPAN_SHIFT);
+
+ return CSS_OK;
+}
+#undef COLUMN_SPAN_INDEX
+#undef COLUMN_SPAN_SHIFT
+#undef COLUMN_SPAN_MASK
+
+#define COLUMN_WIDTH_INDEX 1
+#define COLUMN_WIDTH_SHIFT 11
+#define COLUMN_WIDTH_MASK 0x3f800
+
+static inline css_error set_column_width(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COLUMN_WIDTH_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~COLUMN_WIDTH_MASK) | (((type & 0x3) | (unit << 2)) <<
+ COLUMN_WIDTH_SHIFT);
+
+ style->i.uncommon->i.column_width = length;
+
+ return CSS_OK;
+}
+#undef COLUMN_WIDTH_INDEX
+#undef COLUMN_WIDTH_SHIFT
+#undef COLUMN_WIDTH_MASK
+
+#define CONTENT_INDEX 3
+#define CONTENT_SHIFT 14
+#define CONTENT_MASK 0xc000
+static inline css_error set_content(
+ css_computed_style *style, uint8_t type,
+ css_computed_content_item *content)
+{
+ uint32_t *bits;
+ css_computed_content_item *oldcontent;
+ css_computed_content_item *c;
+
+ ENSURE_UNCOMMON;
+
+ /* 2bits: type */
+ bits = &style->i.uncommon->i.bits[CONTENT_INDEX];
+ oldcontent = style->i.uncommon->content;
+
+ *bits = (*bits & ~CONTENT_MASK) |
+ ((type & 0x3) << CONTENT_SHIFT);
+
+ for (c = content; c != NULL &&
+ c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
+ switch (c->type) {
+ case CSS_COMPUTED_CONTENT_STRING:
+ c->data.string = lwc_string_ref(c->data.string);
+ break;
+ case CSS_COMPUTED_CONTENT_URI:
+ c->data.uri = lwc_string_ref(c->data.uri);
+ break;
+ case CSS_COMPUTED_CONTENT_ATTR:
+ c->data.attr = lwc_string_ref(c->data.attr);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTER:
+ c->data.counter.name =
+ lwc_string_ref(c->data.counter.name);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTERS:
+ c->data.counters.name =
+ lwc_string_ref(c->data.counters.name);
+ c->data.counters.sep =
+ lwc_string_ref(c->data.counters.sep);
+ break;
+ default:
+ break;
+ }
+ }
+
+ style->i.uncommon->content = content;
+
+ /* Free existing array */
+ if (oldcontent != NULL) {
+ for (c = oldcontent;
+ c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
+ switch (c->type) {
+ case CSS_COMPUTED_CONTENT_STRING:
+ lwc_string_unref(c->data.string);
+ break;
+ case CSS_COMPUTED_CONTENT_URI:
+ lwc_string_unref(c->data.uri);
+ break;
+ case CSS_COMPUTED_CONTENT_ATTR:
+ lwc_string_unref(c->data.attr);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTER:
+ lwc_string_unref(c->data.counter.name);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTERS:
+ lwc_string_unref(c->data.counters.name);
+ lwc_string_unref(c->data.counters.sep);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (oldcontent != content)
+ free(oldcontent);
+ }
+
+ return CSS_OK;
+}
+#undef CONTENT_INDEX
+#undef CONTENT_SHIFT
+#undef CONTENT_MASK
+
+#define COUNTER_INCREMENT_INDEX 3
+#define COUNTER_INCREMENT_SHIFT 11
+#define COUNTER_INCREMENT_MASK 0x800
+
+static inline css_error set_counter_increment(css_computed_style *style,
+ uint8_t type, css_computed_counter *counter_arr)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COUNTER_INCREMENT_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~COUNTER_INCREMENT_MASK) | ((type & 0x1) <<
+ COUNTER_INCREMENT_SHIFT);
+
+ css_computed_counter *old_counter_arr =
+ style->i.uncommon->counter_increment;
+ css_computed_counter *c;
+
+ for (c = counter_arr; c != NULL && c->name != NULL; c++)
+ c->name = lwc_string_ref(c->name);
+
+ style->i.uncommon->counter_increment = counter_arr;
+
+ /* Free existing array */
+ if (old_counter_arr != NULL) {
+ for (c = old_counter_arr; c->name != NULL; c++)
+ lwc_string_unref(c->name);
+
+ if (old_counter_arr != counter_arr)
+ free(old_counter_arr);
+ }
+
+ return CSS_OK;
+}
+#undef COUNTER_INCREMENT_INDEX
+#undef COUNTER_INCREMENT_SHIFT
+#undef COUNTER_INCREMENT_MASK
+
+#define COUNTER_RESET_INDEX 3
+#define COUNTER_RESET_SHIFT 10
+#define COUNTER_RESET_MASK 0x400
+
+static inline css_error set_counter_reset(css_computed_style *style, uint8_t
+ type, css_computed_counter *counter_arr)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[COUNTER_RESET_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~COUNTER_RESET_MASK) | ((type & 0x1) <<
+ COUNTER_RESET_SHIFT);
+
+ css_computed_counter *old_counter_arr =
+ style->i.uncommon->counter_reset;
+ css_computed_counter *c;
+
+ for (c = counter_arr; c != NULL && c->name != NULL; c++)
+ c->name = lwc_string_ref(c->name);
+
+ style->i.uncommon->counter_reset = counter_arr;
+
+ /* Free existing array */
+ if (old_counter_arr != NULL) {
+ for (c = old_counter_arr; c->name != NULL; c++)
+ lwc_string_unref(c->name);
+
+ if (old_counter_arr != counter_arr)
+ free(old_counter_arr);
+ }
+
+ return CSS_OK;
+}
+#undef COUNTER_RESET_INDEX
+#undef COUNTER_RESET_SHIFT
+#undef COUNTER_RESET_MASK
+
+#define CURSOR_INDEX 0
+#define CURSOR_SHIFT 0
+#define CURSOR_MASK 0x1f
+
+static inline css_error set_cursor(css_computed_style *style, uint8_t type,
+ lwc_string **string_arr)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[CURSOR_INDEX];
+
+ /* 5bits: ttttt : type */
+ *bits = (*bits & ~CURSOR_MASK) | ((type & 0x1f) << CURSOR_SHIFT);
+
+ lwc_string **old_string_arr = style->i.uncommon->cursor;
+ lwc_string **s;
+
+ for (s = string_arr; s != NULL && *s != NULL; s++)
+ *s = lwc_string_ref(*s);
+
+ style->i.uncommon->cursor = string_arr;
+
+ /* Free existing array */
+ if (old_string_arr != NULL) {
+ for (s = old_string_arr; *s != NULL; s++)
+ lwc_string_unref(*s);
+
+ if (old_string_arr != string_arr)
+ free(old_string_arr);
+ }
+
+ return CSS_OK;
+}
+#undef CURSOR_INDEX
+#undef CURSOR_SHIFT
+#undef CURSOR_MASK
+
+#define LETTER_SPACING_INDEX 1
+#define LETTER_SPACING_SHIFT 25
+#define LETTER_SPACING_MASK 0xfe000000
+
+static inline css_error set_letter_spacing(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[LETTER_SPACING_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~LETTER_SPACING_MASK) | (((type & 0x3) | (unit << 2))
+ << LETTER_SPACING_SHIFT);
+
+ style->i.uncommon->i.letter_spacing = length;
+
+ return CSS_OK;
+}
+#undef LETTER_SPACING_INDEX
+#undef LETTER_SPACING_SHIFT
+#undef LETTER_SPACING_MASK
+
+#define OUTLINE_COLOR_INDEX 3
+#define OUTLINE_COLOR_SHIFT 16
+#define OUTLINE_COLOR_MASK 0x30000
+
+static inline css_error set_outline_color(css_computed_style *style, uint8_t
+ type, css_color color)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[OUTLINE_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~OUTLINE_COLOR_MASK) | ((type & 0x3) <<
+ OUTLINE_COLOR_SHIFT);
+
+ style->i.uncommon->i.outline_color = color;
+
+ return CSS_OK;
+}
+#undef OUTLINE_COLOR_INDEX
+#undef OUTLINE_COLOR_SHIFT
+#undef OUTLINE_COLOR_MASK
+
+#define OUTLINE_WIDTH_INDEX 0
+#define OUTLINE_WIDTH_SHIFT 5
+#define OUTLINE_WIDTH_MASK 0x1fe0
+
+static inline css_error set_outline_width(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[OUTLINE_WIDTH_INDEX];
+
+ /* 8bits: uuuuuttt : unit | type */
+ *bits = (*bits & ~OUTLINE_WIDTH_MASK) | (((type & 0x7) | (unit << 3))
+ << OUTLINE_WIDTH_SHIFT);
+
+ style->i.uncommon->i.outline_width = length;
+
+ return CSS_OK;
+}
+#undef OUTLINE_WIDTH_INDEX
+#undef OUTLINE_WIDTH_SHIFT
+#undef OUTLINE_WIDTH_MASK
+
+#define WORD_SPACING_INDEX 1
+#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;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[WORD_SPACING_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~WORD_SPACING_MASK) | (((type & 0x3) | (unit << 2)) <<
+ WORD_SPACING_SHIFT);
+
+ style->i.uncommon->i.word_spacing = length;
+
+ return CSS_OK;
+}
+#undef WORD_SPACING_INDEX
+#undef WORD_SPACING_SHIFT
+#undef WORD_SPACING_MASK
+
+#define WRITING_MODE_INDEX 3
+#define WRITING_MODE_SHIFT 22
+#define WRITING_MODE_MASK 0xc00000
+
+static inline css_error set_writing_mode(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[WRITING_MODE_INDEX];
+
+ /* 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_BEFORE_AUTO << 29) | (CSS_PAGE_BREAK_AFTER_AUTO
+ << 26) | (CSS_PAGE_BREAK_INSIDE_AUTO << 24) | (
+ CSS_WIDOWS_SET << 23) | (CSS_ORPHANS_SET << 22)
+ },
+ .orphans = 2,
+ .widows = 2
+};
+
+#define ENSURE_PAGE do { \
+ if (style->page == NULL) { \
+ style->page = malloc(sizeof(css_computed_page)); \
+ if (style->page == NULL) \
+ return CSS_NOMEM; \
+ \
+ memcpy(style->page, &default_page, sizeof( \
+ css_computed_page)); \
+ } \
+} while(0) \
+
+
+#define ORPHANS_INDEX 0
+#define ORPHANS_SHIFT 22
+#define ORPHANS_MASK 0x400000
+
+static inline css_error set_orphans(css_computed_style *style, uint8_t type,
+ int32_t integer)
+{
+ uint32_t *bits;
+
+ ENSURE_PAGE;
+
+ bits = &style->page->bits[ORPHANS_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~ORPHANS_MASK) | ((type & 0x1) << ORPHANS_SHIFT);
+
+ style->page->orphans = integer;
+
+ return CSS_OK;
+}
+#undef ORPHANS_INDEX
+#undef ORPHANS_SHIFT
+#undef ORPHANS_MASK
+
+#define PAGE_BREAK_AFTER_INDEX 0
+#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;
+
+ ENSURE_PAGE;
+
+ bits = &style->page->bits[PAGE_BREAK_AFTER_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~PAGE_BREAK_AFTER_MASK) | ((type & 0x7) <<
+ PAGE_BREAK_AFTER_SHIFT);
+
+ return CSS_OK;
+}
+#undef PAGE_BREAK_AFTER_INDEX
+#undef PAGE_BREAK_AFTER_SHIFT
+#undef PAGE_BREAK_AFTER_MASK
+
+#define PAGE_BREAK_BEFORE_INDEX 0
+#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;
+
+ ENSURE_PAGE;
+
+ bits = &style->page->bits[PAGE_BREAK_BEFORE_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~PAGE_BREAK_BEFORE_MASK) | ((type & 0x7) <<
+ PAGE_BREAK_BEFORE_SHIFT);
+
+ return CSS_OK;
+}
+#undef PAGE_BREAK_BEFORE_INDEX
+#undef PAGE_BREAK_BEFORE_SHIFT
+#undef PAGE_BREAK_BEFORE_MASK
+
+#define PAGE_BREAK_INSIDE_INDEX 0
+#define PAGE_BREAK_INSIDE_SHIFT 24
+#define PAGE_BREAK_INSIDE_MASK 0x3000000
+
+static inline css_error set_page_break_inside(css_computed_style *style,
+ uint8_t type)
+{
+ uint32_t *bits;
+
+ ENSURE_PAGE;
+
+ bits = &style->page->bits[PAGE_BREAK_INSIDE_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~PAGE_BREAK_INSIDE_MASK) | ((type & 0x3) <<
+ PAGE_BREAK_INSIDE_SHIFT);
+
+ return CSS_OK;
+}
+#undef PAGE_BREAK_INSIDE_INDEX
+#undef PAGE_BREAK_INSIDE_SHIFT
+#undef PAGE_BREAK_INSIDE_MASK
+
+#define WIDOWS_INDEX 0
+#define WIDOWS_SHIFT 23
+#define WIDOWS_MASK 0x800000
+
+static inline css_error set_widows(css_computed_style *style, uint8_t type,
+ int32_t integer)
+{
+ uint32_t *bits;
+
+ ENSURE_PAGE;
+
+ bits = &style->page->bits[WIDOWS_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~WIDOWS_MASK) | ((type & 0x1) << WIDOWS_SHIFT);
+
+ style->page->widows = integer;
+
+ return CSS_OK;
+}
+#undef WIDOWS_INDEX
+#undef WIDOWS_SHIFT
+#undef WIDOWS_MASK
+
+#define ALIGN_CONTENT_INDEX 8
+#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;
+
+ bits = &style->i.bits[ALIGN_CONTENT_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~ALIGN_CONTENT_MASK) | ((type & 0x7) <<
+ ALIGN_CONTENT_SHIFT);
+
+ return CSS_OK;
+}
+#undef ALIGN_CONTENT_INDEX
+#undef ALIGN_CONTENT_SHIFT
+#undef ALIGN_CONTENT_MASK
+
+#define ALIGN_ITEMS_INDEX 8
+#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;
+
+ bits = &style->i.bits[ALIGN_ITEMS_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~ALIGN_ITEMS_MASK) | ((type & 0x7) <<
+ ALIGN_ITEMS_SHIFT);
+
+ return CSS_OK;
+}
+#undef ALIGN_ITEMS_INDEX
+#undef ALIGN_ITEMS_SHIFT
+#undef ALIGN_ITEMS_MASK
+
+#define ALIGN_SELF_INDEX 8
+#define ALIGN_SELF_SHIFT 20
+#define ALIGN_SELF_MASK 0x700000
+
+static inline css_error set_align_self(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[ALIGN_SELF_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~ALIGN_SELF_MASK) | ((type & 0x7) << ALIGN_SELF_SHIFT);
+
+ return CSS_OK;
+}
+#undef ALIGN_SELF_INDEX
+#undef ALIGN_SELF_SHIFT
+#undef ALIGN_SELF_MASK
+
+#define BACKGROUND_ATTACHMENT_INDEX 9
+#define BACKGROUND_ATTACHMENT_SHIFT 26
+#define BACKGROUND_ATTACHMENT_MASK 0xc000000
+
+static inline css_error set_background_attachment(css_computed_style *style,
+ uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BACKGROUND_ATTACHMENT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BACKGROUND_ATTACHMENT_MASK) | ((type & 0x3) <<
+ BACKGROUND_ATTACHMENT_SHIFT);
+
+ return CSS_OK;
+}
+#undef BACKGROUND_ATTACHMENT_INDEX
+#undef BACKGROUND_ATTACHMENT_SHIFT
+#undef BACKGROUND_ATTACHMENT_MASK
+
+#define BACKGROUND_COLOR_INDEX 7
+#define BACKGROUND_COLOR_SHIFT 0
+#define BACKGROUND_COLOR_MASK 0x3
+
+static inline css_error set_background_color(css_computed_style *style, uint8_t
+ type, css_color color)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BACKGROUND_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BACKGROUND_COLOR_MASK) | ((type & 0x3) <<
+ BACKGROUND_COLOR_SHIFT);
+
+ style->i.background_color = color;
+
+ return CSS_OK;
+}
+#undef BACKGROUND_COLOR_INDEX
+#undef BACKGROUND_COLOR_SHIFT
+#undef BACKGROUND_COLOR_MASK
+
+#define BACKGROUND_IMAGE_INDEX 10
+#define BACKGROUND_IMAGE_SHIFT 27
+#define BACKGROUND_IMAGE_MASK 0x8000000
+
+static inline css_error set_background_image(css_computed_style *style, uint8_t
+ type, lwc_string *string)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BACKGROUND_IMAGE_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~BACKGROUND_IMAGE_MASK) | ((type & 0x1) <<
+ BACKGROUND_IMAGE_SHIFT);
+
+ lwc_string *old_string = style->i.background_image;
+
+ if (string != NULL) {
+ style->i.background_image = lwc_string_ref(string);
+ } else {
+ style->i.background_image = NULL;
+ }
+
+ if (old_string != NULL)
+ lwc_string_unref(old_string);
+
+ return CSS_OK;
+}
+#undef BACKGROUND_IMAGE_INDEX
+#undef BACKGROUND_IMAGE_SHIFT
+#undef BACKGROUND_IMAGE_MASK
+
+#define BACKGROUND_POSITION_INDEX 5
+#define BACKGROUND_POSITION_SHIFT 21
+#define BACKGROUND_POSITION_MASK 0xffe00000
+
+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;
+
+ bits = &style->i.bits[BACKGROUND_POSITION_INDEX];
+
+ /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */
+ *bits = (*bits & ~BACKGROUND_POSITION_MASK) | (((type & 0x1) | (unit_b
+ << 1) | (unit_a << 6)) << BACKGROUND_POSITION_SHIFT);
+
+ style->i.background_position_a = length_a;
+
+ style->i.background_position_b = length_b;
+
+ return CSS_OK;
+}
+#undef BACKGROUND_POSITION_INDEX
+#undef BACKGROUND_POSITION_SHIFT
+#undef BACKGROUND_POSITION_MASK
+
+#define BACKGROUND_REPEAT_INDEX 6
+#define BACKGROUND_REPEAT_SHIFT 3
+#define BACKGROUND_REPEAT_MASK 0x38
+
+static inline css_error set_background_repeat(css_computed_style *style,
+ uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BACKGROUND_REPEAT_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~BACKGROUND_REPEAT_MASK) | ((type & 0x7) <<
+ BACKGROUND_REPEAT_SHIFT);
+
+ return CSS_OK;
+}
+#undef BACKGROUND_REPEAT_INDEX
+#undef BACKGROUND_REPEAT_SHIFT
+#undef BACKGROUND_REPEAT_MASK
+
+#define BORDER_BOTTOM_COLOR_INDEX 9
+#define BORDER_BOTTOM_COLOR_SHIFT 8
+#define BORDER_BOTTOM_COLOR_MASK 0x300
+
+static inline css_error set_border_bottom_color(css_computed_style *style,
+ uint8_t type, css_color color)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_BOTTOM_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BORDER_BOTTOM_COLOR_MASK) | ((type & 0x3) <<
+ BORDER_BOTTOM_COLOR_SHIFT);
+
+ style->i.border_bottom_color = color;
+
+ return CSS_OK;
+}
+#undef BORDER_BOTTOM_COLOR_INDEX
+#undef BORDER_BOTTOM_COLOR_SHIFT
+#undef BORDER_BOTTOM_COLOR_MASK
+
+#define BORDER_BOTTOM_STYLE_INDEX 6
+#define BORDER_BOTTOM_STYLE_SHIFT 18
+#define BORDER_BOTTOM_STYLE_MASK 0x3c0000
+
+static inline css_error set_border_bottom_style(css_computed_style *style,
+ uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BORDER_BOTTOM_STYLE_MASK) | ((type & 0xf) <<
+ BORDER_BOTTOM_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BORDER_BOTTOM_STYLE_INDEX
+#undef BORDER_BOTTOM_STYLE_SHIFT
+#undef BORDER_BOTTOM_STYLE_MASK
+
+#define BORDER_BOTTOM_WIDTH_INDEX 0
+#define BORDER_BOTTOM_WIDTH_SHIFT 24
+#define BORDER_BOTTOM_WIDTH_MASK 0xff000000
+
+static inline css_error set_border_bottom_width(css_computed_style *style,
+ uint8_t type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_BOTTOM_WIDTH_INDEX];
+
+ /* 8bits: uuuuuttt : unit | type */
+ *bits = (*bits & ~BORDER_BOTTOM_WIDTH_MASK) | (((type & 0x7) | (unit <<
+ 3)) << BORDER_BOTTOM_WIDTH_SHIFT);
+
+ style->i.border_bottom_width = length;
+
+ return CSS_OK;
+}
+#undef BORDER_BOTTOM_WIDTH_INDEX
+#undef BORDER_BOTTOM_WIDTH_SHIFT
+#undef BORDER_BOTTOM_WIDTH_MASK
+
+#define BORDER_COLLAPSE_INDEX 10
+#define BORDER_COLLAPSE_SHIFT 28
+#define BORDER_COLLAPSE_MASK 0x30000000
+
+static inline css_error set_border_collapse(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_COLLAPSE_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BORDER_COLLAPSE_MASK) | ((type & 0x3) <<
+ BORDER_COLLAPSE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BORDER_COLLAPSE_INDEX
+#undef BORDER_COLLAPSE_SHIFT
+#undef BORDER_COLLAPSE_MASK
+
+#define BORDER_LEFT_COLOR_INDEX 10
+#define BORDER_LEFT_COLOR_SHIFT 30
+#define BORDER_LEFT_COLOR_MASK 0xc0000000
+
+static inline css_error set_border_left_color(css_computed_style *style,
+ uint8_t type, css_color color)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_LEFT_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BORDER_LEFT_COLOR_MASK) | ((type & 0x3) <<
+ BORDER_LEFT_COLOR_SHIFT);
+
+ style->i.border_left_color = color;
+
+ return CSS_OK;
+}
+#undef BORDER_LEFT_COLOR_INDEX
+#undef BORDER_LEFT_COLOR_SHIFT
+#undef BORDER_LEFT_COLOR_MASK
+
+#define BORDER_LEFT_STYLE_INDEX 6
+#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;
+
+ bits = &style->i.bits[BORDER_LEFT_STYLE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BORDER_LEFT_STYLE_MASK) | ((type & 0xf) <<
+ BORDER_LEFT_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BORDER_LEFT_STYLE_INDEX
+#undef BORDER_LEFT_STYLE_SHIFT
+#undef BORDER_LEFT_STYLE_MASK
+
+#define BORDER_LEFT_WIDTH_INDEX 0
+#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;
+
+ bits = &style->i.bits[BORDER_LEFT_WIDTH_INDEX];
+
+ /* 8bits: uuuuuttt : unit | type */
+ *bits = (*bits & ~BORDER_LEFT_WIDTH_MASK) | (((type & 0x7) | (unit <<
+ 3)) << BORDER_LEFT_WIDTH_SHIFT);
+
+ style->i.border_left_width = length;
+
+ return CSS_OK;
+}
+#undef BORDER_LEFT_WIDTH_INDEX
+#undef BORDER_LEFT_WIDTH_SHIFT
+#undef BORDER_LEFT_WIDTH_MASK
+
+#define BORDER_RIGHT_COLOR_INDEX 9
+#define BORDER_RIGHT_COLOR_SHIFT 28
+#define BORDER_RIGHT_COLOR_MASK 0x30000000
+
+static inline css_error set_border_right_color(css_computed_style *style,
+ uint8_t type, css_color color)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_RIGHT_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BORDER_RIGHT_COLOR_MASK) | ((type & 0x3) <<
+ BORDER_RIGHT_COLOR_SHIFT);
+
+ style->i.border_right_color = color;
+
+ return CSS_OK;
+}
+#undef BORDER_RIGHT_COLOR_INDEX
+#undef BORDER_RIGHT_COLOR_SHIFT
+#undef BORDER_RIGHT_COLOR_MASK
+
+#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;
+
+ bits = &style->i.bits[BORDER_RIGHT_STYLE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BORDER_RIGHT_STYLE_MASK) | ((type & 0xf) <<
+ BORDER_RIGHT_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BORDER_RIGHT_STYLE_INDEX
+#undef BORDER_RIGHT_STYLE_SHIFT
+#undef BORDER_RIGHT_STYLE_MASK
+
+#define BORDER_RIGHT_WIDTH_INDEX 0
+#define BORDER_RIGHT_WIDTH_SHIFT 0
+#define BORDER_RIGHT_WIDTH_MASK 0xff
+
+static inline css_error set_border_right_width(css_computed_style *style,
+ uint8_t type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_RIGHT_WIDTH_INDEX];
+
+ /* 8bits: uuuuuttt : unit | type */
+ *bits = (*bits & ~BORDER_RIGHT_WIDTH_MASK) | (((type & 0x7) | (unit <<
+ 3)) << BORDER_RIGHT_WIDTH_SHIFT);
+
+ style->i.border_right_width = length;
+
+ return CSS_OK;
+}
+#undef BORDER_RIGHT_WIDTH_INDEX
+#undef BORDER_RIGHT_WIDTH_SHIFT
+#undef BORDER_RIGHT_WIDTH_MASK
+
+#define BORDER_TOP_COLOR_INDEX 9
+#define BORDER_TOP_COLOR_SHIFT 16
+#define BORDER_TOP_COLOR_MASK 0x30000
+
+static inline css_error set_border_top_color(css_computed_style *style, uint8_t
+ type, css_color color)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_TOP_COLOR_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BORDER_TOP_COLOR_MASK) | ((type & 0x3) <<
+ BORDER_TOP_COLOR_SHIFT);
+
+ style->i.border_top_color = color;
+
+ return CSS_OK;
+}
+#undef BORDER_TOP_COLOR_INDEX
+#undef BORDER_TOP_COLOR_SHIFT
+#undef BORDER_TOP_COLOR_MASK
+
+#define BORDER_TOP_STYLE_INDEX 1
+#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;
+
+ bits = &style->i.bits[BORDER_TOP_STYLE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~BORDER_TOP_STYLE_MASK) | ((type & 0xf) <<
+ BORDER_TOP_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef BORDER_TOP_STYLE_INDEX
+#undef BORDER_TOP_STYLE_SHIFT
+#undef BORDER_TOP_STYLE_MASK
+
+#define BORDER_TOP_WIDTH_INDEX 0
+#define BORDER_TOP_WIDTH_SHIFT 8
+#define BORDER_TOP_WIDTH_MASK 0xff00
+
+static inline css_error set_border_top_width(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BORDER_TOP_WIDTH_INDEX];
+
+ /* 8bits: uuuuuttt : unit | type */
+ *bits = (*bits & ~BORDER_TOP_WIDTH_MASK) | (((type & 0x7) | (unit <<
+ 3)) << BORDER_TOP_WIDTH_SHIFT);
+
+ style->i.border_top_width = length;
+
+ return CSS_OK;
+}
+#undef BORDER_TOP_WIDTH_INDEX
+#undef BORDER_TOP_WIDTH_SHIFT
+#undef BORDER_TOP_WIDTH_MASK
+
+#define BOTTOM_INDEX 3
+#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;
+
+ bits = &style->i.bits[BOTTOM_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~BOTTOM_MASK) | (((type & 0x3) | (unit << 2)) <<
+ BOTTOM_SHIFT);
+
+ style->i.bottom = length;
+
+ return CSS_OK;
+}
+#undef BOTTOM_INDEX
+#undef BOTTOM_SHIFT
+#undef BOTTOM_MASK
+
+#define BOX_SIZING_INDEX 9
+#define BOX_SIZING_SHIFT 2
+#define BOX_SIZING_MASK 0xc
+
+static inline css_error set_box_sizing(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[BOX_SIZING_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~BOX_SIZING_MASK) | ((type & 0x3) << BOX_SIZING_SHIFT);
+
+ return CSS_OK;
+}
+#undef BOX_SIZING_INDEX
+#undef BOX_SIZING_SHIFT
+#undef BOX_SIZING_MASK
+
+#define CAPTION_SIDE_INDEX 9
+#define CAPTION_SIDE_SHIFT 10
+#define CAPTION_SIDE_MASK 0xc00
+
+static inline css_error set_caption_side(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[CAPTION_SIDE_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~CAPTION_SIDE_MASK) | ((type & 0x3) <<
+ CAPTION_SIDE_SHIFT);
+
+ return CSS_OK;
+}
+#undef CAPTION_SIDE_INDEX
+#undef CAPTION_SIDE_SHIFT
+#undef CAPTION_SIDE_MASK
+
+#define CLEAR_INDEX 8
+#define CLEAR_SHIFT 11
+#define CLEAR_MASK 0x3800
+
+static inline css_error set_clear(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[CLEAR_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~CLEAR_MASK) | ((type & 0x7) << CLEAR_SHIFT);
+
+ return CSS_OK;
+}
+#undef CLEAR_INDEX
+#undef CLEAR_SHIFT
+#undef CLEAR_MASK
+
+#define COLOR_INDEX 10
+#define COLOR_SHIFT 26
+#define COLOR_MASK 0x4000000
+
+static inline css_error set_color(css_computed_style *style, uint8_t type,
+ css_color color)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[COLOR_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~COLOR_MASK) | ((type & 0x1) << COLOR_SHIFT);
+
+ style->i.color = color;
+
+ return CSS_OK;
+}
+#undef COLOR_INDEX
+#undef COLOR_SHIFT
+#undef COLOR_MASK
+
+#define DIRECTION_INDEX 8
+#define DIRECTION_SHIFT 0
+#define DIRECTION_MASK 0x3
+
+static inline css_error set_direction(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[DIRECTION_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~DIRECTION_MASK) | ((type & 0x3) << DIRECTION_SHIFT);
+
+ return CSS_OK;
+}
+#undef DIRECTION_INDEX
+#undef DIRECTION_SHIFT
+#undef DIRECTION_MASK
+
+#define DISPLAY_INDEX 6
+#define DISPLAY_SHIFT 27
+#define DISPLAY_MASK 0xf8000000
+
+static inline css_error set_display(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[DISPLAY_INDEX];
+
+ /* 5bits: ttttt : type */
+ *bits = (*bits & ~DISPLAY_MASK) | ((type & 0x1f) << DISPLAY_SHIFT);
+
+ return CSS_OK;
+}
+#undef DISPLAY_INDEX
+#undef DISPLAY_SHIFT
+#undef DISPLAY_MASK
+
+#define EMPTY_CELLS_INDEX 9
+#define EMPTY_CELLS_SHIFT 12
+#define EMPTY_CELLS_MASK 0x3000
+
+static inline css_error set_empty_cells(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[EMPTY_CELLS_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~EMPTY_CELLS_MASK) | ((type & 0x3) <<
+ EMPTY_CELLS_SHIFT);
+
+ return CSS_OK;
+}
+#undef EMPTY_CELLS_INDEX
+#undef EMPTY_CELLS_SHIFT
+#undef EMPTY_CELLS_MASK
+
+#define FLEX_BASIS_INDEX 1
+#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;
+
+ bits = &style->i.bits[FLEX_BASIS_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~FLEX_BASIS_MASK) | (((type & 0x3) | (unit << 2)) <<
+ FLEX_BASIS_SHIFT);
+
+ style->i.flex_basis = length;
+
+ return CSS_OK;
+}
+#undef FLEX_BASIS_INDEX
+#undef FLEX_BASIS_SHIFT
+#undef FLEX_BASIS_MASK
+
+#define FLEX_DIRECTION_INDEX 6
+#define FLEX_DIRECTION_SHIFT 0
+#define FLEX_DIRECTION_MASK 0x7
+
+static inline css_error set_flex_direction(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FLEX_DIRECTION_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~FLEX_DIRECTION_MASK) | ((type & 0x7) <<
+ FLEX_DIRECTION_SHIFT);
+
+ return CSS_OK;
+}
+#undef FLEX_DIRECTION_INDEX
+#undef FLEX_DIRECTION_SHIFT
+#undef FLEX_DIRECTION_MASK
+
+#define FLEX_GROW_INDEX 10
+#define FLEX_GROW_SHIFT 23
+#define FLEX_GROW_MASK 0x800000
+
+static inline css_error set_flex_grow(css_computed_style *style, uint8_t type,
+ css_fixed fixed)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FLEX_GROW_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~FLEX_GROW_MASK) | ((type & 0x1) << FLEX_GROW_SHIFT);
+
+ style->i.flex_grow = fixed;
+
+ return CSS_OK;
+}
+#undef FLEX_GROW_INDEX
+#undef FLEX_GROW_SHIFT
+#undef FLEX_GROW_MASK
+
+#define FLEX_SHRINK_INDEX 10
+#define FLEX_SHRINK_SHIFT 20
+#define FLEX_SHRINK_MASK 0x100000
+
+static inline css_error set_flex_shrink(css_computed_style *style, uint8_t
+ type, css_fixed fixed)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FLEX_SHRINK_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~FLEX_SHRINK_MASK) | ((type & 0x1) <<
+ FLEX_SHRINK_SHIFT);
+
+ style->i.flex_shrink = fixed;
+
+ return CSS_OK;
+}
+#undef FLEX_SHRINK_INDEX
+#undef FLEX_SHRINK_SHIFT
+#undef FLEX_SHRINK_MASK
+
+#define FLEX_WRAP_INDEX 9
+#define FLEX_WRAP_SHIFT 20
+#define FLEX_WRAP_MASK 0x300000
+
+static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FLEX_WRAP_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~FLEX_WRAP_MASK) | ((type & 0x3) << FLEX_WRAP_SHIFT);
+
+ return CSS_OK;
+}
+#undef FLEX_WRAP_INDEX
+#undef FLEX_WRAP_SHIFT
+#undef FLEX_WRAP_MASK
+
+#define FLOAT_INDEX 9
+#define FLOAT_SHIFT 14
+#define FLOAT_MASK 0xc000
+
+static inline css_error set_float(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FLOAT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~FLOAT_MASK) | ((type & 0x3) << FLOAT_SHIFT);
+
+ return CSS_OK;
+}
+#undef FLOAT_INDEX
+#undef FLOAT_SHIFT
+#undef FLOAT_MASK
+
+#define FONT_FAMILY_INDEX 8
+#define FONT_FAMILY_SHIFT 26
+#define FONT_FAMILY_MASK 0x1c000000
+
+static inline css_error set_font_family(css_computed_style *style, uint8_t
+ type, lwc_string **string_arr)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FONT_FAMILY_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~FONT_FAMILY_MASK) | ((type & 0x7) <<
+ FONT_FAMILY_SHIFT);
+
+ lwc_string **old_string_arr = style->font_family;
+ lwc_string **s;
+
+ for (s = string_arr; s != NULL && *s != NULL; s++)
+ *s = lwc_string_ref(*s);
+
+ style->font_family = string_arr;
+
+ /* Free existing array */
+ if (old_string_arr != NULL) {
+ for (s = old_string_arr; *s != NULL; s++)
+ lwc_string_unref(*s);
+
+ if (old_string_arr != string_arr)
+ free(old_string_arr);
+ }
+
+ return CSS_OK;
+}
+#undef FONT_FAMILY_INDEX
+#undef FONT_FAMILY_SHIFT
+#undef FONT_FAMILY_MASK
+
+#define FONT_SIZE_INDEX 5
+#define FONT_SIZE_SHIFT 3
+#define FONT_SIZE_MASK 0xff8
+
+static inline css_error set_font_size(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FONT_SIZE_INDEX];
+
+ /* 9bits: uuuuutttt : unit | type */
+ *bits = (*bits & ~FONT_SIZE_MASK) | (((type & 0xf) | (unit << 4)) <<
+ FONT_SIZE_SHIFT);
+
+ style->i.font_size = length;
+
+ return CSS_OK;
+}
+#undef FONT_SIZE_INDEX
+#undef FONT_SIZE_SHIFT
+#undef FONT_SIZE_MASK
+
+#define FONT_STYLE_INDEX 9
+#define FONT_STYLE_SHIFT 22
+#define FONT_STYLE_MASK 0xc00000
+
+static inline css_error set_font_style(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FONT_STYLE_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~FONT_STYLE_MASK) | ((type & 0x3) << FONT_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef FONT_STYLE_INDEX
+#undef FONT_STYLE_SHIFT
+#undef FONT_STYLE_MASK
+
+#define FONT_VARIANT_INDEX 9
+#define FONT_VARIANT_SHIFT 6
+#define FONT_VARIANT_MASK 0xc0
+
+static inline css_error set_font_variant(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FONT_VARIANT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~FONT_VARIANT_MASK) | ((type & 0x3) <<
+ FONT_VARIANT_SHIFT);
+
+ return CSS_OK;
+}
+#undef FONT_VARIANT_INDEX
+#undef FONT_VARIANT_SHIFT
+#undef FONT_VARIANT_MASK
+
+#define FONT_WEIGHT_INDEX 4
+#define FONT_WEIGHT_SHIFT 0
+#define FONT_WEIGHT_MASK 0xf
+
+static inline css_error set_font_weight(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[FONT_WEIGHT_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~FONT_WEIGHT_MASK) | ((type & 0xf) <<
+ FONT_WEIGHT_SHIFT);
+
+ return CSS_OK;
+}
+#undef FONT_WEIGHT_INDEX
+#undef FONT_WEIGHT_SHIFT
+#undef FONT_WEIGHT_MASK
+
+#define HEIGHT_INDEX 2
+#define HEIGHT_SHIFT 4
+#define HEIGHT_MASK 0x7f0
+
+static inline css_error set_height(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[HEIGHT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ HEIGHT_SHIFT);
+
+ style->i.height = length;
+
+ return CSS_OK;
+}
+#undef HEIGHT_INDEX
+#undef HEIGHT_SHIFT
+#undef HEIGHT_MASK
+
+#define JUSTIFY_CONTENT_INDEX 8
+#define JUSTIFY_CONTENT_SHIFT 5
+#define JUSTIFY_CONTENT_MASK 0xe0
+
+static inline css_error set_justify_content(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[JUSTIFY_CONTENT_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~JUSTIFY_CONTENT_MASK) | ((type & 0x7) <<
+ JUSTIFY_CONTENT_SHIFT);
+
+ return CSS_OK;
+}
+#undef JUSTIFY_CONTENT_INDEX
+#undef JUSTIFY_CONTENT_SHIFT
+#undef JUSTIFY_CONTENT_MASK
+
+#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;
+
+ bits = &style->i.bits[LEFT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~LEFT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ LEFT_SHIFT);
+
+ style->i.left = length;
+
+ return CSS_OK;
+}
+#undef LEFT_INDEX
+#undef LEFT_SHIFT
+#undef LEFT_MASK
+
+#define LINE_HEIGHT_INDEX 2
+#define LINE_HEIGHT_SHIFT 11
+#define LINE_HEIGHT_MASK 0x3f800
+
+static inline css_error set_line_height(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[LINE_HEIGHT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~LINE_HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ LINE_HEIGHT_SHIFT);
+
+ style->i.line_height = length;
+
+ return CSS_OK;
+}
+#undef LINE_HEIGHT_INDEX
+#undef LINE_HEIGHT_SHIFT
+#undef LINE_HEIGHT_MASK
+
+#define LIST_STYLE_IMAGE_INDEX 10
+#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;
+
+ bits = &style->i.bits[LIST_STYLE_IMAGE_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~LIST_STYLE_IMAGE_MASK) | ((type & 0x1) <<
+ LIST_STYLE_IMAGE_SHIFT);
+
+ lwc_string *old_string = style->i.list_style_image;
+
+ if (string != NULL) {
+ style->i.list_style_image = lwc_string_ref(string);
+ } else {
+ style->i.list_style_image = NULL;
+ }
+
+ if (old_string != NULL)
+ lwc_string_unref(old_string);
+
+ return CSS_OK;
+}
+#undef LIST_STYLE_IMAGE_INDEX
+#undef LIST_STYLE_IMAGE_SHIFT
+#undef LIST_STYLE_IMAGE_MASK
+
+#define LIST_STYLE_POSITION_INDEX 9
+#define LIST_STYLE_POSITION_SHIFT 0
+#define LIST_STYLE_POSITION_MASK 0x3
+
+static inline css_error set_list_style_position(css_computed_style *style,
+ uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[LIST_STYLE_POSITION_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~LIST_STYLE_POSITION_MASK) | ((type & 0x3) <<
+ LIST_STYLE_POSITION_SHIFT);
+
+ return CSS_OK;
+}
+#undef LIST_STYLE_POSITION_INDEX
+#undef LIST_STYLE_POSITION_SHIFT
+#undef LIST_STYLE_POSITION_MASK
+
+#define LIST_STYLE_TYPE_INDEX 3
+#define LIST_STYLE_TYPE_SHIFT 0
+#define LIST_STYLE_TYPE_MASK 0xf
+
+static inline css_error set_list_style_type(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[LIST_STYLE_TYPE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | ((type & 0xf) <<
+ LIST_STYLE_TYPE_SHIFT);
+
+ return CSS_OK;
+}
+#undef LIST_STYLE_TYPE_INDEX
+#undef LIST_STYLE_TYPE_SHIFT
+#undef LIST_STYLE_TYPE_MASK
+
+#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;
+
+ bits = &style->i.bits[MARGIN_BOTTOM_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MARGIN_BOTTOM_MASK) | (((type & 0x3) | (unit << 2))
+ << MARGIN_BOTTOM_SHIFT);
+
+ style->i.margin_bottom = length;
+
+ return CSS_OK;
+}
+#undef MARGIN_BOTTOM_INDEX
+#undef MARGIN_BOTTOM_SHIFT
+#undef MARGIN_BOTTOM_MASK
+
+#define MARGIN_LEFT_INDEX 4
+#define MARGIN_LEFT_SHIFT 4
+#define MARGIN_LEFT_MASK 0x7f0
+
+static inline css_error set_margin_left(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[MARGIN_LEFT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MARGIN_LEFT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MARGIN_LEFT_SHIFT);
+
+ style->i.margin_left = length;
+
+ return CSS_OK;
+}
+#undef MARGIN_LEFT_INDEX
+#undef MARGIN_LEFT_SHIFT
+#undef MARGIN_LEFT_MASK
+
+#define MARGIN_RIGHT_INDEX 1
+#define MARGIN_RIGHT_SHIFT 25
+#define MARGIN_RIGHT_MASK 0xfe000000
+
+static inline css_error set_margin_right(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[MARGIN_RIGHT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MARGIN_RIGHT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MARGIN_RIGHT_SHIFT);
+
+ style->i.margin_right = length;
+
+ return CSS_OK;
+}
+#undef MARGIN_RIGHT_INDEX
+#undef MARGIN_RIGHT_SHIFT
+#undef MARGIN_RIGHT_MASK
+
+#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;
+
+ bits = &style->i.bits[MARGIN_TOP_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MARGIN_TOP_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MARGIN_TOP_SHIFT);
+
+ style->i.margin_top = length;
+
+ return CSS_OK;
+}
+#undef MARGIN_TOP_INDEX
+#undef MARGIN_TOP_SHIFT
+#undef MARGIN_TOP_MASK
+
+#define MAX_HEIGHT_INDEX 3
+#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;
+
+ bits = &style->i.bits[MAX_HEIGHT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MAX_HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MAX_HEIGHT_SHIFT);
+
+ style->i.max_height = length;
+
+ return CSS_OK;
+}
+#undef MAX_HEIGHT_INDEX
+#undef MAX_HEIGHT_SHIFT
+#undef MAX_HEIGHT_MASK
+
+#define MAX_WIDTH_INDEX 1
+#define MAX_WIDTH_SHIFT 18
+#define MAX_WIDTH_MASK 0x1fc0000
+
+static inline css_error set_max_width(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[MAX_WIDTH_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MAX_WIDTH_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MAX_WIDTH_SHIFT);
+
+ style->i.max_width = length;
+
+ return CSS_OK;
+}
+#undef MAX_WIDTH_INDEX
+#undef MAX_WIDTH_SHIFT
+#undef MAX_WIDTH_MASK
+
+#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;
+
+ bits = &style->i.bits[MIN_HEIGHT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MIN_HEIGHT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MIN_HEIGHT_SHIFT);
+
+ style->i.min_height = length;
+
+ return CSS_OK;
+}
+#undef MIN_HEIGHT_INDEX
+#undef MIN_HEIGHT_SHIFT
+#undef MIN_HEIGHT_MASK
+
+#define MIN_WIDTH_INDEX 2
+#define MIN_WIDTH_SHIFT 18
+#define MIN_WIDTH_MASK 0x1fc0000
+
+static inline css_error set_min_width(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[MIN_WIDTH_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~MIN_WIDTH_MASK) | (((type & 0x3) | (unit << 2)) <<
+ MIN_WIDTH_SHIFT);
+
+ style->i.min_width = length;
+
+ return CSS_OK;
+}
+#undef MIN_WIDTH_INDEX
+#undef MIN_WIDTH_SHIFT
+#undef MIN_WIDTH_MASK
+
+#define OPACITY_INDEX 10
+#define OPACITY_SHIFT 21
+#define OPACITY_MASK 0x200000
+
+static inline css_error set_opacity(css_computed_style *style, uint8_t type,
+ css_fixed fixed)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[OPACITY_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~OPACITY_MASK) | ((type & 0x1) << OPACITY_SHIFT);
+
+ style->i.opacity = fixed;
+
+ return CSS_OK;
+}
+#undef OPACITY_INDEX
+#undef OPACITY_SHIFT
+#undef OPACITY_MASK
+
+#define ORDER_INDEX 10
+#define ORDER_SHIFT 22
+#define ORDER_MASK 0x400000
+
+static inline css_error set_order(css_computed_style *style, uint8_t type,
+ int32_t integer)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[ORDER_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~ORDER_MASK) | ((type & 0x1) << ORDER_SHIFT);
+
+ style->i.order = integer;
+
+ return CSS_OK;
+}
+#undef ORDER_INDEX
+#undef ORDER_SHIFT
+#undef ORDER_MASK
+
+#define OUTLINE_STYLE_INDEX 6
+#define OUTLINE_STYLE_SHIFT 6
+#define OUTLINE_STYLE_MASK 0x3c0
+
+static inline css_error set_outline_style(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[OUTLINE_STYLE_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~OUTLINE_STYLE_MASK) | ((type & 0xf) <<
+ OUTLINE_STYLE_SHIFT);
+
+ return CSS_OK;
+}
+#undef OUTLINE_STYLE_INDEX
+#undef OUTLINE_STYLE_SHIFT
+#undef OUTLINE_STYLE_MASK
+
+#define OVERFLOW_X_INDEX 8
+#define OVERFLOW_X_SHIFT 2
+#define OVERFLOW_X_MASK 0x1c
+
+static inline css_error set_overflow_x(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[OVERFLOW_X_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~OVERFLOW_X_MASK) | ((type & 0x7) << OVERFLOW_X_SHIFT);
+
+ return CSS_OK;
+}
+#undef OVERFLOW_X_INDEX
+#undef OVERFLOW_X_SHIFT
+#undef OVERFLOW_X_MASK
+
+#define OVERFLOW_Y_INDEX 8
+#define OVERFLOW_Y_SHIFT 23
+#define OVERFLOW_Y_MASK 0x3800000
+
+static inline css_error set_overflow_y(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[OVERFLOW_Y_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~OVERFLOW_Y_MASK) | ((type & 0x7) << OVERFLOW_Y_SHIFT);
+
+ return CSS_OK;
+}
+#undef OVERFLOW_Y_INDEX
+#undef OVERFLOW_Y_SHIFT
+#undef OVERFLOW_Y_MASK
+
+#define PADDING_BOTTOM_INDEX 7
+#define PADDING_BOTTOM_SHIFT 2
+#define PADDING_BOTTOM_MASK 0xfc
+
+static inline css_error set_padding_bottom(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[PADDING_BOTTOM_INDEX];
+
+ /* 6bits: uuuuut : unit | type */
+ *bits = (*bits & ~PADDING_BOTTOM_MASK) | (((type & 0x1) | (unit << 1))
+ << PADDING_BOTTOM_SHIFT);
+
+ style->i.padding_bottom = length;
+
+ return CSS_OK;
+}
+#undef PADDING_BOTTOM_INDEX
+#undef PADDING_BOTTOM_SHIFT
+#undef PADDING_BOTTOM_MASK
+
+#define PADDING_LEFT_INDEX 7
+#define PADDING_LEFT_SHIFT 20
+#define PADDING_LEFT_MASK 0x3f00000
+
+static inline css_error set_padding_left(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[PADDING_LEFT_INDEX];
+
+ /* 6bits: uuuuut : unit | type */
+ *bits = (*bits & ~PADDING_LEFT_MASK) | (((type & 0x1) | (unit << 1)) <<
+ PADDING_LEFT_SHIFT);
+
+ style->i.padding_left = length;
+
+ return CSS_OK;
+}
+#undef PADDING_LEFT_INDEX
+#undef PADDING_LEFT_SHIFT
+#undef PADDING_LEFT_MASK
+
+#define PADDING_RIGHT_INDEX 7
+#define PADDING_RIGHT_SHIFT 14
+#define PADDING_RIGHT_MASK 0xfc000
+
+static inline css_error set_padding_right(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[PADDING_RIGHT_INDEX];
+
+ /* 6bits: uuuuut : unit | type */
+ *bits = (*bits & ~PADDING_RIGHT_MASK) | (((type & 0x1) | (unit << 1))
+ << PADDING_RIGHT_SHIFT);
+
+ style->i.padding_right = length;
+
+ return CSS_OK;
+}
+#undef PADDING_RIGHT_INDEX
+#undef PADDING_RIGHT_SHIFT
+#undef PADDING_RIGHT_MASK
+
+#define PADDING_TOP_INDEX 7
+#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;
+
+ bits = &style->i.bits[PADDING_TOP_INDEX];
+
+ /* 6bits: uuuuut : unit | type */
+ *bits = (*bits & ~PADDING_TOP_MASK) | (((type & 0x1) | (unit << 1)) <<
+ PADDING_TOP_SHIFT);
+
+ style->i.padding_top = length;
+
+ return CSS_OK;
+}
+#undef PADDING_TOP_INDEX
+#undef PADDING_TOP_SHIFT
+#undef PADDING_TOP_MASK
+
+#define POSITION_INDEX 8
+#define POSITION_SHIFT 14
+#define POSITION_MASK 0x1c000
+
+static inline css_error set_position(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[POSITION_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~POSITION_MASK) | ((type & 0x7) << POSITION_SHIFT);
+
+ return CSS_OK;
+}
+#undef POSITION_INDEX
+#undef POSITION_SHIFT
+#undef POSITION_MASK
+
+#define QUOTES_INDEX 10
+#define QUOTES_SHIFT 24
+#define QUOTES_MASK 0x1000000
+
+static inline css_error set_quotes(css_computed_style *style, uint8_t type,
+ lwc_string **string_arr)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[QUOTES_INDEX];
+
+ /* 1bit: t : type */
+ *bits = (*bits & ~QUOTES_MASK) | ((type & 0x1) << QUOTES_SHIFT);
+
+ lwc_string **old_string_arr = style->quotes;
+ lwc_string **s;
+
+ for (s = string_arr; s != NULL && *s != NULL; s++)
+ *s = lwc_string_ref(*s);
+
+ style->quotes = string_arr;
+
+ /* Free existing array */
+ if (old_string_arr != NULL) {
+ for (s = old_string_arr; *s != NULL; s++)
+ lwc_string_unref(*s);
+
+ if (old_string_arr != string_arr)
+ free(old_string_arr);
+ }
+
+ return CSS_OK;
+}
+#undef QUOTES_INDEX
+#undef QUOTES_SHIFT
+#undef QUOTES_MASK
+
+#define RIGHT_INDEX 4
+#define RIGHT_SHIFT 25
+#define RIGHT_MASK 0xfe000000
+
+static inline css_error set_right(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[RIGHT_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~RIGHT_MASK) | (((type & 0x3) | (unit << 2)) <<
+ RIGHT_SHIFT);
+
+ style->i.right = length;
+
+ return CSS_OK;
+}
+#undef RIGHT_INDEX
+#undef RIGHT_SHIFT
+#undef RIGHT_MASK
+
+#define TABLE_LAYOUT_INDEX 9
+#define TABLE_LAYOUT_SHIFT 30
+#define TABLE_LAYOUT_MASK 0xc0000000
+
+static inline css_error set_table_layout(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[TABLE_LAYOUT_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~TABLE_LAYOUT_MASK) | ((type & 0x3) <<
+ TABLE_LAYOUT_SHIFT);
+
+ return CSS_OK;
+}
+#undef TABLE_LAYOUT_INDEX
+#undef TABLE_LAYOUT_SHIFT
+#undef TABLE_LAYOUT_MASK
+
+#define TEXT_ALIGN_INDEX 6
+#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;
+
+ bits = &style->i.bits[TEXT_ALIGN_INDEX];
+
+ /* 4bits: tttt : type */
+ *bits = (*bits & ~TEXT_ALIGN_MASK) | ((type & 0xf) << TEXT_ALIGN_SHIFT);
+
+ return CSS_OK;
+}
+#undef TEXT_ALIGN_INDEX
+#undef TEXT_ALIGN_SHIFT
+#undef TEXT_ALIGN_MASK
+
+#define TEXT_DECORATION_INDEX 6
+#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;
+
+ bits = &style->i.bits[TEXT_DECORATION_INDEX];
+
+ /* 5bits: ttttt : type */
+ *bits = (*bits & ~TEXT_DECORATION_MASK) | ((type & 0x1f) <<
+ TEXT_DECORATION_SHIFT);
+
+ return CSS_OK;
+}
+#undef TEXT_DECORATION_INDEX
+#undef TEXT_DECORATION_SHIFT
+#undef TEXT_DECORATION_MASK
+
+#define TEXT_INDENT_INDEX 7
+#define TEXT_INDENT_SHIFT 8
+#define TEXT_INDENT_MASK 0x3f00
+
+static inline css_error set_text_indent(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[TEXT_INDENT_INDEX];
+
+ /* 6bits: uuuuut : unit | type */
+ *bits = (*bits & ~TEXT_INDENT_MASK) | (((type & 0x1) | (unit << 1)) <<
+ TEXT_INDENT_SHIFT);
+
+ style->i.text_indent = length;
+
+ return CSS_OK;
+}
+#undef TEXT_INDENT_INDEX
+#undef TEXT_INDENT_SHIFT
+#undef TEXT_INDENT_MASK
+
+#define TEXT_TRANSFORM_INDEX 8
+#define TEXT_TRANSFORM_SHIFT 29
+#define TEXT_TRANSFORM_MASK 0xe0000000
+
+static inline css_error set_text_transform(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[TEXT_TRANSFORM_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~TEXT_TRANSFORM_MASK) | ((type & 0x7) <<
+ TEXT_TRANSFORM_SHIFT);
+
+ return CSS_OK;
+}
+#undef TEXT_TRANSFORM_INDEX
+#undef TEXT_TRANSFORM_SHIFT
+#undef TEXT_TRANSFORM_MASK
+
+#define TOP_INDEX 4
+#define TOP_SHIFT 11
+#define TOP_MASK 0x3f800
+
+static inline css_error set_top(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[TOP_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~TOP_MASK) | (((type & 0x3) | (unit << 2)) <<
+ TOP_SHIFT);
+
+ style->i.top = length;
+
+ return CSS_OK;
+}
+#undef TOP_INDEX
+#undef TOP_SHIFT
+#undef TOP_MASK
+
+#define UNICODE_BIDI_INDEX 9
+#define UNICODE_BIDI_SHIFT 4
+#define UNICODE_BIDI_MASK 0x30
+
+static inline css_error set_unicode_bidi(css_computed_style *style, uint8_t
+ type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[UNICODE_BIDI_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~UNICODE_BIDI_MASK) | ((type & 0x3) <<
+ UNICODE_BIDI_SHIFT);
+
+ return CSS_OK;
+}
+#undef UNICODE_BIDI_INDEX
+#undef UNICODE_BIDI_SHIFT
+#undef UNICODE_BIDI_MASK
+
+#define VERTICAL_ALIGN_INDEX 5
+#define VERTICAL_ALIGN_SHIFT 12
+#define VERTICAL_ALIGN_MASK 0x1ff000
+
+static inline css_error set_vertical_align(css_computed_style *style, uint8_t
+ type, css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[VERTICAL_ALIGN_INDEX];
+
+ /* 9bits: uuuuutttt : unit | type */
+ *bits = (*bits & ~VERTICAL_ALIGN_MASK) | (((type & 0xf) | (unit << 4))
+ << VERTICAL_ALIGN_SHIFT);
+
+ style->i.vertical_align = length;
+
+ return CSS_OK;
+}
+#undef VERTICAL_ALIGN_INDEX
+#undef VERTICAL_ALIGN_SHIFT
+#undef VERTICAL_ALIGN_MASK
+
+#define VISIBILITY_INDEX 9
+#define VISIBILITY_SHIFT 18
+#define VISIBILITY_MASK 0xc0000
+
+static inline css_error set_visibility(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[VISIBILITY_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~VISIBILITY_MASK) | ((type & 0x3) << VISIBILITY_SHIFT);
+
+ return CSS_OK;
+}
+#undef VISIBILITY_INDEX
+#undef VISIBILITY_SHIFT
+#undef VISIBILITY_MASK
+
+#define WHITE_SPACE_INDEX 5
+#define WHITE_SPACE_SHIFT 0
+#define WHITE_SPACE_MASK 0x7
+
+static inline css_error set_white_space(css_computed_style *style, uint8_t type)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[WHITE_SPACE_INDEX];
+
+ /* 3bits: ttt : type */
+ *bits = (*bits & ~WHITE_SPACE_MASK) | ((type & 0x7) <<
+ WHITE_SPACE_SHIFT);
+
+ return CSS_OK;
+}
+#undef WHITE_SPACE_INDEX
+#undef WHITE_SPACE_SHIFT
+#undef WHITE_SPACE_MASK
+
+#define WIDTH_INDEX 1
+#define WIDTH_SHIFT 11
+#define WIDTH_MASK 0x3f800
+
+static inline css_error set_width(css_computed_style *style, uint8_t type,
+ css_fixed length, css_unit unit)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[WIDTH_INDEX];
+
+ /* 7bits: uuuuutt : unit | type */
+ *bits = (*bits & ~WIDTH_MASK) | (((type & 0x3) | (unit << 2)) <<
+ WIDTH_SHIFT);
+
+ style->i.width = length;
+
+ return CSS_OK;
+}
+#undef WIDTH_INDEX
+#undef WIDTH_SHIFT
+#undef WIDTH_MASK
+
+#define Z_INDEX_INDEX 9
+#define Z_INDEX_SHIFT 24
+#define Z_INDEX_MASK 0x3000000
+
+static inline css_error set_z_index(css_computed_style *style, uint8_t type,
+ int32_t integer)
+{
+ uint32_t *bits;
+
+ bits = &style->i.bits[Z_INDEX_INDEX];
+
+ /* 2bits: tt : type */
+ *bits = (*bits & ~Z_INDEX_MASK) | ((type & 0x3) << Z_INDEX_SHIFT);
+
+ style->i.z_index = integer;
+
+ return CSS_OK;
+}
+#undef Z_INDEX_INDEX
+#undef Z_INDEX_SHIFT
+#undef Z_INDEX_MASK
diff --git a/src/select/computed.c b/src/select/computed.c
index 03e7c15..ebb2b29 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -749,13 +749,39 @@ uint8_t css_computed_font_style(const css_computed_style *style)
uint8_t css_computed_min_height(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- return get_min_height(style, length, unit);
+ uint8_t min_height = get_min_height(style, length, unit);
+
+ if (min_height == CSS_MIN_HEIGHT_AUTO) {
+ uint8_t display = get_display(style);
+
+ if (display != CSS_DISPLAY_FLEX &&
+ display != CSS_DISPLAY_INLINE_FLEX) {
+ min_height = CSS_MIN_HEIGHT_SET;
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ }
+ }
+
+ return min_height;
}
uint8_t css_computed_min_width(const css_computed_style *style,
css_fixed *length, css_unit *unit)
{
- return get_min_width(style, length, unit);
+ uint8_t min_width = get_min_width(style, length, unit);
+
+ if (min_width == CSS_MIN_WIDTH_AUTO) {
+ uint8_t display = get_display(style);
+
+ if (display != CSS_DISPLAY_FLEX &&
+ display != CSS_DISPLAY_INLINE_FLEX) {
+ min_width = CSS_MIN_WIDTH_SET;
+ *length = 0;
+ *unit = CSS_UNIT_PX;
+ }
+ }
+
+ return min_width;
}
uint8_t css_computed_background_repeat(const css_computed_style *style)
@@ -927,6 +953,8 @@ uint8_t css_computed_display(const css_computed_style *style,
root /* 4. */) {
if (display == CSS_DISPLAY_INLINE_TABLE) {
return CSS_DISPLAY_TABLE;
+ } else if (display == CSS_DISPLAY_INLINE_FLEX) {
+ return CSS_DISPLAY_FLEX;
} else if (display == CSS_DISPLAY_INLINE ||
display == CSS_DISPLAY_RUN_IN ||
display == CSS_DISPLAY_TABLE_ROW_GROUP ||
@@ -1054,6 +1082,59 @@ uint8_t css_computed_widows(const css_computed_style *style,
return get_widows(style, widows);
}
+uint8_t css_computed_align_content(const css_computed_style *style)
+{
+ return get_align_content(style);
+}
+
+uint8_t css_computed_align_items(const css_computed_style *style)
+{
+ return get_align_items(style);
+}
+
+uint8_t css_computed_align_self(const css_computed_style *style)
+{
+ return get_align_self(style);
+}
+
+uint8_t css_computed_flex_basis(const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ return get_flex_basis(style, length, unit);
+}
+
+uint8_t css_computed_flex_direction(const css_computed_style *style)
+{
+ return get_flex_direction(style);
+}
+
+uint8_t css_computed_flex_grow(const css_computed_style *style,
+ css_fixed *number)
+{
+ return get_flex_grow(style, number);
+}
+
+uint8_t css_computed_flex_shrink(const css_computed_style *style,
+ css_fixed *number)
+{
+ return get_flex_shrink(style, number);
+}
+
+uint8_t css_computed_flex_wrap(const css_computed_style *style)
+{
+ return get_flex_wrap(style);
+}
+
+uint8_t css_computed_justify_content(const css_computed_style *style)
+{
+ return get_justify_content(style);
+}
+
+uint8_t css_computed_order(const css_computed_style *style,
+ int32_t *order)
+{
+ return get_order(style, order);
+}
/******************************************************************************
* Library internals *
@@ -1205,6 +1286,12 @@ css_error css__compute_absolute_values(const css_computed_style *parent,
if (error != CSS_OK)
return error;
+ /* Fix up flex-basis */
+ error = compute_absolute_length(style, &ex_size.data.length,
+ get_flex_basis, set_flex_basis);
+ if (error != CSS_OK)
+ return error;
+
/* Uncommon properties */
if (style->i.uncommon != NULL) {
/* Fix up border-spacing */
diff --git a/src/select/computed.h b/src/select/computed.h
index 9f2abdd..d59fbe3 100644
--- a/src/select/computed.h
+++ b/src/select/computed.h
@@ -10,322 +10,7 @@
#include <libcss/computed.h>
#include <libcss/hint.h>
-
-
-
-struct css_computed_uncommon_i {
-/*
- * border_spacing 1 + 2(4) 2(4)
- * break_before 4 0
- * break_after 4 0
- * break_inside 4 0
- * clip 2 + 4(4) + 4 4(4)
- * column_count 2 4
- * column_fill 2 0
- * column_gap 2 + 4 4
- * column_rule_color 2 4
- * column_rule_style 4 0
- * column_rule_width 3 + 4 4
- * column_span 2 0
- * column_width 2 + 4 4
- * letter_spacing 2 + 4 4
- * outline_color 2 4
- * outline_width 3 + 4 4
- * word_spacing 2 + 4 4
- * --- ---
- * 95 bits 60 bytes
- *
- * Encode counter_increment and _reset as an array of name, value pairs,
- * terminated with a blank entry.
- *
- * counter_increment 1 sizeof(ptr)
- * counter_reset 1 sizeof(ptr)
- * --- ---
- * 2 bits 2sizeof(ptr) bytes
- *
- * Encode cursor uri(s) as an array of string objects, terminated with a
- * blank entry.
- *
- * cursor 5 sizeof(ptr)
- * --- ---
- * 5 bits sizeof(ptr) bytes
- *
- * Encode content as an array of content items, terminated with a blank entry.
- *
- * content 2 sizeof(ptr)
- * --- ---
- * 2 bits sizeof(ptr)
- *
- * ___ ___
- * 108 bits 62 + 4sizeof(ptr) bytes
- *
- * 14 bytes 62 + 4sizeof(ptr) bytes
- * ===================
- * 74 + 4sizeof(ptr) bytes
- *
- * Bit allocations:
- *
- * 76543210
- * 1 llllllcc letter-spacing | outline-color
- * 2 ooooooob outline-width | border-spacing
- * 3 bbbbbbbb border-spacing
- * 4 wwwwwwir word-spacing | counter-increment | counter-reset
- * 5 uuuuumm. cursor | writing-mode | <unused>
- * 6 cccccccc clip
- * 7 cccccccc clip
- * 8 ccccccoo clip | content
- * 9 ccffssss column_count | column-fill | column-rule-style
- * 10 ggggggcc column-gap | column-rule-color
- * 11 wwwwwww. column-rule-width | <unused>
- * 12 sswwwwww column-span | column_width
- * 13 bbbbaaaa break-before | break-after
- * 14 iiii.... break-inside | <unused>
- */
- uint8_t bits[14];
-
- css_fixed border_spacing[2];
-
- css_fixed clip[4];
-
- css_fixed letter_spacing;
-
- css_color outline_color;
- css_fixed outline_width;
-
- css_fixed word_spacing;
-
- int32_t column_count;
- css_fixed column_gap;
- css_color column_rule_color;
- css_fixed column_rule_width;
- css_fixed column_width;
-};
-
-typedef struct css_computed_uncommon {
- struct css_computed_uncommon_i i;
-
- css_computed_counter *counter_increment;
- css_computed_counter *counter_reset;
-
- css_computed_content_item *content;
-
- lwc_string **cursor;
- struct css_computed_uncommon *next;
- uint32_t count;
- uint32_t bin;
-} css_computed_uncommon;
-
-typedef struct css_computed_page {
-/*
- * Bit allocations:
- *
- * 76543210
- * 1 aaabbbii page_break_after | page_break_before | page_break_inside
- * 2 ......wo widows | orphans
- */
- uint8_t bits[2];
-
- int32_t widows;
- int32_t orphans;
-} css_computed_page;
-
-struct css_computed_style_i {
-/*
- * background_attachment 2
- * background_repeat 3
- * border_collapse 2
- * border_top_style 4
- * border_right_style 4
- * border_bottom_style 4
- * border_left_style 4
- * caption_side 2
- * clear 3
- * direction 2
- * display 5
- * empty_cells 2
- * float 2
- * font_style 2
- * font_variant 2
- * font_weight 4
- * list_style_position 2
- * list_style_type 4
- * overflow 3
- * outline_style 4
- * position 3
- * table_layout 2
- * text_align 4
- * text_decoration 5
- * text_transform 3
- * unicode_bidi 2
- * visibility 2
- * white_space 3
- * box_sizing 2
- * ---
- * 86 bits
- *
- * Colours are 32bits of AARRGGBB
- * Dimensions are encoded as a fixed point value + 4 bits of unit data
- *
- * background_color 2 4
- * background_image 1 sizeof(ptr)
- * background_position 1 + 2(4) 2(4)
- * border_top_color 2 4
- * border_right_color 2 4
- * border_bottom_color 2 4
- * border_left_color 2 4
- * border_top_width 3 + 4 4
- * border_right_width 3 + 4 4
- * border_bottom_width 3 + 4 4
- * border_left_width 3 + 4 4
- * top 2 + 4 4
- * right 2 + 4 4
- * bottom 2 + 4 4
- * left 2 + 4 4
- * color 1 4
- * font_size 4 + 4 4
- * height 2 + 4 4
- * line_height 2 + 4 4
- * list_style_image 1 sizeof(ptr)
- * margin_top 2 + 4 4
- * margin_right 2 + 4 4
- * margin_bottom 2 + 4 4
- * margin_left 2 + 4 4
- * max_height 2 + 4 4
- * max_width 2 + 4 4
- * min_height 1 + 4 4
- * min_width 1 + 4 4
- * padding_top 1 + 4 4
- * padding_right 1 + 4 4
- * padding_bottom 1 + 4 4
- * padding_left 1 + 4 4
- * text_indent 1 + 4 4
- * vertical_align 4 + 4 4
- * width 2 + 4 4
- * z_index 2 4
- * --- ---
- * 181 bits 140 + 2sizeof(ptr) bytes
- *
- * Encode font family as an array of string objects, terminated with a
- * blank entry.
- *
- * font_family 3 sizeof(ptr)
- * --- ---
- * 3 bits sizeof(ptr)
- *
- * Encode quotes as an array of string objects, terminated with a blank entry.
- *
- * quotes 1 sizeof(ptr)
- * --- ---
- * 1 bit sizeof(ptr) bytes
- *
- * ___ ___
- * 269 bits 140 + 4sizeof(ptr) bytes
- *
- * 34 bytes 140 + 4sizeof(ptr) bytes
- * ===================
- * 174 + 4sizeof(ptr) bytes
- *
- * Bit allocations:
- *
- * 76543210
- * 1 vvvvvvvv vertical-align
- * 2 ffffffff font-size
- * 3 ttttttti border-top-width | background-image
- * 4 rrrrrrrc border-right-width | color
- * 5 bbbbbbbl border-bottom-width | list-style-image
- * 6 lllllllq border-left-width | quotes
- * 7 ttttttcc top | border-top-color
- * 8 rrrrrrcc right | border-right-color
- * 9 bbbbbbcc bottom | border-bottom-color
- * 10 llllllcc left | border-left-color
- * 11 hhhhhhbb height | background-color
- * 12 llllllzz line-height | z-index
- * 13 ttttttbb margin-top | background-attachment
- * 14 rrrrrrbb margin-right | border-collapse
- * 15 bbbbbbcc margin-bottom | caption-side
- * 16 lllllldd margin-left | direction
- * 17 mmmmmmee max-height | empty-cells
- * 18 mmmmmmff max-width | float
- * 19 wwwwwwff width | font-style
- * 20 mmmmmbbb min-height | background-repeat
- * 21 mmmmmccc min-width | clear
- * 22 tttttxxx padding-top | overflow-x
- * 23 rrrrrppp padding-right | position
- * 24 bbbbboss padding-bottom | opacity | box-sizing
- * 25 lllllttt padding-left | text-transform
- * 26 tttttwww text-indent | white-space
- * 27 bbbbbbbb background-position
- * 28 bdddddff background-position | display | font-variant
- * 29 tttttfff text-decoration | font-family
- * 30 ttttrrrr border-top-style | border-right-style
- * 31 bbbbllll border-bottom-style | border-left-style
- * 32 ffffllll font-weight | list-style-type
- * 33 oooottuu outline-style | table-layout | unicode-bidi
- * 34 vvlltttt visibility | list-style-position | text-align
- * 35 yyy..... overflow-y | <unused>
- */
- uint8_t bits[35];
-
- uint8_t unused[1];
-
- css_color background_color;
- lwc_string *background_image;
- css_fixed background_position[2];
-
- css_color border_color[4];
- css_fixed border_width[4];
-
- css_fixed top;
- css_fixed right;
- css_fixed bottom;
- css_fixed left;
-
- css_color color;
-
- css_fixed font_size;
-
- css_fixed height;
-
- css_fixed line_height;
-
- lwc_string *list_style_image;
-
- css_fixed margin[4];
-
- css_fixed max_height;
- css_fixed max_width;
-
- css_fixed min_height;
- css_fixed min_width;
-
- css_fixed opacity;
-
- css_fixed padding[4];
-
- css_fixed text_indent;
-
- css_fixed vertical_align;
-
- css_fixed width;
-
- int32_t z_index;
-
- css_computed_uncommon *uncommon;/**< Uncommon properties */
- void *aural; /**< Aural properties */
-};
-
-struct css_computed_style {
- struct css_computed_style_i i;
-
- lwc_string **font_family;
-
- lwc_string **quotes;
- css_computed_page *page; /**< Page properties */
- struct css_computed_style *next;
- uint32_t count;
- uint32_t bin;
-};
-
+#include "autogenerated_computed.h"
/**
* Take a new reference to a computed style
diff --git a/src/select/dispatch.c b/src/select/dispatch.c
index 7af9000..3ab4c96 100644
--- a/src/select/dispatch.c
+++ b/src/select/dispatch.c
@@ -587,5 +587,55 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = {
PROPERTY_FUNCS(box_sizing),
0,
GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(align_content),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(align_items),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(align_self),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(flex_basis),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(flex_direction),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(flex_grow),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(flex_shrink),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(flex_wrap),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(justify_content),
+ 0,
+ GROUP_NORMAL
+ },
+ {
+ PROPERTY_FUNCS(order),
+ 0,
+ GROUP_NORMAL
}
};
diff --git a/src/select/overrides.py b/src/select/overrides.py
new file mode 100644
index 0000000..c8d1a2a
--- a/dev/null
+++ b/src/select/overrides.py
@@ -0,0 +1,226 @@
+# This file is part of LibCSS.
+# Licensed under the MIT License,
+# http://www.opensource.org/licenses/mit-license.php
+# Copyright 2017 Lucas Neves <lcneves@gmail.com>
+
+overrides = {
+ 'get': {},
+ 'set': {},
+ 'properties': {}
+}
+
+overrides['get']['clip'] = '''\
+static inline uint8_t get_clip(
+ const css_computed_style *style,
+ css_computed_clip_rect *rect)
+{
+ if (style->i.uncommon != NULL) {
+ uint32_t bits = style->i.uncommon->i.bits[CLIP_INDEX];
+ bits &= CLIP_MASK;
+ bits >>= CLIP_SHIFT;
+
+ /*
+ 26bits: tt tttr rrrr bbbb blll llTR BLyy:
+ units: top | right | bottom | left
+ opcodes: top | right | bottom | left | type
+ */
+
+ if ((bits & 0x3) == CSS_CLIP_RECT) {
+ rect->left_auto = (bits & 0x4);
+ rect->bottom_auto = (bits & 0x8);
+ rect->right_auto = (bits & 0x10);
+ rect->top_auto = (bits & 0x20);
+
+ rect->top = style->i.uncommon->i.clip_a;
+ rect->tunit = bits & 0x3e00000 >> 21;
+
+ rect->right = style->i.uncommon->i.clip_b;
+ rect->runit = bits & 0x1f0000 >> 16;
+
+ rect->bottom = style->i.uncommon->i.clip_c;
+ rect->bunit = (bits & 0xf800) >> 11;
+
+ rect->left = style->i.uncommon->i.clip_d;
+ rect->lunit = (bits & 0x7c0) >> 6;
+ }
+
+ return (bits & 0x3);
+ }
+
+ /* Initial value */
+ return CSS_CLIP_AUTO;
+}'''
+
+overrides['set']['clip'] = '''\
+static inline css_error set_clip(
+ css_computed_style *style, uint8_t type,
+ css_computed_clip_rect *rect)
+{
+ uint32_t *bits;
+
+ ENSURE_UNCOMMON;
+
+ bits = &style->i.uncommon->i.bits[CLIP_INDEX];
+
+ /*
+ 26bits: tt tttr rrrr bbbb blll llTR BLyy:
+ units: top | right | bottom | left
+ opcodes: top | right | bottom | left | type
+ */
+ *bits = (*bits & ~CLIP_MASK) |
+ ((type & 0x3) << CLIP_SHIFT);
+
+ if (type == CSS_CLIP_RECT) {
+ *bits |= (((rect->top_auto ? 0x20 : 0) |
+ (rect->right_auto ? 0x10 : 0) |
+ (rect->bottom_auto ? 0x8 : 0) |
+ (rect->left_auto ? 0x4 : 0)) << CLIP_SHIFT);
+
+ *bits |= (((rect->tunit << 5) | rect->runit)
+ << (CLIP_SHIFT + 16));
+
+ *bits |= (((rect->bunit << 5) | rect->lunit)
+ << (CLIP_SHIFT + 6));
+
+ style->i.uncommon->i.clip_a = rect->top;
+ style->i.uncommon->i.clip_b = rect->right;
+ style->i.uncommon->i.clip_c = rect->bottom;
+ style->i.uncommon->i.clip_d = rect->left;
+ }
+
+ return CSS_OK;
+}'''
+
+overrides['get']['line_height'] = '''\
+static inline uint8_t get_line_height(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{
+ uint32_t bits = style->i.bits[LINE_HEIGHT_INDEX];
+ bits &= LINE_HEIGHT_MASK;
+ bits >>= LINE_HEIGHT_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
+ (bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
+ *length = style->i.line_height;
+ }
+
+ if ((bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
+ *unit = bits >> 2;
+ }
+
+ return (bits & 0x3);
+}'''
+
+overrides['set']['content'] = '''\
+static inline css_error set_content(
+ css_computed_style *style, uint8_t type,
+ css_computed_content_item *content)
+{
+ uint32_t *bits;
+ css_computed_content_item *oldcontent;
+ css_computed_content_item *c;
+
+ ENSURE_UNCOMMON;
+
+ /* 2bits: type */
+ bits = &style->i.uncommon->i.bits[CONTENT_INDEX];
+ oldcontent = style->i.uncommon->content;
+
+ *bits = (*bits & ~CONTENT_MASK) |
+ ((type & 0x3) << CONTENT_SHIFT);
+
+ for (c = content; c != NULL &&
+ c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
+ switch (c->type) {
+ case CSS_COMPUTED_CONTENT_STRING:
+ c->data.string = lwc_string_ref(c->data.string);
+ break;
+ case CSS_COMPUTED_CONTENT_URI:
+ c->data.uri = lwc_string_ref(c->data.uri);
+ break;
+ case CSS_COMPUTED_CONTENT_ATTR:
+ c->data.attr = lwc_string_ref(c->data.attr);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTER:
+ c->data.counter.name =
+ lwc_string_ref(c->data.counter.name);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTERS:
+ c->data.counters.name =
+ lwc_string_ref(c->data.counters.name);
+ c->data.counters.sep =
+ lwc_string_ref(c->data.counters.sep);
+ break;
+ default:
+ break;
+ }
+ }
+
+ style->i.uncommon->content = content;
+
+ /* Free existing array */
+ if (oldcontent != NULL) {
+ for (c = oldcontent;
+ c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
+ switch (c->type) {
+ case CSS_COMPUTED_CONTENT_STRING:
+ lwc_string_unref(c->data.string);
+ break;
+ case CSS_COMPUTED_CONTENT_URI:
+ lwc_string_unref(c->data.uri);
+ break;
+ case CSS_COMPUTED_CONTENT_ATTR:
+ lwc_string_unref(c->data.attr);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTER:
+ lwc_string_unref(c->data.counter.name);
+ break;
+ case CSS_COMPUTED_CONTENT_COUNTERS:
+ lwc_string_unref(c->data.counters.name);
+ lwc_string_unref(c->data.counters.sep);
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (oldcontent != content)
+ free(oldcontent);
+ }
+
+ return CSS_OK;
+}'''
+
+get_side = '''\
+static inline uint8_t get_{0}(
+ const css_computed_style *style,
+ css_fixed *length, css_unit *unit)
+{{
+ uint32_t bits = style->i.bits[{1}_INDEX];
+ bits &= {1}_MASK;
+ bits >>= {1}_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ if ((bits & 0x3) == CSS_{1}_SET) {{
+ *length = style->i.{0};
+ *unit = bits >> 2;
+ }}
+
+ return (bits & 0x3);
+}}
+static inline uint8_t get_{0}_bits(
+ const css_computed_style *style)
+{{
+ uint32_t bits = style->i.bits[{1}_INDEX];
+ bits &= {1}_MASK;
+ bits >>= {1}_SHIFT;
+
+ /* 7bits: uuuuutt : units | type */
+ return bits;
+}}'''
+overrides['get']['top'] = get_side.format('top', 'TOP')
+overrides['get']['right'] = get_side.format('right', 'RIGHT')
+overrides['get']['bottom'] = get_side.format('bottom', 'BOTTOM')
+overrides['get']['left'] = get_side.format('left', 'LEFT')
diff --git a/src/select/properties/Makefile b/src/select/properties/Makefile
index 288eda9..6c6cf84 100644
--- a/src/select/properties/Makefile
+++ b/src/select/properties/Makefile
@@ -1,5 +1,8 @@
# Sources
DIR_SOURCES := helpers.c \
+align_content.c \
+align_items.c \
+align_self.c \
azimuth.c \
background_attachment.c \
background_color.c \
@@ -47,6 +50,11 @@ direction.c \
display.c \
elevation.c \
empty_cells.c \
+flex_basis.c \
+flex_direction.c \
+flex_grow.c \
+flex_shrink.c \
+flex_wrap.c \
float.c \
font_family.c \
font_size.c \
@@ -54,6 +62,7 @@ font_style.c \
font_variant.c \
font_weight.c \
height.c \
+justify_content.c \
left.c \
letter_spacing.c \
line_height.c \
@@ -69,6 +78,7 @@ max_width.c \
min_height.c \
min_width.c \
opacity.c \
+order.c \
orphans.c \
outline_color.c \
outline_style.c \
diff --git a/src/select/properties/align_content.c b/src/select/properties/align_content.c
new file mode 100644
index 0000000..f43cd8e
--- a/dev/null
+++ b/src/select/properties/align_content.c
@@ -0,0 +1,81 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_align_content(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_ALIGN_CONTENT_INHERIT;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case ALIGN_CONTENT_STRETCH:
+ value = CSS_ALIGN_CONTENT_STRETCH;
+ break;
+ case ALIGN_CONTENT_FLEX_START:
+ value = CSS_ALIGN_CONTENT_FLEX_START;
+ break;
+ case ALIGN_CONTENT_FLEX_END:
+ value = CSS_ALIGN_CONTENT_FLEX_END;
+ break;
+ case ALIGN_CONTENT_CENTER:
+ value = CSS_ALIGN_CONTENT_CENTER;
+ break;
+ case ALIGN_CONTENT_SPACE_BETWEEN:
+ value = CSS_ALIGN_CONTENT_SPACE_BETWEEN;
+ break;
+ case ALIGN_CONTENT_SPACE_AROUND:
+ value = CSS_ALIGN_CONTENT_SPACE_AROUND;
+ break;
+ case ALIGN_CONTENT_SPACE_EVENLY:
+ value = CSS_ALIGN_CONTENT_SPACE_EVENLY;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_align_content(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_align_content_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_align_content(style, hint->status);
+}
+
+css_error css__initial_align_content(css_select_state *state)
+{
+ return set_align_content(state->computed, CSS_ALIGN_CONTENT_STRETCH);
+}
+
+css_error css__compose_align_content(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t type = get_align_content(child);
+
+ if (type == CSS_ALIGN_CONTENT_INHERIT) {
+ type = get_align_content(parent);
+ }
+
+ return set_align_content(result, type);
+}
+
diff --git a/src/select/properties/align_items.c b/src/select/properties/align_items.c
new file mode 100644
index 0000000..ad69c81
--- a/dev/null
+++ b/src/select/properties/align_items.c
@@ -0,0 +1,75 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_align_items(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_ALIGN_ITEMS_INHERIT;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case ALIGN_ITEMS_STRETCH:
+ value = CSS_ALIGN_ITEMS_STRETCH;
+ break;
+ case ALIGN_ITEMS_FLEX_START:
+ value = CSS_ALIGN_ITEMS_FLEX_START;
+ break;
+ case ALIGN_ITEMS_FLEX_END:
+ value = CSS_ALIGN_ITEMS_FLEX_END;
+ break;
+ case ALIGN_ITEMS_CENTER:
+ value = CSS_ALIGN_ITEMS_CENTER;
+ break;
+ case ALIGN_ITEMS_BASELINE:
+ value = CSS_ALIGN_ITEMS_BASELINE;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_align_items(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_align_items_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_align_items(style, hint->status);
+}
+
+css_error css__initial_align_items(css_select_state *state)
+{
+ return set_align_items(state->computed, CSS_ALIGN_ITEMS_STRETCH);
+}
+
+css_error css__compose_align_items(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t type = get_align_items(child);
+
+ if (type == CSS_ALIGN_ITEMS_INHERIT) {
+ type = get_align_items(parent);
+ }
+
+ return set_align_items(result, type);
+}
+
diff --git a/src/select/properties/align_self.c b/src/select/properties/align_self.c
new file mode 100644
index 0000000..e8e469e
--- a/dev/null
+++ b/src/select/properties/align_self.c
@@ -0,0 +1,78 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_align_self(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_ALIGN_SELF_INHERIT;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case ALIGN_SELF_STRETCH:
+ value = CSS_ALIGN_SELF_STRETCH;
+ break;
+ case ALIGN_SELF_FLEX_START:
+ value = CSS_ALIGN_SELF_FLEX_START;
+ break;
+ case ALIGN_SELF_FLEX_END:
+ value = CSS_ALIGN_SELF_FLEX_END;
+ break;
+ case ALIGN_SELF_CENTER:
+ value = CSS_ALIGN_SELF_CENTER;
+ break;
+ case ALIGN_SELF_BASELINE:
+ value = CSS_ALIGN_SELF_BASELINE;
+ break;
+ case ALIGN_SELF_AUTO:
+ value = CSS_ALIGN_SELF_AUTO;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_align_self(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_align_self_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_align_self(style, hint->status);
+}
+
+css_error css__initial_align_self(css_select_state *state)
+{
+ return set_align_self(state->computed, CSS_ALIGN_SELF_AUTO);
+}
+
+css_error css__compose_align_self(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t type = get_align_self(child);
+
+ if (type == CSS_ALIGN_SELF_INHERIT) {
+ type = get_align_self(parent);
+ }
+
+ return set_align_self(result, type);
+}
+
diff --git a/src/select/properties/display.c b/src/select/properties/display.c
index 40c2e3e..510d24a 100644
--- a/src/select/properties/display.c
+++ b/src/select/properties/display.c
@@ -71,6 +71,12 @@ css_error css__cascade_display(uint32_t opv, css_style *style,
case DISPLAY_NONE:
value = CSS_DISPLAY_NONE;
break;
+ case DISPLAY_FLEX:
+ value = CSS_DISPLAY_FLEX;
+ break;
+ case DISPLAY_INLINE_FLEX:
+ value = CSS_DISPLAY_INLINE_FLEX;
+ break;
}
}
diff --git a/src/select/properties/flex_basis.c b/src/select/properties/flex_basis.c
new file mode 100644
index 0000000..1a92a6b
--- a/dev/null
+++ b/src/select/properties/flex_basis.c
@@ -0,0 +1,79 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_flex_basis(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_FLEX_BASIS_INHERIT;
+ css_fixed length = 0;
+ uint32_t unit = UNIT_PX;
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case FLEX_BASIS_AUTO:
+ value = CSS_FLEX_BASIS_AUTO;
+ break;
+ case FLEX_BASIS_CONTENT:
+ value = CSS_FLEX_BASIS_CONTENT;
+ break;
+ case FLEX_BASIS_SET:
+ value = CSS_FLEX_BASIS_SET;
+ length = *((css_fixed *) style->bytecode);
+ advance_bytecode(style, sizeof(length));
+ unit = *((uint32_t *) style->bytecode);
+ advance_bytecode(style, sizeof(unit));
+ break;
+ }
+ }
+
+ unit = css__to_css_unit(unit);
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_flex_basis(state->computed, value, length, unit);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_flex_basis_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_flex_basis(style, hint->status,
+ hint->data.length.value, hint->data.length.unit);
+}
+
+css_error css__initial_flex_basis(css_select_state *state)
+{
+ return set_flex_basis(state->computed, CSS_FLEX_BASIS_AUTO, 0,
+ CSS_UNIT_PX);
+}
+
+css_error css__compose_flex_basis(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ css_fixed length = 0;
+ css_unit unit = CSS_UNIT_PX;
+ uint8_t type = get_flex_basis(child, &length, &unit);
+
+ if (type == CSS_FLEX_BASIS_INHERIT) {
+ type = get_flex_basis(parent, &length, &unit);
+ }
+
+ return set_flex_basis(result, type, length, unit);
+}
+
diff --git a/src/select/properties/flex_direction.c b/src/select/properties/flex_direction.c
new file mode 100644
index 0000000..79703be
--- a/dev/null
+++ b/src/select/properties/flex_direction.c
@@ -0,0 +1,72 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_flex_direction(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_FLEX_DIRECTION_INHERIT;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case FLEX_DIRECTION_ROW:
+ value = CSS_FLEX_DIRECTION_ROW;
+ break;
+ case FLEX_DIRECTION_ROW_REVERSE:
+ value = CSS_FLEX_DIRECTION_ROW_REVERSE;
+ break;
+ case FLEX_DIRECTION_COLUMN:
+ value = CSS_FLEX_DIRECTION_COLUMN;
+ break;
+ case FLEX_DIRECTION_COLUMN_REVERSE:
+ value = CSS_FLEX_DIRECTION_COLUMN_REVERSE;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_flex_direction(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_flex_direction_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_flex_direction(style, hint->status);
+}
+
+css_error css__initial_flex_direction(css_select_state *state)
+{
+ return set_flex_direction(state->computed, CSS_FLEX_DIRECTION_ROW);
+}
+
+css_error css__compose_flex_direction(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t type = get_flex_direction(child);
+
+ if (type == CSS_FLEX_DIRECTION_INHERIT) {
+ type = get_flex_direction(parent);
+ }
+
+ return set_flex_direction(result, type);
+}
+
diff --git a/src/select/properties/flex_grow.c b/src/select/properties/flex_grow.c
new file mode 100644
index 0000000..7f37cfe
--- a/dev/null
+++ b/src/select/properties/flex_grow.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_flex_grow(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_FLEX_GROW_INHERIT;
+ css_fixed flex_grow = 0;
+
+ if (isInherit(opv) == false) {
+ value = CSS_FLEX_GROW_SET;
+
+ flex_grow = *((css_fixed *) style->bytecode);
+ advance_bytecode(style, sizeof(flex_grow));
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_flex_grow(state->computed, value, flex_grow);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_flex_grow_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_flex_grow(style, hint->status, hint->data.fixed);
+}
+
+css_error css__initial_flex_grow(css_select_state *state)
+{
+ return set_flex_grow(state->computed, CSS_FLEX_GROW_SET, INTTOFIX(0));
+}
+
+css_error css__compose_flex_grow(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ css_fixed flex_grow = 0;
+ uint8_t type = get_flex_grow(child, &flex_grow);
+
+ if (type == CSS_FLEX_GROW_INHERIT) {
+ type = get_flex_grow(parent, &flex_grow);
+ }
+
+ return set_flex_grow(result, type, flex_grow);
+}
+
diff --git a/src/select/properties/flex_shrink.c b/src/select/properties/flex_shrink.c
new file mode 100644
index 0000000..d1acd2a
--- a/dev/null
+++ b/src/select/properties/flex_shrink.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_flex_shrink(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_FLEX_SHRINK_INHERIT;
+ css_fixed flex_shrink = 0;
+
+ if (isInherit(opv) == false) {
+ value = CSS_FLEX_SHRINK_SET;
+
+ flex_shrink = *((css_fixed *) style->bytecode);
+ advance_bytecode(style, sizeof(flex_shrink));
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_flex_shrink(state->computed, value, flex_shrink);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_flex_shrink_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_flex_shrink(style, hint->status, hint->data.fixed);
+}
+
+css_error css__initial_flex_shrink(css_select_state *state)
+{
+ return set_flex_shrink(state->computed, CSS_FLEX_SHRINK_SET, INTTOFIX(1));
+}
+
+css_error css__compose_flex_shrink(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ css_fixed flex_shrink = 0;
+ uint8_t type = get_flex_shrink(child, &flex_shrink);
+
+ if (type == CSS_FLEX_SHRINK_INHERIT) {
+ type = get_flex_shrink(parent, &flex_shrink);
+ }
+
+ return set_flex_shrink(result, type, flex_shrink);
+}
+
diff --git a/src/select/properties/flex_wrap.c b/src/select/properties/flex_wrap.c
new file mode 100644
index 0000000..688a9b6
--- a/dev/null
+++ b/src/select/properties/flex_wrap.c
@@ -0,0 +1,69 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_flex_wrap(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_FLEX_WRAP_INHERIT;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case FLEX_WRAP_NOWRAP:
+ value = CSS_FLEX_WRAP_NOWRAP;
+ break;
+ case FLEX_WRAP_WRAP:
+ value = CSS_FLEX_WRAP_WRAP;
+ break;
+ case FLEX_WRAP_WRAP_REVERSE:
+ value = CSS_FLEX_WRAP_WRAP_REVERSE;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_flex_wrap(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_flex_wrap_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_flex_wrap(style, hint->status);
+}
+
+css_error css__initial_flex_wrap(css_select_state *state)
+{
+ return set_flex_wrap(state->computed, CSS_FLEX_WRAP_NOWRAP);
+}
+
+css_error css__compose_flex_wrap(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t type = get_flex_wrap(child);
+
+ if (type == CSS_FLEX_WRAP_INHERIT) {
+ type = get_flex_wrap(parent);
+ }
+
+ return set_flex_wrap(result, type);
+}
+
diff --git a/src/select/properties/helpers.c b/src/select/properties/helpers.c
index 36c3cba..5893919 100644
--- a/src/select/properties/helpers.c
+++ b/src/select/properties/helpers.c
@@ -29,6 +29,19 @@ css_unit css__to_css_unit(uint32_t u)
case UNIT_MM: return CSS_UNIT_MM;
case UNIT_PT: return CSS_UNIT_PT;
case UNIT_PC: return CSS_UNIT_PC;
+ case UNIT_CAP: return CSS_UNIT_CAP;
+ case UNIT_CH: return CSS_UNIT_CH;
+ case UNIT_IC: return CSS_UNIT_IC;
+ case UNIT_REM: return CSS_UNIT_REM;
+ case UNIT_LH: return CSS_UNIT_LH;
+ case UNIT_RLH: return CSS_UNIT_RLH;
+ case UNIT_VH: return CSS_UNIT_VH;
+ case UNIT_VW: return CSS_UNIT_VW;
+ case UNIT_VI: return CSS_UNIT_VI;
+ case UNIT_VB: return CSS_UNIT_VB;
+ case UNIT_VMIN: return CSS_UNIT_VMIN;
+ case UNIT_VMAX: return CSS_UNIT_VMAX;
+ case UNIT_Q: return CSS_UNIT_Q;
case UNIT_PCT: return CSS_UNIT_PCT;
case UNIT_DEG: return CSS_UNIT_DEG;
case UNIT_GRAD: return CSS_UNIT_GRAD;
diff --git a/src/select/properties/justify_content.c b/src/select/properties/justify_content.c
new file mode 100644
index 0000000..2e17ca5
--- a/dev/null
+++ b/src/select/properties/justify_content.c
@@ -0,0 +1,79 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_justify_content(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_JUSTIFY_CONTENT_INHERIT;
+
+ UNUSED(style);
+
+ if (isInherit(opv) == false) {
+ switch (getValue(opv)) {
+ case JUSTIFY_CONTENT_FLEX_START:
+ value = CSS_JUSTIFY_CONTENT_FLEX_START;
+ break;
+ case JUSTIFY_CONTENT_FLEX_END:
+ value = CSS_JUSTIFY_CONTENT_FLEX_END;
+ break;
+ case JUSTIFY_CONTENT_CENTER:
+ value = CSS_JUSTIFY_CONTENT_CENTER;
+ break;
+ case JUSTIFY_CONTENT_SPACE_BETWEEN:
+ value = CSS_JUSTIFY_CONTENT_SPACE_BETWEEN;
+ break;
+ case JUSTIFY_CONTENT_SPACE_AROUND:
+ value = CSS_JUSTIFY_CONTENT_SPACE_AROUND;
+ break;
+ case JUSTIFY_CONTENT_SPACE_EVENLY:
+ value = CSS_JUSTIFY_CONTENT_SPACE_EVENLY;
+ break;
+ }
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_justify_content(state->computed, value);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_justify_content_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_justify_content(style, hint->status);
+}
+
+css_error css__initial_justify_content(css_select_state *state)
+{
+ return set_justify_content(state->computed,
+ CSS_JUSTIFY_CONTENT_FLEX_START);
+}
+
+css_error css__compose_justify_content(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ uint8_t type = get_justify_content(child);
+
+ if (type == CSS_JUSTIFY_CONTENT_INHERIT) {
+ type = get_justify_content(parent);
+ }
+
+ return set_justify_content(result, type);
+}
+
diff --git a/src/select/properties/min_height.c b/src/select/properties/min_height.c
index 687d8a1..a5389ce 100644
--- a/src/select/properties/min_height.c
+++ b/src/select/properties/min_height.c
@@ -17,7 +17,7 @@
css_error css__cascade_min_height(uint32_t opv, css_style *style,
css_select_state *state)
{
- return css__cascade_length(opv, style, state, set_min_height);
+ return css__cascade_length_auto(opv, style, state, set_min_height);
}
css_error css__set_min_height_from_hint(const css_hint *hint,
@@ -29,7 +29,7 @@ css_error css__set_min_height_from_hint(const css_hint *hint,
css_error css__initial_min_height(css_select_state *state)
{
- return set_min_height(state->computed, CSS_MIN_HEIGHT_SET,
+ return set_min_height(state->computed, CSS_MIN_HEIGHT_AUTO,
0, CSS_UNIT_PX);
}
diff --git a/src/select/properties/min_width.c b/src/select/properties/min_width.c
index 5365588..8460e01 100644
--- a/src/select/properties/min_width.c
+++ b/src/select/properties/min_width.c
@@ -17,7 +17,7 @@
css_error css__cascade_min_width(uint32_t opv, css_style *style,
css_select_state *state)
{
- return css__cascade_length(opv, style, state, set_min_width);
+ return css__cascade_length_auto(opv, style, state, set_min_width);
}
css_error css__set_min_width_from_hint(const css_hint *hint,
@@ -29,7 +29,8 @@ css_error css__set_min_width_from_hint(const css_hint *hint,
css_error css__initial_min_width(css_select_state *state)
{
- return set_min_width(state->computed, CSS_MIN_WIDTH_SET, 0, CSS_UNIT_PX);
+ return set_min_width(state->computed, CSS_MIN_WIDTH_AUTO,
+ 0, CSS_UNIT_PX);
}
css_error css__compose_min_width(const css_computed_style *parent,
diff --git a/src/select/properties/order.c b/src/select/properties/order.c
new file mode 100644
index 0000000..0366537
--- a/dev/null
+++ b/src/select/properties/order.c
@@ -0,0 +1,62 @@
+/*
+ * This file is part of LibCSS
+ * Licensed under the MIT License,
+ * http://www.opensource.org/licenses/mit-license.php
+ * Copyright 2017 Lucas Neves <lcneves@gmail.com>
+ */
+
+#include "bytecode/bytecode.h"
+#include "bytecode/opcodes.h"
+#include "select/propset.h"
+#include "select/propget.h"
+#include "utils/utils.h"
+
+#include "select/properties/properties.h"
+#include "select/properties/helpers.h"
+
+css_error css__cascade_order(uint32_t opv, css_style *style,
+ css_select_state *state)
+{
+ uint16_t value = CSS_ORDER_INHERIT;
+ css_fixed order = 0;
+
+ if (isInherit(opv) == false) {
+ value = CSS_ORDER_SET;
+
+ order = FIXTOINT(*((css_fixed *) style->bytecode));
+ advance_bytecode(style, sizeof(order));
+ }
+
+ if (css__outranks_existing(getOpcode(opv), isImportant(opv), state,
+ isInherit(opv))) {
+ return set_order(state->computed, value, order);
+ }
+
+ return CSS_OK;
+}
+
+css_error css__set_order_from_hint(const css_hint *hint,
+ css_computed_style *style)
+{
+ return set_order(style, hint->status, hint->data.integer);
+}
+
+css_error css__initial_order(css_select_state *state)
+{
+ return set_order(state->computed, CSS_ORDER_SET, 0);
+}
+
+css_error css__compose_order(const css_computed_style *parent,
+ const css_computed_style *child,
+ css_computed_style *result)
+{
+ int32_t order = 0;
+ uint8_t type = get_order(child, &order);
+
+ if (type == CSS_ORDER_INHERIT) {
+ type = get_order(parent, &order);
+ }
+
+ return set_order(result, type, order);
+}
+
diff --git a/src/select/properties/properties.h b/src/select/properties/properties.h
index a1ab49f..6eac397 100644
--- a/src/select/properties/properties.h
+++ b/src/select/properties/properties.h
@@ -21,6 +21,9 @@
css_error css__compose_##pname (const css_computed_style *parent, const css_computed_style *child, css_computed_style *result); \
uint32_t destroy_##pname (void *bytecode)
+PROPERTY_FUNCS(align_content);
+PROPERTY_FUNCS(align_items);
+PROPERTY_FUNCS(align_self);
PROPERTY_FUNCS(azimuth);
PROPERTY_FUNCS(background_attachment);
PROPERTY_FUNCS(background_color);
@@ -68,6 +71,11 @@ PROPERTY_FUNCS(direction);
PROPERTY_FUNCS(display);
PROPERTY_FUNCS(elevation);
PROPERTY_FUNCS(empty_cells);
+PROPERTY_FUNCS(flex_basis);
+PROPERTY_FUNCS(flex_direction);
+PROPERTY_FUNCS(flex_grow);
+PROPERTY_FUNCS(flex_shrink);
+PROPERTY_FUNCS(flex_wrap);
PROPERTY_FUNCS(float);
PROPERTY_FUNCS(font_family);
PROPERTY_FUNCS(font_size);
@@ -75,6 +83,7 @@ PROPERTY_FUNCS(font_style);
PROPERTY_FUNCS(font_variant);
PROPERTY_FUNCS(font_weight);
PROPERTY_FUNCS(height);
+PROPERTY_FUNCS(justify_content);
PROPERTY_FUNCS(left);
PROPERTY_FUNCS(letter_spacing);
PROPERTY_FUNCS(line_height);
@@ -90,6 +99,7 @@ PROPERTY_FUNCS(max_width);
PROPERTY_FUNCS(min_height);
PROPERTY_FUNCS(min_width);
PROPERTY_FUNCS(opacity);
+PROPERTY_FUNCS(order);
PROPERTY_FUNCS(orphans);
PROPERTY_FUNCS(outline_color);
PROPERTY_FUNCS(outline_style);
diff --git a/src/select/propget.h b/src/select/propget.h
index 6719443..41298f1 100644
--- a/src/select/propget.h
+++ b/src/select/propget.h
@@ -10,2183 +10,6 @@
#include <libcss/computed.h>
#include "computed.h"
-
-/* Important: keep this file in sync with computed.h */
-/** \todo Is there a better way to ensure this happens? */
-
-#define LETTER_SPACING_INDEX 0
-#define LETTER_SPACING_SHIFT 2
-#define LETTER_SPACING_MASK 0xfc
-static inline uint8_t get_letter_spacing(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[LETTER_SPACING_INDEX];
- bits &= LETTER_SPACING_MASK;
- bits >>= LETTER_SPACING_SHIFT;
-
- /* 6bits: uuuutt : unit | type */
-
- if ((bits & 3) == CSS_LETTER_SPACING_SET) {
- *length = style->i.uncommon->i.letter_spacing;
- *unit = bits >> 2;
- }
-
- return (bits & 3);
- }
-
- /* Initial value */
- return CSS_LETTER_SPACING_NORMAL;
-}
-#undef LETTER_SPACING_MASK
-#undef LETTER_SPACING_SHIFT
-#undef LETTER_SPACING_INDEX
-
-#define OUTLINE_COLOR_INDEX 0
-#define OUTLINE_COLOR_SHIFT 0
-#define OUTLINE_COLOR_MASK 0x3
-static inline uint8_t get_outline_color(
- const css_computed_style *style, css_color *color)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[OUTLINE_COLOR_INDEX];
- bits &= OUTLINE_COLOR_MASK;
- bits >>= OUTLINE_COLOR_SHIFT;
-
- /* 2bits: tt : type */
-
- if ((bits & 3) == CSS_OUTLINE_COLOR_COLOR) {
- *color = style->i.uncommon->i.outline_color;
- }
-
- return (bits & 3);
- }
-
- /* Initial value */
- return CSS_OUTLINE_COLOR_INVERT;
-}
-#undef OUTLINE_COLOR_MASK
-#undef OUTLINE_COLOR_SHIFT
-#undef OUTLINE_COLOR_INDEX
-
-#define OUTLINE_WIDTH_INDEX 1
-#define OUTLINE_WIDTH_SHIFT 1
-#define OUTLINE_WIDTH_MASK 0xfe
-static inline uint8_t get_outline_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[OUTLINE_WIDTH_INDEX];
- bits &= OUTLINE_WIDTH_MASK;
- bits >>= OUTLINE_WIDTH_SHIFT;
-
- /* 7bits: uuuuttt : unit | type */
-
- if ((bits & 7) == CSS_OUTLINE_WIDTH_WIDTH) {
- *length = style->i.uncommon->i.outline_width;
- *unit = bits >> 3;
- }
-
- return (bits & 7);
- }
-
- /* Initial value */
- return CSS_OUTLINE_WIDTH_MEDIUM;
-}
-#undef OUTLINE_WIDTH_MASK
-#undef OUTLINE_WIDTH_SHIFT
-#undef OUTLINE_WIDTH_INDEX
-
-#define BORDER_SPACING_INDEX 1
-#define BORDER_SPACING_SHIFT 0
-#define BORDER_SPACING_MASK 0x1
-#define BORDER_SPACING_INDEX1 2
-#define BORDER_SPACING_SHIFT1 0
-#define BORDER_SPACING_MASK1 0xff
-static inline uint8_t get_border_spacing(
- const css_computed_style *style,
- css_fixed *hlength, css_unit *hunit,
- css_fixed *vlength, css_unit *vunit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[BORDER_SPACING_INDEX];
- bits &= BORDER_SPACING_MASK;
- bits >>= BORDER_SPACING_SHIFT;
-
- /* 1 bit: type */
- if (bits == CSS_BORDER_SPACING_SET) {
- uint8_t bits1 =
- style->i.uncommon->i.bits[BORDER_SPACING_INDEX1];
- bits1 &= BORDER_SPACING_MASK1;
- bits1 >>= BORDER_SPACING_SHIFT1;
-
- /* 8bits: hhhhvvvv : hunit | vunit */
-
- *hlength = style->i.uncommon->i.border_spacing[0];
- *hunit = bits1 >> 4;
-
- *vlength = style->i.uncommon->i.border_spacing[1];
- *vunit = bits1 & 0xf;
- }
-
- return bits;
- }
-
- /* Initial value */
- *hlength = *vlength = 0;
- *hunit = *vunit = CSS_UNIT_PX;
- return CSS_BORDER_SPACING_SET;
-}
-#undef BORDER_SPACING_MASK1
-#undef BORDER_SPACING_SHIFT1
-#undef BORDER_SPACING_INDEX1
-#undef BORDER_SPACING_MASK
-#undef BORDER_SPACING_SHIFT
-#undef BORDER_SPACING_INDEX
-
-#define BREAK_AFTER_INDEX 12
-#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) {
- uint8_t bits = style->i.uncommon->i.bits[BREAK_AFTER_INDEX];
- bits &= BREAK_AFTER_MASK;
- bits >>= BREAK_AFTER_SHIFT;
-
- /* 4bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_BREAK_AFTER_AUTO;
-}
-#undef BREAK_AFTER_MASK
-#undef BREAK_AFTER_SHIFT
-#undef BREAK_AFTER_INDEX
-
-#define BREAK_BEFORE_INDEX 12
-#define BREAK_BEFORE_SHIFT 4
-#define BREAK_BEFORE_MASK (0xf << 4)
-static inline uint8_t get_break_before(
- const css_computed_style *style)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[BREAK_BEFORE_INDEX];
- bits &= BREAK_BEFORE_MASK;
- bits >>= BREAK_BEFORE_SHIFT;
-
- /* 4bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_BREAK_BEFORE_AUTO;
-}
-#undef BREAK_BEFORE_MASK
-#undef BREAK_BEFORE_SHIFT
-#undef BREAK_BEFORE_INDEX
-
-#define BREAK_INSIDE_INDEX 13
-#define BREAK_INSIDE_SHIFT 4
-#define BREAK_INSIDE_MASK (0xf << 4)
-static inline uint8_t get_break_inside(
- const css_computed_style *style)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[BREAK_INSIDE_INDEX];
- bits &= BREAK_INSIDE_MASK;
- bits >>= BREAK_INSIDE_SHIFT;
-
- /* 4bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_BREAK_INSIDE_AUTO;
-}
-#undef BREAK_INSIDE_MASK
-#undef BREAK_INSIDE_SHIFT
-#undef BREAK_INSIDE_INDEX
-
-#define WORD_SPACING_INDEX 3
-#define WORD_SPACING_SHIFT 2
-#define WORD_SPACING_MASK 0xfc
-static inline uint8_t get_word_spacing(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[WORD_SPACING_INDEX];
- bits &= WORD_SPACING_MASK;
- bits >>= WORD_SPACING_SHIFT;
-
- /* 6bits: uuuutt : unit | type */
-
- if ((bits & 3) == CSS_WORD_SPACING_SET) {
- *length = style->i.uncommon->i.word_spacing;
- *unit = bits >> 2;
- }
-
- return (bits & 3);
- }
-
- /* Initial value */
- return CSS_WORD_SPACING_NORMAL;
-}
-#undef WORD_SPACING_MASK
-#undef WORD_SPACING_SHIFT
-#undef WORD_SPACING_INDEX
-
-#define WRITING_MODE_INDEX 4
-#define WRITING_MODE_MASK 0x6
-#define WRITING_MODE_SHIFT 1
-static inline uint8_t get_writing_mode(
- const css_computed_style *style)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[WRITING_MODE_INDEX];
- bits &= WRITING_MODE_MASK;
- bits >>= WRITING_MODE_SHIFT;
-
- /* 2bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_WRITING_MODE_HORIZONTAL_TB;
-}
-#undef WRITING_MODE_INDEX
-#undef WRITING_MODE_MASK
-#undef WRITING_MODE_SHIFT
-
-#define COUNTER_INCREMENT_INDEX 3
-#define COUNTER_INCREMENT_SHIFT 1
-#define COUNTER_INCREMENT_MASK 0x2
-static inline uint8_t get_counter_increment(
- const css_computed_style *style,
- const css_computed_counter **counters)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COUNTER_INCREMENT_INDEX];
- bits &= COUNTER_INCREMENT_MASK;
- bits >>= COUNTER_INCREMENT_SHIFT;
-
- /* 1bit: type */
- *counters = style->i.uncommon->counter_increment;
-
- return bits;
- }
-
- /* Initial value */
- return CSS_COUNTER_INCREMENT_NONE;
-}
-#undef COUNTER_INCREMENT_MASK
-#undef COUNTER_INCREMENT_SHIFT
-#undef COUNTER_INCREMENT_INDEX
-
-#define COUNTER_RESET_INDEX 3
-#define COUNTER_RESET_SHIFT 0
-#define COUNTER_RESET_MASK 0x1
-static inline uint8_t get_counter_reset(
- const css_computed_style *style,
- const css_computed_counter **counters)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COUNTER_RESET_INDEX];
- bits &= COUNTER_RESET_MASK;
- bits >>= COUNTER_RESET_SHIFT;
-
- /* 1bit: type */
- *counters = style->i.uncommon->counter_reset;
-
- return bits;
- }
-
- /* Initial value */
- return CSS_COUNTER_RESET_NONE;
-}
-#undef COUNTER_RESET_MASK
-#undef COUNTER_RESET_SHIFT
-#undef COUNTER_RESET_INDEX
-
-#define CURSOR_INDEX 4
-#define CURSOR_SHIFT 3
-#define CURSOR_MASK 0xf8
-static inline uint8_t get_cursor(
- const css_computed_style *style,
- lwc_string ***urls)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[CURSOR_INDEX];
- bits &= CURSOR_MASK;
- bits >>= CURSOR_SHIFT;
-
- /* 5bits: type */
- *urls = style->i.uncommon->cursor;
-
- return bits;
- }
-
- /* Initial value */
- return CSS_CURSOR_AUTO;
-}
-#undef CURSOR_MASK
-#undef CURSOR_SHIFT
-#undef CURSOR_INDEX
-
-#define CLIP_INDEX 7
-#define CLIP_SHIFT 2
-#define CLIP_MASK 0xfc
-#define CLIP_INDEX1 5
-#define CLIP_SHIFT1 0
-#define CLIP_MASK1 0xff
-#define CLIP_INDEX2 6
-#define CLIP_SHIFT2 0
-#define CLIP_MASK2 0xff
-static inline uint8_t get_clip(
- const css_computed_style *style,
- css_computed_clip_rect *rect)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[CLIP_INDEX];
- bits &= CLIP_MASK;
- bits >>= CLIP_SHIFT;
-
- /* 6bits: trblyy : top | right | bottom | left | type */
- if ((bits & 0x3) == CSS_CLIP_RECT) {
- uint8_t bits1;
-
- rect->left_auto = (bits & 0x4);
- rect->bottom_auto = (bits & 0x8);
- rect->right_auto = (bits & 0x10);
- rect->top_auto = (bits & 0x20);
-
- if (rect->top_auto == false ||
- rect->right_auto == false) {
- /* 8bits: ttttrrrr : top | right */
- bits1 = style->i.uncommon->i.bits[CLIP_INDEX1];
- bits1 &= CLIP_MASK1;
- bits1 >>= CLIP_SHIFT1;
- } else {
- bits1 = 0;
- }
-
- rect->top = style->i.uncommon->i.clip[0];
- rect->tunit = bits1 >> 4;
-
- rect->right = style->i.uncommon->i.clip[1];
- rect->runit = bits1 & 0xf;
-
- if (rect->bottom_auto == false ||
- rect->left_auto == false) {
- /* 8bits: bbbbllll : bottom | left */
- bits1 = style->i.uncommon->i.bits[CLIP_INDEX2];
- bits1 &= CLIP_MASK2;
- bits1 >>= CLIP_SHIFT2;
- } else {
- bits1 = 0;
- }
-
- rect->bottom = style->i.uncommon->i.clip[2];
- rect->bunit = bits1 >> 4;
-
- rect->left = style->i.uncommon->i.clip[3];
- rect->lunit = bits1 & 0xf;
- }
-
- return (bits & 0x3);
- }
-
- /* Initial value */
- return CSS_CLIP_AUTO;
-}
-#undef CLIP_MASK2
-#undef CLIP_SHIFT2
-#undef CLIP_INDEX2
-#undef CLIP_MASK1
-#undef CLIP_SHIFT1
-#undef CLIP_INDEX1
-#undef CLIP_MASK
-#undef CLIP_SHIFT
-#undef CLIP_INDEX
-
-#define COLUMN_COUNT_INDEX 8
-#define COLUMN_COUNT_SHIFT 6
-#define COLUMN_COUNT_MASK 0xc0
-static inline uint8_t get_column_count(
- const css_computed_style *style, int32_t *count)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_COUNT_INDEX];
- bits &= COLUMN_COUNT_MASK;
- bits >>= COLUMN_COUNT_SHIFT;
-
- /* 2bits: tt : type */
- *count = style->i.uncommon->i.column_count;
-
- return bits;
- }
-
- /* Initial value */
- return CSS_COLUMN_COUNT_AUTO;
-}
-#undef COLUMN_COUNT_MASK
-#undef COLUMN_COUNT_SHIFT
-#undef COLUMN_COUNT_INDEX
-
-#define COLUMN_FILL_INDEX 8
-#define COLUMN_FILL_SHIFT 4
-#define COLUMN_FILL_MASK 0x30
-static inline uint8_t get_column_fill(
- const css_computed_style *style)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_FILL_INDEX];
- bits &= COLUMN_FILL_MASK;
- bits >>= COLUMN_FILL_SHIFT;
-
- /* 2bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_COLUMN_FILL_BALANCE;
-}
-#undef COLUMN_FILL_MASK
-#undef COLUMN_FILL_SHIFT
-#undef COLUMN_FILL_INDEX
-
-#define COLUMN_GAP_INDEX 9
-#define COLUMN_GAP_SHIFT 2
-#define COLUMN_GAP_MASK 0xfc
-static inline uint8_t get_column_gap(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_GAP_INDEX];
- bits &= COLUMN_GAP_MASK;
- bits >>= COLUMN_GAP_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_COLUMN_GAP_SET) {
- *length = style->i.uncommon->i.column_gap;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
- }
-
- /* Initial value */
- return CSS_COLUMN_GAP_NORMAL;
-}
-#undef COLUMN_GAP_MASK
-#undef COLUMN_GAP_SHIFT
-#undef COLUMN_GAP_INDEX
-
-#define COLUMN_RULE_COLOR_INDEX 9
-#define COLUMN_RULE_COLOR_SHIFT 0
-#define COLUMN_RULE_COLOR_MASK 0x3
-static inline uint8_t get_column_rule_color(
- const css_computed_style *style,
- css_color *color)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_RULE_COLOR_INDEX];
- bits &= COLUMN_RULE_COLOR_MASK;
- bits >>= COLUMN_RULE_COLOR_SHIFT;
-
- /* 2bits: type */
- *color = style->i.uncommon->i.column_rule_color;
-
- return bits;
- }
-
- /* Initial value */
- *color = 0;
- return CSS_COLUMN_RULE_COLOR_CURRENT_COLOR;
-}
-#undef COLUMN_RULE_COLOR_MASK
-#undef COLUMN_RULE_COLOR_SHIFT
-#undef COLUMN_RULE_COLOR_INDEX
-
-#define COLUMN_RULE_STYLE_INDEX 8
-#define COLUMN_RULE_STYLE_SHIFT 0
-#define COLUMN_RULE_STYLE_MASK 0xf
-static inline uint8_t get_column_rule_style(
- const css_computed_style *style)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_RULE_STYLE_INDEX];
- bits &= COLUMN_RULE_STYLE_MASK;
- bits >>= COLUMN_RULE_STYLE_SHIFT;
-
- /* 4bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_COLUMN_RULE_STYLE_NONE;
-}
-#undef COLUMN_RULE_STYLE_MASK
-#undef COLUMN_RULE_STYLE_SHIFT
-#undef COLUMN_RULE_STYLE_INDEX
-
-#define COLUMN_RULE_WIDTH_INDEX 10
-#define COLUMN_RULE_WIDTH_SHIFT 1
-#define COLUMN_RULE_WIDTH_MASK 0xfe
-static inline uint8_t get_column_rule_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_RULE_WIDTH_INDEX];
- bits &= COLUMN_RULE_WIDTH_MASK;
- bits >>= COLUMN_RULE_WIDTH_SHIFT;
-
- /* 7bits: uuuuttt : units | type */
- if ((bits & 0x7) == CSS_COLUMN_RULE_WIDTH_WIDTH) {
- *length = style->i.uncommon->i.column_rule_width;
- *unit = bits >> 3;
- }
-
- return (bits & 0x7);
- }
-
- /* Initial value */
- return CSS_COLUMN_RULE_WIDTH_MEDIUM;
-}
-#undef COLUMN_RULE_WIDTH_MASK
-#undef COLUMN_RULE_WIDTH_SHIFT
-#undef COLUMN_RULE_WIDTH_INDEX
-
-#define COLUMN_SPAN_INDEX 11
-#define COLUMN_SPAN_SHIFT 6
-#define COLUMN_SPAN_MASK 0xc0
-static inline uint8_t get_column_span(
- const css_computed_style *style)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_SPAN_INDEX];
- bits &= COLUMN_SPAN_MASK;
- bits >>= COLUMN_SPAN_SHIFT;
-
- /* 2bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_COLUMN_SPAN_NONE;
-}
-#undef COLUMN_SPAN_MASK
-#undef COLUMN_SPAN_SHIFT
-#undef COLUMN_SPAN_INDEX
-
-#define COLUMN_WIDTH_INDEX 11
-#define COLUMN_WIDTH_SHIFT 0
-#define COLUMN_WIDTH_MASK 0x3f
-static inline uint8_t get_column_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[COLUMN_WIDTH_INDEX];
- bits &= COLUMN_WIDTH_MASK;
- bits >>= COLUMN_WIDTH_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_COLUMN_WIDTH_SET) {
- *length = style->i.uncommon->i.column_width;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
- }
-
- /* Initial value */
- return CSS_COLUMN_WIDTH_AUTO;
-}
-#undef COLUMN_WIDTH_MASK
-#undef COLUMN_WIDTH_SHIFT
-#undef COLUMN_WIDTH_INDEX
-
-#define CONTENT_INDEX 7
-#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)
-{
- if (style->i.uncommon != NULL) {
- uint8_t bits = style->i.uncommon->i.bits[CONTENT_INDEX];
- bits &= CONTENT_MASK;
- bits >>= CONTENT_SHIFT;
-
- /* 2bits: type */
- *content = style->i.uncommon->content;
-
- return bits;
- }
-
- /* Initial value */
- return CSS_CONTENT_NORMAL;
-}
-#undef CONTENT_MASK
-#undef CONTENT_SHIFT
-#undef CONTENT_INDEX
-
-#define VERTICAL_ALIGN_INDEX 0
-#define VERTICAL_ALIGN_SHIFT 0
-#define VERTICAL_ALIGN_MASK 0xff
-static inline uint8_t get_vertical_align(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[VERTICAL_ALIGN_INDEX];
- bits &= VERTICAL_ALIGN_MASK;
- bits >>= VERTICAL_ALIGN_SHIFT;
-
- /* 8bits: uuuutttt : units | type */
- if ((bits & 0xf) == CSS_VERTICAL_ALIGN_SET) {
- *length = style->i.vertical_align;
- *unit = bits >> 4;
- }
-
- return (bits & 0xf);
-}
-#undef VERTICAL_ALIGN_MASK
-#undef VERTICAL_ALIGN_SHIFT
-#undef VERTICAL_ALIGN_INDEX
-
-#define FONT_SIZE_INDEX 1
-#define FONT_SIZE_SHIFT 0
-#define FONT_SIZE_MASK 0xff
-static inline uint8_t get_font_size(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[FONT_SIZE_INDEX];
- bits &= FONT_SIZE_MASK;
- bits >>= FONT_SIZE_SHIFT;
-
- /* 8bits: uuuutttt : units | type */
- if ((bits & 0xf) == CSS_FONT_SIZE_DIMENSION) {
- *length = style->i.font_size;
- *unit = bits >> 4;
- }
-
- return (bits & 0xf);
-}
-#undef FONT_SIZE_MASK
-#undef FONT_SIZE_SHIFT
-#undef FONT_SIZE_INDEX
-
-#define BORDER_TOP_WIDTH_INDEX 2
-#define BORDER_TOP_WIDTH_SHIFT 1
-#define BORDER_TOP_WIDTH_MASK 0xfe
-static inline uint8_t get_border_top_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[BORDER_TOP_WIDTH_INDEX];
- bits &= BORDER_TOP_WIDTH_MASK;
- bits >>= BORDER_TOP_WIDTH_SHIFT;
-
- /* 7bits: uuuuttt : units | type */
- if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
- *length = style->i.border_width[0];
- *unit = bits >> 3;
- }
-
- return (bits & 0x7);
-}
-#undef BORDER_TOP_WIDTH_MASK
-#undef BORDER_TOP_WIDTH_SHIFT
-#undef BORDER_TOP_WIDTH_INDEX
-
-#define BORDER_RIGHT_WIDTH_INDEX 3
-#define BORDER_RIGHT_WIDTH_SHIFT 1
-#define BORDER_RIGHT_WIDTH_MASK 0xfe
-static inline uint8_t get_border_right_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[BORDER_RIGHT_WIDTH_INDEX];
- bits &= BORDER_RIGHT_WIDTH_MASK;
- bits >>= BORDER_RIGHT_WIDTH_SHIFT;
-
- /* 7bits: uuuuttt : units | type */
- if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
- *length = style->i.border_width[1];
- *unit = bits >> 3;
- }
-
- return (bits & 0x7);
-}
-#undef BORDER_RIGHT_WIDTH_MASK
-#undef BORDER_RIGHT_WIDTH_SHIFT
-#undef BORDER_RIGHT_WIDTH_INDEX
-
-#define BORDER_BOTTOM_WIDTH_INDEX 4
-#define BORDER_BOTTOM_WIDTH_SHIFT 1
-#define BORDER_BOTTOM_WIDTH_MASK 0xfe
-static inline uint8_t get_border_bottom_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[BORDER_BOTTOM_WIDTH_INDEX];
- bits &= BORDER_BOTTOM_WIDTH_MASK;
- bits >>= BORDER_BOTTOM_WIDTH_SHIFT;
-
- /* 7bits: uuuuttt : units | type */
- if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
- *length = style->i.border_width[2];
- *unit = bits >> 3;
- }
-
- return (bits & 0x7);
-}
-#undef BORDER_BOTTOM_WIDTH_MASK
-#undef BORDER_BOTTOM_WIDTH_SHIFT
-#undef BORDER_BOTTOM_WIDTH_INDEX
-
-#define BORDER_LEFT_WIDTH_INDEX 5
-#define BORDER_LEFT_WIDTH_SHIFT 1
-#define BORDER_LEFT_WIDTH_MASK 0xfe
-static inline uint8_t get_border_left_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[BORDER_LEFT_WIDTH_INDEX];
- bits &= BORDER_LEFT_WIDTH_MASK;
- bits >>= BORDER_LEFT_WIDTH_SHIFT;
-
- /* 7bits: uuuuttt : units | type */
- if ((bits & 0x7) == CSS_BORDER_WIDTH_WIDTH) {
- *length = style->i.border_width[3];
- *unit = bits >> 3;
- }
-
- return (bits & 0x7);
-}
-#undef BORDER_LEFT_WIDTH_MASK
-#undef BORDER_LEFT_WIDTH_SHIFT
-#undef BORDER_LEFT_WIDTH_INDEX
-
-#define BACKGROUND_IMAGE_INDEX 2
-#define BACKGROUND_IMAGE_SHIFT 0
-#define BACKGROUND_IMAGE_MASK 0x1
-static inline uint8_t get_background_image(
- const css_computed_style *style,
- lwc_string **url)
-{
- uint8_t bits = style->i.bits[BACKGROUND_IMAGE_INDEX];
- bits &= BACKGROUND_IMAGE_MASK;
- bits >>= BACKGROUND_IMAGE_SHIFT;
-
- /* 1bit: type */
- *url = style->i.background_image;
-
- return bits;
-}
-#undef BACKGROUND_IMAGE_MASK
-#undef BACKGROUND_IMAGE_SHIFT
-#undef BACKGROUND_IMAGE_INDEX
-
-#define COLOR_INDEX 3
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
-static inline uint8_t get_color(
- const css_computed_style *style,
- css_color *color)
-{
- uint8_t bits = style->i.bits[COLOR_INDEX];
- bits &= COLOR_MASK;
- bits >>= COLOR_SHIFT;
-
- /* 1bit: type */
- *color = style->i.color;
-
- return bits;
-}
-#undef COLOR_MASK
-#undef COLOR_SHIFT
-#undef COLOR_INDEX
-
-#define LIST_STYLE_IMAGE_INDEX 4
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
-static inline uint8_t get_list_style_image(
- const css_computed_style *style,
- lwc_string **url)
-{
- uint8_t bits = style->i.bits[LIST_STYLE_IMAGE_INDEX];
- bits &= LIST_STYLE_IMAGE_MASK;
- bits >>= LIST_STYLE_IMAGE_SHIFT;
-
- /* 1bit: type */
- *url = style->i.list_style_image;
-
- return bits;
-}
-#undef LIST_STYLE_IMAGE_MASK
-#undef LIST_STYLE_IMAGE_SHIFT
-#undef LIST_STYLE_IMAGE_INDEX
-
-#define QUOTES_INDEX 5
-#define QUOTES_SHIFT 0
-#define QUOTES_MASK 0x1
-static inline uint8_t get_quotes(
- const css_computed_style *style,
- lwc_string ***quotes)
-{
- uint8_t bits = style->i.bits[QUOTES_INDEX];
- bits &= QUOTES_MASK;
- bits >>= QUOTES_SHIFT;
-
- /* 1bit: type */
- *quotes = style->quotes;
-
- return bits;
-}
-#undef QUOTES_MASK
-#undef QUOTES_SHIFT
-#undef QUOTES_INDEX
-
-#define TOP_INDEX 6
-#define TOP_SHIFT 2
-#define TOP_MASK 0xfc
-static inline uint8_t get_top(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[TOP_INDEX];
- bits &= TOP_MASK;
- bits >>= TOP_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_TOP_SET) {
- *length = style->i.top;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-static inline uint8_t get_top_bits(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[TOP_INDEX];
- bits &= TOP_MASK;
- bits >>= TOP_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- return bits;
-}
-#undef TOP_MASK
-#undef TOP_SHIFT
-#undef TOP_INDEX
-
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 2
-#define RIGHT_MASK 0xfc
-static inline uint8_t get_right(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[RIGHT_INDEX];
- bits &= RIGHT_MASK;
- bits >>= RIGHT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_RIGHT_SET) {
- *length = style->i.right;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-static inline uint8_t get_right_bits(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[RIGHT_INDEX];
- bits &= RIGHT_MASK;
- bits >>= RIGHT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- return bits;
-}
-#undef RIGHT_MASK
-#undef RIGHT_SHIFT
-#undef RIGHT_INDEX
-
-#define BOTTOM_INDEX 8
-#define BOTTOM_SHIFT 2
-#define BOTTOM_MASK 0xfc
-static inline uint8_t get_bottom(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[BOTTOM_INDEX];
- bits &= BOTTOM_MASK;
- bits >>= BOTTOM_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_BOTTOM_SET) {
- *length = style->i.bottom;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-static inline uint8_t get_bottom_bits(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BOTTOM_INDEX];
- bits &= BOTTOM_MASK;
- bits >>= BOTTOM_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- return bits;
-}
-#undef BOTTOM_MASK
-#undef BOTTOM_SHIFT
-#undef BOTTOM_INDEX
-
-#define LEFT_INDEX 9
-#define LEFT_SHIFT 2
-#define LEFT_MASK 0xfc
-static inline uint8_t get_left(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[LEFT_INDEX];
- bits &= LEFT_MASK;
- bits >>= LEFT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_LEFT_SET) {
- *length = style->i.left;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-static inline uint8_t get_left_bits(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[LEFT_INDEX];
- bits &= LEFT_MASK;
- bits >>= LEFT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- return bits;
-}
-#undef LEFT_MASK
-#undef LEFT_SHIFT
-#undef LEFT_INDEX
-
-#define BORDER_TOP_COLOR_INDEX 6
-#define BORDER_TOP_COLOR_SHIFT 0
-#define BORDER_TOP_COLOR_MASK 0x3
-static inline uint8_t get_border_top_color(
- const css_computed_style *style,
- css_color *color)
-{
- uint8_t bits = style->i.bits[BORDER_TOP_COLOR_INDEX];
- bits &= BORDER_TOP_COLOR_MASK;
- bits >>= BORDER_TOP_COLOR_SHIFT;
-
- /* 2bits: type */
- *color = style->i.border_color[0];
-
- return bits;
-}
-#undef BORDER_TOP_COLOR_MASK
-#undef BORDER_TOP_COLOR_SHIFT
-#undef BORDER_TOP_COLOR_INDEX
-
-#define BORDER_RIGHT_COLOR_INDEX 7
-#define BORDER_RIGHT_COLOR_SHIFT 0
-#define BORDER_RIGHT_COLOR_MASK 0x3
-static inline uint8_t get_border_right_color(
- const css_computed_style *style,
- css_color *color)
-{
- uint8_t bits = style->i.bits[BORDER_RIGHT_COLOR_INDEX];
- bits &= BORDER_RIGHT_COLOR_MASK;
- bits >>= BORDER_RIGHT_COLOR_SHIFT;
-
- /* 2bits: type */
- *color = style->i.border_color[1];
-
- return bits;
-}
-#undef BORDER_RIGHT_COLOR_MASK
-#undef BORDER_RIGHT_COLOR_SHIFT
-#undef BORDER_RIGHT_COLOR_INDEX
-
-#define BORDER_BOTTOM_COLOR_INDEX 8
-#define BORDER_BOTTOM_COLOR_SHIFT 0
-#define BORDER_BOTTOM_COLOR_MASK 0x3
-static inline uint8_t get_border_bottom_color(
- const css_computed_style *style,
- css_color *color)
-{
- uint8_t bits = style->i.bits[BORDER_BOTTOM_COLOR_INDEX];
- bits &= BORDER_BOTTOM_COLOR_MASK;
- bits >>= BORDER_BOTTOM_COLOR_SHIFT;
-
- /* 2bits: type */
- *color = style->i.border_color[2];
-
- return bits;
-}
-#undef BORDER_BOTTOM_COLOR_MASK
-#undef BORDER_BOTTOM_COLOR_SHIFT
-#undef BORDER_BOTTOM_COLOR_INDEX
-
-#define BORDER_LEFT_COLOR_INDEX 9
-#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,
- css_color *color)
-{
- uint8_t bits = style->i.bits[BORDER_LEFT_COLOR_INDEX];
- bits &= BORDER_LEFT_COLOR_MASK;
- bits >>= BORDER_LEFT_COLOR_SHIFT;
-
- /* 2bits: type */
- *color = style->i.border_color[3];
-
- return bits;
-}
-#undef BORDER_LEFT_COLOR_MASK
-#undef BORDER_LEFT_COLOR_SHIFT
-#undef BORDER_LEFT_COLOR_INDEX
-
-#define HEIGHT_INDEX 10
-#define HEIGHT_SHIFT 2
-#define HEIGHT_MASK 0xfc
-static inline uint8_t get_height(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[HEIGHT_INDEX];
- bits &= HEIGHT_MASK;
- bits >>= HEIGHT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_HEIGHT_SET) {
- *length = style->i.height;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef HEIGHT_MASK
-#undef HEIGHT_SHIFT
-#undef HEIGHT_INDEX
-
-#define LINE_HEIGHT_INDEX 11
-#define LINE_HEIGHT_SHIFT 2
-#define LINE_HEIGHT_MASK 0xfc
-static inline uint8_t get_line_height(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[LINE_HEIGHT_INDEX];
- bits &= LINE_HEIGHT_MASK;
- bits >>= LINE_HEIGHT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_LINE_HEIGHT_NUMBER ||
- (bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
- *length = style->i.line_height;
- }
-
- if ((bits & 0x3) == CSS_LINE_HEIGHT_DIMENSION) {
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef LINE_HEIGHT_MASK
-#undef LINE_HEIGHT_SHIFT
-#undef LINE_HEIGHT_INDEX
-
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 0
-#define BACKGROUND_COLOR_MASK 0x3
-static inline uint8_t get_background_color(
- const css_computed_style *style,
- css_color *color)
-{
- uint8_t bits = style->i.bits[BACKGROUND_COLOR_INDEX];
- bits &= BACKGROUND_COLOR_MASK;
- bits >>= BACKGROUND_COLOR_SHIFT;
-
- /* 2bits: type */
- *color = style->i.background_color;
-
- return bits;
-}
-#undef BACKGROUND_COLOR_MASK
-#undef BACKGROUND_COLOR_SHIFT
-#undef BACKGROUND_COLOR_INDEX
-
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 0
-#define Z_INDEX_MASK 0x3
-static inline uint8_t get_z_index(
- const css_computed_style *style,
- int32_t *z_index)
-{
- uint8_t bits = style->i.bits[Z_INDEX_INDEX];
- bits &= Z_INDEX_MASK;
- bits >>= Z_INDEX_SHIFT;
-
- /* 2bits: type */
- *z_index = style->i.z_index;
-
- return bits;
-}
-#undef Z_INDEX_MASK
-#undef Z_INDEX_SHIFT
-#undef Z_INDEX_INDEX
-
-#define MARGIN_TOP_INDEX 12
-#define MARGIN_TOP_SHIFT 2
-#define MARGIN_TOP_MASK 0xfc
-static inline uint8_t get_margin_top(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MARGIN_TOP_INDEX];
- bits &= MARGIN_TOP_MASK;
- bits >>= MARGIN_TOP_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_MARGIN_SET) {
- *length = style->i.margin[0];
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef MARGIN_TOP_MASK
-#undef MARGIN_TOP_SHIFT
-#undef MARGIN_TOP_INDEX
-
-#define MARGIN_RIGHT_INDEX 13
-#define MARGIN_RIGHT_SHIFT 2
-#define MARGIN_RIGHT_MASK 0xfc
-static inline uint8_t get_margin_right(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MARGIN_RIGHT_INDEX];
- bits &= MARGIN_RIGHT_MASK;
- bits >>= MARGIN_RIGHT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_MARGIN_SET) {
- *length = style->i.margin[1];
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef MARGIN_RIGHT_MASK
-#undef MARGIN_RIGHT_SHIFT
-#undef MARGIN_RIGHT_INDEX
-
-#define MARGIN_BOTTOM_INDEX 14
-#define MARGIN_BOTTOM_SHIFT 2
-#define MARGIN_BOTTOM_MASK 0xfc
-static inline uint8_t get_margin_bottom(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MARGIN_BOTTOM_INDEX];
- bits &= MARGIN_BOTTOM_MASK;
- bits >>= MARGIN_BOTTOM_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_MARGIN_SET) {
- *length = style->i.margin[2];
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef MARGIN_BOTTOM_MASK
-#undef MARGIN_BOTTOM_SHIFT
-#undef MARGIN_BOTTOM_INDEX
-
-#define MARGIN_LEFT_INDEX 15
-#define MARGIN_LEFT_SHIFT 2
-#define MARGIN_LEFT_MASK 0xfc
-static inline uint8_t get_margin_left(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MARGIN_LEFT_INDEX];
- bits &= MARGIN_LEFT_MASK;
- bits >>= MARGIN_LEFT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_MARGIN_SET) {
- *length = style->i.margin[3];
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef MARGIN_LEFT_MASK
-#undef MARGIN_LEFT_SHIFT
-#undef MARGIN_LEFT_INDEX
-
-#define BACKGROUND_ATTACHMENT_INDEX 12
-#define BACKGROUND_ATTACHMENT_SHIFT 0
-#define BACKGROUND_ATTACHMENT_MASK 0x3
-static inline uint8_t get_background_attachment(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BACKGROUND_ATTACHMENT_INDEX];
- bits &= BACKGROUND_ATTACHMENT_MASK;
- bits >>= BACKGROUND_ATTACHMENT_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef BACKGROUND_ATTACHMENT_MASK
-#undef BACKGROUND_ATTACHMENT_SHIFT
-#undef BACKGROUND_ATTACHMENT_INDEX
-
-#define BOX_SIZING_INDEX 34
-#define BOX_SIZING_SHIFT 0
-#define BOX_SIZING_MASK 0x3
-static inline uint8_t get_box_sizing(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BOX_SIZING_INDEX];
- bits &= BOX_SIZING_MASK;
- bits >>= BOX_SIZING_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef BOX_SIZING_MASK
-#undef BOX_SIZING_SHIFT
-#undef BOX_SIZING_INDEX
-
-#define BORDER_COLLAPSE_INDEX 13
-#define BORDER_COLLAPSE_SHIFT 0
-#define BORDER_COLLAPSE_MASK 0x3
-static inline uint8_t get_border_collapse(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BORDER_COLLAPSE_INDEX];
- bits &= BORDER_COLLAPSE_MASK;
- bits >>= BORDER_COLLAPSE_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef BORDER_COLLAPSE_MASK
-#undef BORDER_COLLAPSE_SHIFT
-#undef BORDER_COLLAPSE_INDEX
-
-#define CAPTION_SIDE_INDEX 14
-#define CAPTION_SIDE_SHIFT 0
-#define CAPTION_SIDE_MASK 0x3
-static inline uint8_t get_caption_side(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[CAPTION_SIDE_INDEX];
- bits &= CAPTION_SIDE_MASK;
- bits >>= CAPTION_SIDE_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef CAPTION_SIDE_MASK
-#undef CAPTION_SIDE_SHIFT
-#undef CAPTION_SIDE_INDEX
-
-#define DIRECTION_INDEX 15
-#define DIRECTION_SHIFT 0
-#define DIRECTION_MASK 0x3
-static inline uint8_t get_direction(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[DIRECTION_INDEX];
- bits &= DIRECTION_MASK;
- bits >>= DIRECTION_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef DIRECTION_MASK
-#undef DIRECTION_SHIFT
-#undef DIRECTION_INDEX
-
-#define MAX_HEIGHT_INDEX 16
-#define MAX_HEIGHT_SHIFT 2
-#define MAX_HEIGHT_MASK 0xfc
-static inline uint8_t get_max_height(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MAX_HEIGHT_INDEX];
- bits &= MAX_HEIGHT_MASK;
- bits >>= MAX_HEIGHT_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_MAX_HEIGHT_SET) {
- *length = style->i.max_height;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef MAX_HEIGHT_MASK
-#undef MAX_HEIGHT_SHIFT
-#undef MAX_HEIGHT_INDEX
-
-#define MAX_WIDTH_INDEX 17
-#define MAX_WIDTH_SHIFT 2
-#define MAX_WIDTH_MASK 0xfc
-static inline uint8_t get_max_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MAX_WIDTH_INDEX];
- bits &= MAX_WIDTH_MASK;
- bits >>= MAX_WIDTH_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_MAX_WIDTH_SET) {
- *length = style->i.max_width;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef MAX_WIDTH_MASK
-#undef MAX_WIDTH_SHIFT
-#undef MAX_WIDTH_INDEX
-
-#define WIDTH_INDEX 18
-#define WIDTH_SHIFT 2
-#define WIDTH_MASK 0xfc
-static inline uint8_t get_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[WIDTH_INDEX];
- bits &= WIDTH_MASK;
- bits >>= WIDTH_SHIFT;
-
- /* 6bits: uuuutt : units | type */
- if ((bits & 0x3) == CSS_WIDTH_SET) {
- *length = style->i.width;
- *unit = bits >> 2;
- }
-
- return (bits & 0x3);
-}
-#undef WIDTH_MASK
-#undef WIDTH_SHIFT
-#undef WIDTH_INDEX
-
-#define EMPTY_CELLS_INDEX 16
-#define EMPTY_CELLS_SHIFT 0
-#define EMPTY_CELLS_MASK 0x3
-static inline uint8_t get_empty_cells(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[EMPTY_CELLS_INDEX];
- bits &= EMPTY_CELLS_MASK;
- bits >>= EMPTY_CELLS_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef EMPTY_CELLS_MASK
-#undef EMPTY_CELLS_SHIFT
-#undef EMPTY_CELLS_INDEX
-
-#define FLOAT_INDEX 17
-#define FLOAT_SHIFT 0
-#define FLOAT_MASK 0x3
-static inline uint8_t get_float(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[FLOAT_INDEX];
- bits &= FLOAT_MASK;
- bits >>= FLOAT_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef FLOAT_MASK
-#undef FLOAT_SHIFT
-#undef FLOAT_INDEX
-
-#define FONT_STYLE_INDEX 18
-#define FONT_STYLE_SHIFT 0
-#define FONT_STYLE_MASK 0x3
-static inline uint8_t get_font_style(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[FONT_STYLE_INDEX];
- bits &= FONT_STYLE_MASK;
- bits >>= FONT_STYLE_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef FONT_STYLE_MASK
-#undef FONT_STYLE_SHIFT
-#undef FONT_STYLE_INDEX
-
-#define MIN_HEIGHT_INDEX 19
-#define MIN_HEIGHT_SHIFT 3
-#define MIN_HEIGHT_MASK 0xf8
-static inline uint8_t get_min_height(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MIN_HEIGHT_INDEX];
- bits &= MIN_HEIGHT_MASK;
- bits >>= MIN_HEIGHT_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_MIN_HEIGHT_SET) {
- *length = style->i.min_height;
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef MIN_HEIGHT_MASK
-#undef MIN_HEIGHT_SHIFT
-#undef MIN_HEIGHT_INDEX
-
-#define MIN_WIDTH_INDEX 20
-#define MIN_WIDTH_SHIFT 3
-#define MIN_WIDTH_MASK 0xf8
-static inline uint8_t get_min_width(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[MIN_WIDTH_INDEX];
- bits &= MIN_WIDTH_MASK;
- bits >>= MIN_WIDTH_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_MIN_WIDTH_SET) {
- *length = style->i.min_width;
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef MIN_WIDTH_MASK
-#undef MIN_WIDTH_SHIFT
-#undef MIN_WIDTH_INDEX
-
-#define BACKGROUND_REPEAT_INDEX 19
-#define BACKGROUND_REPEAT_SHIFT 0
-#define BACKGROUND_REPEAT_MASK 0x7
-static inline uint8_t get_background_repeat(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BACKGROUND_REPEAT_INDEX];
- bits &= BACKGROUND_REPEAT_MASK;
- bits >>= BACKGROUND_REPEAT_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef BACKGROUND_REPEAT_MASK
-#undef BACKGROUND_REPEAT_SHIFT
-#undef BACKGROUND_REPEAT_INDEX
-
-#define CLEAR_INDEX 20
-#define CLEAR_SHIFT 0
-#define CLEAR_MASK 0x7
-static inline uint8_t get_clear(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[CLEAR_INDEX];
- bits &= CLEAR_MASK;
- bits >>= CLEAR_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef CLEAR_MASK
-#undef CLEAR_SHIFT
-#undef CLEAR_INDEX
-
-#define PADDING_TOP_INDEX 21
-#define PADDING_TOP_SHIFT 3
-#define PADDING_TOP_MASK 0xf8
-static inline uint8_t get_padding_top(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[PADDING_TOP_INDEX];
- bits &= PADDING_TOP_MASK;
- bits >>= PADDING_TOP_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_PADDING_SET) {
- *length = style->i.padding[0];
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef PADDING_TOP_MASK
-#undef PADDING_TOP_SHIFT
-#undef PADDING_TOP_INDEX
-
-#define PADDING_RIGHT_INDEX 22
-#define PADDING_RIGHT_SHIFT 3
-#define PADDING_RIGHT_MASK 0xf8
-static inline uint8_t get_padding_right(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[PADDING_RIGHT_INDEX];
- bits &= PADDING_RIGHT_MASK;
- bits >>= PADDING_RIGHT_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_PADDING_SET) {
- *length = style->i.padding[1];
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef PADDING_RIGHT_MASK
-#undef PADDING_RIGHT_SHIFT
-#undef PADDING_RIGHT_INDEX
-
-#define PADDING_BOTTOM_INDEX 23
-#define PADDING_BOTTOM_SHIFT 3
-#define PADDING_BOTTOM_MASK 0xf8
-static inline uint8_t get_padding_bottom(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[PADDING_BOTTOM_INDEX];
- bits &= PADDING_BOTTOM_MASK;
- bits >>= PADDING_BOTTOM_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_PADDING_SET) {
- *length = style->i.padding[2];
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef PADDING_BOTTOM_MASK
-#undef PADDING_BOTTOM_SHIFT
-#undef PADDING_BOTTOM_INDEX
-
-#define PADDING_LEFT_INDEX 24
-#define PADDING_LEFT_SHIFT 3
-#define PADDING_LEFT_MASK 0xf8
-static inline uint8_t get_padding_left(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[PADDING_LEFT_INDEX];
- bits &= PADDING_LEFT_MASK;
- bits >>= PADDING_LEFT_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_PADDING_SET) {
- *length = style->i.padding[3];
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef PADDING_LEFT_MASK
-#undef PADDING_LEFT_SHIFT
-#undef PADDING_LEFT_INDEX
-
-#define OVERFLOW_X_INDEX 21
-#define OVERFLOW_X_SHIFT 0
-#define OVERFLOW_X_MASK 0x7
-static inline uint8_t get_overflow_x(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[OVERFLOW_X_INDEX];
- bits &= OVERFLOW_X_MASK;
- bits >>= OVERFLOW_X_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef OVERFLOW_X_MASK
-#undef OVERFLOW_X_SHIFT
-#undef OVERFLOW_X_INDEX
-
-#define OVERFLOW_Y_INDEX 34
-#define OVERFLOW_Y_SHIFT 5
-#define OVERFLOW_Y_MASK 0xe0
-static inline uint8_t get_overflow_y(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[OVERFLOW_Y_INDEX];
- bits &= OVERFLOW_Y_MASK;
- bits >>= OVERFLOW_Y_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef OVERFLOW_Y_MASK
-#undef OVERFLOW_Y_SHIFT
-#undef OVERFLOW_Y_INDEX
-
-#define POSITION_INDEX 22
-#define POSITION_SHIFT 0
-#define POSITION_MASK 0x7
-static inline uint8_t get_position(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[POSITION_INDEX];
- bits &= POSITION_MASK;
- bits >>= POSITION_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef POSITION_MASK
-#undef POSITION_SHIFT
-#undef POSITION_INDEX
-
-#define OPACITY_INDEX 23
-#define OPACITY_SHIFT 2
-#define OPACITY_MASK 0x04
-static inline uint8_t get_opacity(
- const css_computed_style *style,
- css_fixed *opacity)
-{
- uint8_t bits = style->i.bits[OPACITY_INDEX];
- bits &= OPACITY_MASK;
- bits >>= OPACITY_SHIFT;
-
- /* 1bit: t : type */
- if ((bits & 0x1) == CSS_OPACITY_SET) {
- *opacity = style->i.opacity;
- }
-
- return (bits & 0x1);
-}
-#undef OPACITY_MASK
-#undef OPACITY_SHIFT
-#undef OPACITY_INDEX
-
-#define TEXT_TRANSFORM_INDEX 24
-#define TEXT_TRANSFORM_SHIFT 0
-#define TEXT_TRANSFORM_MASK 0x7
-static inline uint8_t get_text_transform(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[TEXT_TRANSFORM_INDEX];
- bits &= TEXT_TRANSFORM_MASK;
- bits >>= TEXT_TRANSFORM_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef TEXT_TRANSFORM_MASK
-#undef TEXT_TRANSFORM_SHIFT
-#undef TEXT_TRANSFORM_INDEX
-
-#define TEXT_INDENT_INDEX 25
-#define TEXT_INDENT_SHIFT 3
-#define TEXT_INDENT_MASK 0xf8
-static inline uint8_t get_text_indent(
- const css_computed_style *style,
- css_fixed *length, css_unit *unit)
-{
- uint8_t bits = style->i.bits[TEXT_INDENT_INDEX];
- bits &= TEXT_INDENT_MASK;
- bits >>= TEXT_INDENT_SHIFT;
-
- /* 5bits: uuuut : units | type */
- if ((bits & 0x1) == CSS_TEXT_INDENT_SET) {
- *length = style->i.text_indent;
- *unit = bits >> 1;
- }
-
- return (bits & 0x1);
-}
-#undef TEXT_INDENT_MASK
-#undef TEXT_INDENT_SHIFT
-#undef TEXT_INDENT_INDEX
-
-#define WHITE_SPACE_INDEX 25
-#define WHITE_SPACE_SHIFT 0
-#define WHITE_SPACE_MASK 0x7
-static inline uint8_t get_white_space(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[WHITE_SPACE_INDEX];
- bits &= WHITE_SPACE_MASK;
- bits >>= WHITE_SPACE_SHIFT;
-
- /* 3bits: type */
- return bits;
-}
-#undef WHITE_SPACE_MASK
-#undef WHITE_SPACE_SHIFT
-#undef WHITE_SPACE_INDEX
-
-#define BACKGROUND_POSITION_INDEX 27
-#define BACKGROUND_POSITION_SHIFT 7
-#define BACKGROUND_POSITION_MASK 0x80
-#define BACKGROUND_POSITION_INDEX1 26
-#define BACKGROUND_POSITION_SHIFT1 0
-#define BACKGROUND_POSITION_MASK1 0xff
-static inline uint8_t get_background_position(
- const css_computed_style *style,
- css_fixed *hlength, css_unit *hunit,
- css_fixed *vlength, css_unit *vunit)
-{
- uint8_t bits = style->i.bits[BACKGROUND_POSITION_INDEX];
- bits &= BACKGROUND_POSITION_MASK;
- bits >>= BACKGROUND_POSITION_SHIFT;
-
- /* 1bit: type */
- if (bits == CSS_BACKGROUND_POSITION_SET) {
- uint8_t bits1 = style->i.bits[BACKGROUND_POSITION_INDEX1];
- bits1 &= BACKGROUND_POSITION_MASK1;
- bits1 >>= BACKGROUND_POSITION_SHIFT1;
-
- /* 8bits: hhhhvvvv : hunit | vunit */
- *hlength = style->i.background_position[0];
- *hunit = bits1 >> 4;
-
- *vlength = style->i.background_position[1];
- *vunit = bits1 & 0xf;
- }
-
- return bits;
-}
-#undef BACKGROUND_POSITION_MASK1
-#undef BACKGROUND_POSITION_SHIFT1
-#undef BACKGROUND_POSITION_INDEX1
-#undef BACKGROUND_POSITION_MASK
-#undef BACKGROUND_POSITION_SHIFT
-#undef BACKGROUND_POSITION_INDEX
-
-#define DISPLAY_INDEX 27
-#define DISPLAY_SHIFT 2
-#define DISPLAY_MASK 0x7c
-static inline uint8_t get_display(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[DISPLAY_INDEX];
- bits &= DISPLAY_MASK;
- bits >>= DISPLAY_SHIFT;
-
- /* 5bits: type */
- return bits;
-}
-#undef DISPLAY_MASK
-#undef DISPLAY_SHIFT
-#undef DISPLAY_INDEX
-
-#define FONT_VARIANT_INDEX 27
-#define FONT_VARIANT_SHIFT 0
-#define FONT_VARIANT_MASK 0x3
-static inline uint8_t get_font_variant(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[FONT_VARIANT_INDEX];
- bits &= FONT_VARIANT_MASK;
- bits >>= FONT_VARIANT_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef FONT_VARIANT_MASK
-#undef FONT_VARIANT_SHIFT
-#undef FONT_VARIANT_INDEX
-
-#define TEXT_DECORATION_INDEX 28
-#define TEXT_DECORATION_SHIFT 3
-#define TEXT_DECORATION_MASK 0xf8
-static inline uint8_t get_text_decoration(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[TEXT_DECORATION_INDEX];
- bits &= TEXT_DECORATION_MASK;
- bits >>= TEXT_DECORATION_SHIFT;
-
- /* 5bits: type */
- return bits;
-}
-#undef TEXT_DECORATION_MASK
-#undef TEXT_DECORATION_SHIFT
-#undef TEXT_DECORATION_INDEX
-
-#define FONT_FAMILY_INDEX 28
-#define FONT_FAMILY_SHIFT 0
-#define FONT_FAMILY_MASK 0x7
-static inline uint8_t get_font_family(
- const css_computed_style *style,
- lwc_string ***names)
-{
- uint8_t bits = style->i.bits[FONT_FAMILY_INDEX];
- bits &= FONT_FAMILY_MASK;
- bits >>= FONT_FAMILY_SHIFT;
-
- /* 3bits: type */
- *names = style->font_family;
-
- return bits;
-}
-#undef FONT_FAMILY_MASK
-#undef FONT_FAMILY_SHIFT
-#undef FONT_FAMILY_INDEX
-
-#define BORDER_TOP_STYLE_INDEX 29
-#define BORDER_TOP_STYLE_SHIFT 4
-#define BORDER_TOP_STYLE_MASK 0xf0
-static inline uint8_t get_border_top_style(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BORDER_TOP_STYLE_INDEX];
- bits &= BORDER_TOP_STYLE_MASK;
- bits >>= BORDER_TOP_STYLE_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef BORDER_TOP_STYLE_MASK
-#undef BORDER_TOP_STYLE_SHIFT
-#undef BORDER_TOP_STYLE_INDEX
-
-#define BORDER_RIGHT_STYLE_INDEX 29
-#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)
-{
- uint8_t bits = style->i.bits[BORDER_RIGHT_STYLE_INDEX];
- bits &= BORDER_RIGHT_STYLE_MASK;
- bits >>= BORDER_RIGHT_STYLE_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef BORDER_RIGHT_STYLE_MASK
-#undef BORDER_RIGHT_STYLE_SHIFT
-#undef BORDER_RIGHT_STYLE_INDEX
-
-#define BORDER_BOTTOM_STYLE_INDEX 30
-#define BORDER_BOTTOM_STYLE_SHIFT 4
-#define BORDER_BOTTOM_STYLE_MASK 0xf0
-static inline uint8_t get_border_bottom_style(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
- bits &= BORDER_BOTTOM_STYLE_MASK;
- bits >>= BORDER_BOTTOM_STYLE_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef BORDER_BOTTOM_STYLE_MASK
-#undef BORDER_BOTTOM_STYLE_SHIFT
-#undef BORDER_BOTTOM_STYLE_INDEX
-
-#define BORDER_LEFT_STYLE_INDEX 30
-#define BORDER_LEFT_STYLE_SHIFT 0
-#define BORDER_LEFT_STYLE_MASK 0xf
-static inline uint8_t get_border_left_style(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[BORDER_LEFT_STYLE_INDEX];
- bits &= BORDER_LEFT_STYLE_MASK;
- bits >>= BORDER_LEFT_STYLE_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef BORDER_LEFT_STYLE_MASK
-#undef BORDER_LEFT_STYLE_SHIFT
-#undef BORDER_LEFT_STYLE_INDEX
-
-#define FONT_WEIGHT_INDEX 31
-#define FONT_WEIGHT_SHIFT 4
-#define FONT_WEIGHT_MASK 0xf0
-static inline uint8_t get_font_weight(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[FONT_WEIGHT_INDEX];
- bits &= FONT_WEIGHT_MASK;
- bits >>= FONT_WEIGHT_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef FONT_WEIGHT_MASK
-#undef FONT_WEIGHT_SHIFT
-#undef FONT_WEIGHT_INDEX
-
-#define LIST_STYLE_TYPE_INDEX 31
-#define LIST_STYLE_TYPE_SHIFT 0
-#define LIST_STYLE_TYPE_MASK 0xf
-static inline uint8_t get_list_style_type(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[LIST_STYLE_TYPE_INDEX];
- bits &= LIST_STYLE_TYPE_MASK;
- bits >>= LIST_STYLE_TYPE_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef LIST_STYLE_TYPE_MASK
-#undef LIST_STYLE_TYPE_SHIFT
-#undef LIST_STYLE_TYPE_INDEX
-
-#define OUTLINE_STYLE_INDEX 32
-#define OUTLINE_STYLE_SHIFT 4
-#define OUTLINE_STYLE_MASK 0xf0
-static inline uint8_t get_outline_style(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[OUTLINE_STYLE_INDEX];
- bits &= OUTLINE_STYLE_MASK;
- bits >>= OUTLINE_STYLE_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef OUTLINE_STYLE_MASK
-#undef OUTLINE_STYLE_SHIFT
-#undef OUTLINE_STYLE_INDEX
-
-#define TABLE_LAYOUT_INDEX 32
-#define TABLE_LAYOUT_SHIFT 2
-#define TABLE_LAYOUT_MASK 0xc
-static inline uint8_t get_table_layout(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[TABLE_LAYOUT_INDEX];
- bits &= TABLE_LAYOUT_MASK;
- bits >>= TABLE_LAYOUT_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef TABLE_LAYOUT_MASK
-#undef TABLE_LAYOUT_SHIFT
-#undef TABLE_LAYOUT_INDEX
-
-#define UNICODE_BIDI_INDEX 32
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
-static inline uint8_t get_unicode_bidi(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[UNICODE_BIDI_INDEX];
- bits &= UNICODE_BIDI_MASK;
- bits >>= UNICODE_BIDI_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef UNICODE_BIDI_MASK
-#undef UNICODE_BIDI_SHIFT
-#undef UNICODE_BIDI_INDEX
-
-#define VISIBILITY_INDEX 33
-#define VISIBILITY_SHIFT 6
-#define VISIBILITY_MASK 0xc0
-static inline uint8_t get_visibility(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[VISIBILITY_INDEX];
- bits &= VISIBILITY_MASK;
- bits >>= VISIBILITY_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef VISIBILITY_MASK
-#undef VISIBILITY_SHIFT
-#undef VISIBILITY_INDEX
-
-#define LIST_STYLE_POSITION_INDEX 33
-#define LIST_STYLE_POSITION_SHIFT 4
-#define LIST_STYLE_POSITION_MASK 0x30
-static inline uint8_t get_list_style_position(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[LIST_STYLE_POSITION_INDEX];
- bits &= LIST_STYLE_POSITION_MASK;
- bits >>= LIST_STYLE_POSITION_SHIFT;
-
- /* 2bits: type */
- return bits;
-}
-#undef LIST_STYLE_POSITION_MASK
-#undef LIST_STYLE_POSITION_SHIFT
-#undef LIST_STYLE_POSITION_INDEX
-
-#define TEXT_ALIGN_INDEX 33
-#define TEXT_ALIGN_SHIFT 0
-#define TEXT_ALIGN_MASK 0xf
-static inline uint8_t get_text_align(
- const css_computed_style *style)
-{
- uint8_t bits = style->i.bits[TEXT_ALIGN_INDEX];
- bits &= TEXT_ALIGN_MASK;
- bits >>= TEXT_ALIGN_SHIFT;
-
- /* 4bits: type */
- return bits;
-}
-#undef TEXT_ALIGN_MASK
-#undef TEXT_ALIGN_SHIFT
-#undef TEXT_ALIGN_INDEX
-
-#define PAGE_BREAK_AFTER_INDEX 0
-#define PAGE_BREAK_AFTER_SHIFT 0
-#define PAGE_BREAK_AFTER_MASK 0x7
-static inline uint8_t get_page_break_after(
- const css_computed_style *style)
-{
- if (style->page != NULL) {
- uint8_t bits = style->page->bits[PAGE_BREAK_AFTER_INDEX];
- bits &= PAGE_BREAK_AFTER_MASK;
- bits >>= PAGE_BREAK_AFTER_SHIFT;
-
- /* 3bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_PAGE_BREAK_AFTER_AUTO;
-}
-#undef PAGE_BREAK_AFTER_MASK
-#undef PAGE_BREAK_AFTER_SHIFT
-#undef PAGE_BREAK_AFTER_INDEX
-
-#define PAGE_BREAK_BEFORE_INDEX 0
-#define PAGE_BREAK_BEFORE_SHIFT 3
-#define PAGE_BREAK_BEFORE_MASK 0x38
-static inline uint8_t get_page_break_before(
- const css_computed_style *style)
-{
- if (style->page != NULL) {
- uint8_t bits = style->page->bits[PAGE_BREAK_BEFORE_INDEX];
- bits &= PAGE_BREAK_BEFORE_MASK;
- bits >>= PAGE_BREAK_BEFORE_SHIFT;
-
- /* 3bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_PAGE_BREAK_BEFORE_AUTO;
-}
-#undef PAGE_BREAK_BEFORE_MASK
-#undef PAGE_BREAK_BEFORE_SHIFT
-#undef PAGE_BREAK_BEFORE_INDEX
-
-#define PAGE_BREAK_INSIDE_INDEX 0
-#define PAGE_BREAK_INSIDE_SHIFT 6
-#define PAGE_BREAK_INSIDE_MASK 0xc0
-static inline uint8_t get_page_break_inside(
- const css_computed_style *style)
-{
- if (style->page != NULL) {
- uint8_t bits = style->page->bits[PAGE_BREAK_INSIDE_INDEX];
- bits &= PAGE_BREAK_INSIDE_MASK;
- bits >>= PAGE_BREAK_INSIDE_SHIFT;
-
- /* 2bits: type */
- return bits;
- }
-
- /* Initial value */
- return CSS_PAGE_BREAK_INSIDE_AUTO;
-}
-#undef PAGE_BREAK_INSIDE_MASK
-#undef PAGE_BREAK_INSIDE_SHIFT
-#undef PAGE_BREAK_INSIDE_INDEX
-
-#define ORPHANS_INDEX 1
-#define ORPHANS_SHIFT 0
-#define ORPHANS_MASK 0x1
-static inline uint8_t get_orphans(
- const css_computed_style *style,
- int32_t *orphans)
-{
- if (style->page != NULL) {
- uint8_t bits = style->page->bits[ORPHANS_INDEX];
- bits &= ORPHANS_MASK;
- bits >>= ORPHANS_SHIFT;
-
- *orphans = style->page->orphans;
-
- /* 1bit: type */
- return bits;
- }
-
- /* Initial value */
- *orphans = 2;
- return CSS_ORPHANS_SET;
-}
-#undef ORPHANS_MASK
-#undef ORPHANS_SHIFT
-#undef ORPHANS_INDEX
-
-#define WIDOWS_INDEX 1
-#define WIDOWS_SHIFT 1
-#define WIDOWS_MASK 0x2
-static inline uint8_t get_widows(
- const css_computed_style *style,
- int32_t *widows)
-{
- if (style->page != NULL) {
- uint8_t bits = style->page->bits[WIDOWS_INDEX];
- bits &= WIDOWS_MASK;
- bits >>= WIDOWS_SHIFT;
-
- *widows = style->page->widows;
-
- /* 1bit: type */
- return bits;
- }
-
- /* Initial value */
- *widows = 2;
- return CSS_WIDOWS_SET;
-}
-#undef WIDOWS_MASK
-#undef WIDOWS_SHIFT
-#undef WIDOWS_INDEX
+#include "autogenerated_propget.h"
#endif
diff --git a/src/select/propset.h b/src/select/propset.h
index 3f4038c..0306946 100644
--- a/src/select/propset.h
+++ b/src/select/propset.h
@@ -12,2317 +12,6 @@
#include <libcss/computed.h>
#include "computed.h"
-
-/* Important: keep this file in sync with computed.h */
-/** \todo Is there a better way to ensure this happens? */
-
-/** Default values are 'initial value', unless the property is inherited,
- * in which case it is 'inherit'. */
-static const css_computed_uncommon default_uncommon = {
- .i = {
- .bits = {
- (CSS_LETTER_SPACING_INHERIT << 2) |
- CSS_OUTLINE_COLOR_INVERT,
- (CSS_OUTLINE_WIDTH_MEDIUM << 1) |
- CSS_BORDER_SPACING_INHERIT,
- 0,
- (CSS_WORD_SPACING_INHERIT << 2) |
- (CSS_COUNTER_INCREMENT_NONE << 1) |
- CSS_COUNTER_RESET_NONE,
- (CSS_CURSOR_INHERIT << 3) |
- (CSS_WRITING_MODE_INHERIT << 1),
- 0,
- 0,
- (CSS_CLIP_AUTO << 2) | CSS_CONTENT_NORMAL,
- (CSS_COLUMN_COUNT_AUTO << 6) |
- (CSS_COLUMN_FILL_BALANCE << 4) |
- (CSS_COLUMN_RULE_STYLE_NONE << 0),
- (CSS_COLUMN_GAP_NORMAL << 2) |
- (CSS_COLUMN_RULE_COLOR_CURRENT_COLOR),
- (CSS_COLUMN_RULE_WIDTH_MEDIUM << 1),
- (CSS_COLUMN_SPAN_NONE << 6) | CSS_COLUMN_WIDTH_AUTO,
- (CSS_BREAK_BEFORE_AUTO << 4) | CSS_BREAK_AFTER_AUTO,
- (CSS_BREAK_INSIDE_AUTO)
- },
- .border_spacing = { 0, 0 },
- .clip = { 0, 0, 0, 0 },
- .letter_spacing = 0,
- .outline_color = 0x0,
- .outline_width = 0,
- .word_spacing = 0,
- .column_count = 0,
- .column_gap = 0,
- .column_rule_color = 0,
- .column_rule_width = 0,
- .column_width = 0
- },
- .counter_increment = NULL,
- .counter_reset = NULL,
- .content = NULL,
- .cursor = NULL,
- .next = NULL,
- .count = 0,
- .bin = UINT32_MAX
-};
-
-#define ENSURE_UNCOMMON do { \
- if (style->i.uncommon == NULL) { \
- style->i.uncommon = malloc( \
- sizeof(css_computed_uncommon)); \
- if (style->i.uncommon == NULL) \
- return CSS_NOMEM; \
- \
- memcpy(style->i.uncommon, &default_uncommon, \
- sizeof(css_computed_uncommon)); \
- } \
-} while(0)
-
-static const css_computed_page default_page = {
- {
- (CSS_PAGE_BREAK_INSIDE_AUTO << 6) |
- (CSS_PAGE_BREAK_BEFORE_AUTO << 3) |
- CSS_PAGE_BREAK_AFTER_AUTO,
- (CSS_WIDOWS_SET << 1) |
- CSS_ORPHANS_SET
- },
- 2 << CSS_RADIX_POINT,
- 2 << CSS_RADIX_POINT
-};
-
-#define ENSURE_PAGE do { \
- if (style->page == NULL) { \
- style->page = malloc(sizeof(css_computed_page)); \
- if (style->page == NULL) \
- return CSS_NOMEM; \
- \
- memcpy(style->page, &default_page, \
- sizeof(css_computed_page)); \
- } \
-} while(0)
-
-#define LETTER_SPACING_INDEX 0
-#define LETTER_SPACING_SHIFT 2
-#define LETTER_SPACING_MASK 0xfc
-static inline css_error set_letter_spacing(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[LETTER_SPACING_INDEX];
-
- /* 6bits: uuuutt : unit | type */
- *bits = (*bits & ~LETTER_SPACING_MASK) |
- (((type & 0x3) | unit << 2) << LETTER_SPACING_SHIFT);
-
- style->i.uncommon->i.letter_spacing = length;
-
- return CSS_OK;
-}
-#undef LETTER_SPACING_MASK
-#undef LETTER_SPACING_SHIFT
-#undef LETTER_SPACING_INDEX
-
-#define OUTLINE_COLOR_INDEX 0
-#define OUTLINE_COLOR_SHIFT 0
-#define OUTLINE_COLOR_MASK 0x3
-static inline css_error set_outline_color(
- css_computed_style *style, uint8_t type, css_color color)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[OUTLINE_COLOR_INDEX];
-
- /* 2bits: tt : type */
- *bits = (*bits & ~OUTLINE_COLOR_MASK) |
- ((type & 0x3) << OUTLINE_COLOR_SHIFT);
-
- style->i.uncommon->i.outline_color = color;
-
- return CSS_OK;
-}
-#undef OUTLINE_COLOR_MASK
-#undef OUTLINE_COLOR_SHIFT
-#undef OUTLINE_COLOR_INDEX
-
-#define OUTLINE_WIDTH_INDEX 1
-#define OUTLINE_WIDTH_SHIFT 1
-#define OUTLINE_WIDTH_MASK 0xfe
-static inline css_error set_outline_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[OUTLINE_WIDTH_INDEX];
-
- /* 7bits: uuuuttt : unit | type */
- *bits = (*bits & ~OUTLINE_WIDTH_MASK) |
- (((type & 0x7) | (unit << 3)) << OUTLINE_WIDTH_SHIFT);
-
- style->i.uncommon->i.outline_width = length;
-
- return CSS_OK;
-}
-#undef OUTLINE_WIDTH_MASK
-#undef OUTLINE_WIDTH_SHIFT
-#undef OUTLINE_WIDTH_INDEX
-
-#define BORDER_SPACING_INDEX 1
-#define BORDER_SPACING_SHIFT 0
-#define BORDER_SPACING_MASK 0x1
-#define BORDER_SPACING_INDEX1 2
-#define BORDER_SPACING_SHIFT1 0
-static inline css_error set_border_spacing(
- css_computed_style *style, uint8_t type,
- css_fixed hlength, css_unit hunit,
- css_fixed vlength, css_unit vunit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[BORDER_SPACING_INDEX];
-
- /* 1 bit: type */
- *bits = (*bits & ~BORDER_SPACING_MASK) |
- ((type & 0x1) << BORDER_SPACING_SHIFT);
-
- bits = &style->i.uncommon->i.bits[BORDER_SPACING_INDEX1];
-
- /* 8bits: hhhhvvvv : hunit | vunit */
- *bits = (((hunit << 4) | vunit) << BORDER_SPACING_SHIFT1);
-
-
- style->i.uncommon->i.border_spacing[0] = hlength;
- style->i.uncommon->i.border_spacing[1] = vlength;
-
- return CSS_OK;
-}
-#undef BORDER_SPACING_SHIFT1
-#undef BORDER_SPACING_INDEX1
-#undef BORDER_SPACING_MASK
-#undef BORDER_SPACING_SHIFT
-#undef BORDER_SPACING_INDEX
-
-#define BREAK_AFTER_INDEX 12
-#define BREAK_AFTER_SHIFT 0
-#define BREAK_AFTER_MASK 0xf
-static inline css_error set_break_after(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[BREAK_AFTER_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BREAK_AFTER_MASK) |
- ((type & 0xf) << BREAK_AFTER_SHIFT);
-
- return CSS_OK;
-}
-#undef BREAK_AFTER_MASK
-#undef BREAK_AFTER_SHIFT
-#undef BREAK_AFTER_INDEX
-
-#define BREAK_BEFORE_INDEX 12
-#define BREAK_BEFORE_SHIFT 4
-#define BREAK_BEFORE_MASK (0xf << 4)
-static inline css_error set_break_before(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[BREAK_BEFORE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BREAK_BEFORE_MASK) |
- ((type & 0xf) << BREAK_BEFORE_SHIFT);
-
- return CSS_OK;
-}
-#undef BREAK_BEFORE_MASK
-#undef BREAK_BEFORE_SHIFT
-#undef BREAK_BEFORE_INDEX
-
-#define BREAK_INSIDE_INDEX 13
-#define BREAK_INSIDE_SHIFT 4
-#define BREAK_INSIDE_MASK (0xf << 4)
-static inline css_error set_break_inside(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[BREAK_INSIDE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BREAK_INSIDE_MASK) |
- ((type & 0xf) << BREAK_INSIDE_SHIFT);
-
- return CSS_OK;
-}
-#undef BREAK_INSIDE_MASK
-#undef BREAK_INSIDE_SHIFT
-#undef BREAK_INSIDE_INDEX
-
-#define WORD_SPACING_INDEX 3
-#define WORD_SPACING_SHIFT 2
-#define WORD_SPACING_MASK 0xfc
-static inline css_error set_word_spacing(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[WORD_SPACING_INDEX];
-
- /* 6bits: uuuutt : unit | type */
- *bits = (*bits & ~WORD_SPACING_MASK) |
- (((type & 0x3) | (unit << 2)) << WORD_SPACING_SHIFT);
-
- style->i.uncommon->i.word_spacing = length;
-
- return CSS_OK;
-}
-#undef WORD_SPACING_MASK
-#undef WORD_SPACING_SHIFT
-#undef WORD_SPACING_INDEX
-
-#define WRITING_MODE_INDEX 4
-#define WRITING_MODE_SHIFT 1
-#define WRITING_MODE_MASK 0x6
-static inline css_error set_writing_mode(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[WRITING_MODE_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~WRITING_MODE_MASK) |
- ((type & 0x3) << WRITING_MODE_SHIFT);
-
- return CSS_OK;
-}
-#undef WRITING_MODE_MASK
-#undef WRITING_MODE_SHIFT
-#undef WRITING_MODE_INDEX
-
-#define COUNTER_INCREMENT_INDEX 3
-#define COUNTER_INCREMENT_SHIFT 1
-#define COUNTER_INCREMENT_MASK 0x2
-static inline css_error set_counter_increment(
- css_computed_style *style, uint8_t type,
- css_computed_counter *counters)
-{
- uint8_t *bits;
- css_computed_counter *oldcounters;
- css_computed_counter *c;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COUNTER_INCREMENT_INDEX];
- oldcounters = style->i.uncommon->counter_increment;
-
- /* 1bit: type */
- *bits = (*bits & ~COUNTER_INCREMENT_MASK) |
- ((type & 0x1) << COUNTER_INCREMENT_SHIFT);
-
- for (c = counters; c != NULL && c->name != NULL; c++)
- c->name = lwc_string_ref(c->name);
-
- style->i.uncommon->counter_increment = counters;
-
- /* Free existing array */
- if (oldcounters != NULL) {
- for (c = oldcounters; c->name != NULL; c++)
- lwc_string_unref(c->name);
-
- if (oldcounters != counters)
- free(oldcounters);
- }
-
- return CSS_OK;
-}
-#undef COUNTER_INCREMENT_MASK
-#undef COUNTER_INCREMENT_SHIFT
-#undef COUNTER_INCREMENT_INDEX
-
-#define COUNTER_RESET_INDEX 3
-#define COUNTER_RESET_SHIFT 0
-#define COUNTER_RESET_MASK 0x1
-static inline css_error set_counter_reset(
- css_computed_style *style, uint8_t type,
- css_computed_counter *counters)
-{
- uint8_t *bits;
- css_computed_counter *oldcounters;
- css_computed_counter *c;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COUNTER_RESET_INDEX];
- oldcounters = style->i.uncommon->counter_reset;
-
- /* 1bit: type */
- *bits = (*bits & ~COUNTER_RESET_MASK) |
- ((type & 0x1) << COUNTER_RESET_SHIFT);
-
- for (c = counters; c != NULL && c->name != NULL; c++)
- c->name = lwc_string_ref(c->name);
-
- style->i.uncommon->counter_reset = counters;
-
- /* Free existing array */
- if (oldcounters != NULL) {
- for (c = oldcounters; c->name != NULL; c++)
- lwc_string_unref(c->name);
-
- if (oldcounters != counters)
- free(oldcounters);
- }
-
- return CSS_OK;
-}
-#undef COUNTER_RESET_MASK
-#undef COUNTER_RESET_SHIFT
-#undef COUNTER_RESET_INDEX
-
-#define CURSOR_INDEX 4
-#define CURSOR_SHIFT 3
-#define CURSOR_MASK 0xf8
-static inline css_error set_cursor(
- css_computed_style *style, uint8_t type,
- lwc_string **urls)
-{
- uint8_t *bits;
- lwc_string **oldurls;
- lwc_string **s;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[CURSOR_INDEX];
- oldurls = style->i.uncommon->cursor;
-
- /* 5bits: type */
- *bits = (*bits & ~CURSOR_MASK) |
- ((type & 0x1f) << CURSOR_SHIFT);
-
- for (s = urls; s != NULL && *s != NULL; s++)
- *s = lwc_string_ref(*s);
-
- style->i.uncommon->cursor = urls;
-
- /* Free existing array */
- if (oldurls != NULL) {
- for (s = oldurls; *s != NULL; s++)
- lwc_string_unref(*s);
-
- if (oldurls != urls)
- free(oldurls);
- }
-
- return CSS_OK;
-}
-#undef CURSOR_MASK
-#undef CURSOR_SHIFT
-#undef CURSOR_INDEX
-
-#define CLIP_INDEX 7
-#define CLIP_SHIFT 2
-#define CLIP_MASK 0xfc
-#define CLIP_INDEX1 5
-#define CLIP_SHIFT1 0
-#define CLIP_INDEX2 6
-#define CLIP_SHIFT2 0
-static inline css_error set_clip(
- css_computed_style *style, uint8_t type,
- css_computed_clip_rect *rect)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[CLIP_INDEX];
-
- /* 6bits: trblyy : top | right | bottom | left | type */
- *bits = (*bits & ~CLIP_MASK) |
- ((type & 0x3) << CLIP_SHIFT);
-
- if (type == CSS_CLIP_RECT) {
- *bits |= (((rect->top_auto ? 0x20 : 0) |
- (rect->right_auto ? 0x10 : 0) |
- (rect->bottom_auto ? 0x8 : 0) |
- (rect->left_auto ? 0x4 : 0)) << CLIP_SHIFT);
-
- bits = &style->i.uncommon->i.bits[CLIP_INDEX1];
-
- /* 8bits: ttttrrrr : top | right */
- *bits = (((rect->tunit << 4) | rect->runit) << CLIP_SHIFT1);
-
- bits = &style->i.uncommon->i.bits[CLIP_INDEX2];
-
- /* 8bits: bbbbllll : bottom | left */
- *bits = (((rect->bunit << 4) | rect->lunit) << CLIP_SHIFT2);
-
- style->i.uncommon->i.clip[0] = rect->top;
- style->i.uncommon->i.clip[1] = rect->right;
- style->i.uncommon->i.clip[2] = rect->bottom;
- style->i.uncommon->i.clip[3] = rect->left;
- }
-
- return CSS_OK;
-}
-#undef CLIP_SHIFT2
-#undef CLIP_INDEX2
-#undef CLIP_SHIFT1
-#undef CLIP_INDEX1
-#undef CLIP_MASK
-#undef CLIP_SHIFT
-#undef CLIP_INDEX
-
-#define COLUMN_COUNT_INDEX 8
-#define COLUMN_COUNT_SHIFT 6
-#define COLUMN_COUNT_MASK 0xc0
-static inline css_error set_column_count(
- css_computed_style *style, uint8_t type, int32_t count)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_COUNT_INDEX];
-
- /* 2bits: tt : type */
- *bits = (*bits & ~COLUMN_COUNT_MASK) |
- ((type & 0x3) << COLUMN_COUNT_SHIFT);
-
- style->i.uncommon->i.column_count = count;
-
- return CSS_OK;
-}
-#undef COLUMN_COUNT_MASK
-#undef COLUMN_COUNT_SHIFT
-#undef COLUMN_COUNT_INDEX
-
-#define COLUMN_FILL_INDEX 8
-#define COLUMN_FILL_SHIFT 4
-#define COLUMN_FILL_MASK 0x30
-static inline css_error set_column_fill(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_FILL_INDEX];
-
- /* 2bits: tt : type */
- *bits = (*bits & ~COLUMN_FILL_MASK) |
- ((type & 0x3) << COLUMN_FILL_SHIFT);
-
- return CSS_OK;
-}
-#undef COLUMN_FILL_MASK
-#undef COLUMN_FILL_SHIFT
-#undef COLUMN_FILL_INDEX
-
-#define COLUMN_GAP_INDEX 9
-#define COLUMN_GAP_SHIFT 2
-#define COLUMN_GAP_MASK 0xfc
-static inline css_error set_column_gap(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_GAP_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~COLUMN_GAP_MASK) |
- (((type & 0x3) | (unit << 2)) << COLUMN_GAP_SHIFT);
-
- style->i.uncommon->i.column_gap = length;
-
- return CSS_OK;
-}
-#undef COLUMN_GAP_MASK
-#undef COLUMN_GAP_SHIFT
-#undef COLUMN_GAP_INDEX
-
-#define COLUMN_RULE_COLOR_INDEX 9
-#define COLUMN_RULE_COLOR_SHIFT 0
-#define COLUMN_RULE_COLOR_MASK 0x3
-static inline css_error set_column_rule_color(
- css_computed_style *style, uint8_t type,
- css_color color)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_RULE_COLOR_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~COLUMN_RULE_COLOR_MASK) |
- ((type & 0x3) << COLUMN_RULE_COLOR_SHIFT);
-
- style->i.uncommon->i.column_rule_color = color;
-
- return CSS_OK;
-}
-#undef COLUMN_RULE_COLOR_MASK
-#undef COLUMN_RULE_COLOR_SHIFT
-#undef COLUMN_RULE_COLOR_INDEX
-
-#define COLUMN_RULE_STYLE_INDEX 8
-#define COLUMN_RULE_STYLE_SHIFT 0
-#define COLUMN_RULE_STYLE_MASK 0xf
-static inline css_error set_column_rule_style(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_RULE_STYLE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~COLUMN_RULE_STYLE_MASK) |
- ((type & 0xf) << COLUMN_RULE_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef COLUMN_RULE_STYLE_MASK
-#undef COLUMN_RULE_STYLE_SHIFT
-#undef COLUMN_RULE_STYLE_INDEX
-
-#define COLUMN_RULE_WIDTH_INDEX 10
-#define COLUMN_RULE_WIDTH_SHIFT 1
-#define COLUMN_RULE_WIDTH_MASK 0xfe
-static inline css_error set_column_rule_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_RULE_WIDTH_INDEX];
-
- /* 7bits: uuuuttt : units | type */
- *bits = (*bits & ~COLUMN_RULE_WIDTH_MASK) |
- (((type & 0x7) | (unit << 3)) << COLUMN_RULE_WIDTH_SHIFT);
-
- style->i.uncommon->i.column_rule_width = length;
-
- return CSS_OK;
-}
-#undef COLUMN_RULE_WIDTH_MASK
-#undef COLUMN_RULE_WIDTH_SHIFT
-#undef COLUMN_RULE_WIDTH_INDEX
-
-#define COLUMN_SPAN_INDEX 11
-#define COLUMN_SPAN_SHIFT 6
-#define COLUMN_SPAN_MASK 0xc0
-static inline css_error set_column_span(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_SPAN_INDEX];
-
- /* 2bits: tt : type */
- *bits = (*bits & ~COLUMN_SPAN_MASK) |
- ((type & 0x3) << COLUMN_SPAN_SHIFT);
-
- return CSS_OK;
-}
-#undef COLUMN_SPAN_MASK
-#undef COLUMN_SPAN_SHIFT
-#undef COLUMN_SPAN_INDEX
-
-#define COLUMN_WIDTH_INDEX 11
-#define COLUMN_WIDTH_SHIFT 0
-#define COLUMN_WIDTH_MASK 0x3f
-static inline css_error set_column_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits;
-
- ENSURE_UNCOMMON;
-
- bits = &style->i.uncommon->i.bits[COLUMN_WIDTH_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~COLUMN_WIDTH_MASK) |
- (((type & 0x3) | (unit << 2)) << COLUMN_WIDTH_SHIFT);
-
- style->i.uncommon->i.column_width = length;
-
- return CSS_OK;
-}
-#undef COLUMN_WIDTH_MASK
-#undef COLUMN_WIDTH_SHIFT
-#undef COLUMN_WIDTH_INDEX
-
-#define CONTENT_INDEX 7
-#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;
- css_computed_content_item *oldcontent;
- css_computed_content_item *c;
-
- ENSURE_UNCOMMON;
-
- /* 2bits: type */
- bits = &style->i.uncommon->i.bits[CONTENT_INDEX];
- oldcontent = style->i.uncommon->content;
-
- *bits = (*bits & ~CONTENT_MASK) |
- ((type & 0x3) << CONTENT_SHIFT);
-
- for (c = content; c != NULL &&
- c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
- switch (c->type) {
- case CSS_COMPUTED_CONTENT_STRING:
- c->data.string = lwc_string_ref(c->data.string);
- break;
- case CSS_COMPUTED_CONTENT_URI:
- c->data.uri = lwc_string_ref(c->data.uri);
- break;
- case CSS_COMPUTED_CONTENT_ATTR:
- c->data.attr = lwc_string_ref(c->data.attr);
- break;
- case CSS_COMPUTED_CONTENT_COUNTER:
- c->data.counter.name =
- lwc_string_ref(c->data.counter.name);
- break;
- case CSS_COMPUTED_CONTENT_COUNTERS:
- c->data.counters.name =
- lwc_string_ref(c->data.counters.name);
- c->data.counters.sep =
- lwc_string_ref(c->data.counters.sep);
- break;
- default:
- break;
- }
- }
-
- style->i.uncommon->content = content;
-
- /* Free existing array */
- if (oldcontent != NULL) {
- for (c = oldcontent;
- c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
- switch (c->type) {
- case CSS_COMPUTED_CONTENT_STRING:
- lwc_string_unref(c->data.string);
- break;
- case CSS_COMPUTED_CONTENT_URI:
- lwc_string_unref(c->data.uri);
- break;
- case CSS_COMPUTED_CONTENT_ATTR:
- lwc_string_unref(c->data.attr);
- break;
- case CSS_COMPUTED_CONTENT_COUNTER:
- lwc_string_unref(c->data.counter.name);
- break;
- case CSS_COMPUTED_CONTENT_COUNTERS:
- lwc_string_unref(c->data.counters.name);
- lwc_string_unref(c->data.counters.sep);
- break;
- default:
- break;
- }
- }
-
- if (oldcontent != content)
- free(oldcontent);
- }
-
- return CSS_OK;
-}
-#undef CONTENT_MASK
-#undef CONTENT_SHIFT
-#undef CONTENT_INDEX
-
-
-#define VERTICAL_ALIGN_INDEX 0
-#define VERTICAL_ALIGN_SHIFT 0
-static inline css_error set_vertical_align(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[VERTICAL_ALIGN_INDEX];
-
- /* 8bits: uuuutttt : units | type */
- *bits = (((type & 0xf) | (unit << 4)) << VERTICAL_ALIGN_SHIFT);
-
- style->i.vertical_align = length;
-
- return CSS_OK;
-}
-#undef VERTICAL_ALIGN_SHIFT
-#undef VERTICAL_ALIGN_INDEX
-
-#define FONT_SIZE_INDEX 1
-#define FONT_SIZE_SHIFT 0
-static inline css_error set_font_size(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[FONT_SIZE_INDEX];
-
- /* 8bits: uuuutttt : units | type */
- *bits = (((type & 0xf) | (unit << 4)) << FONT_SIZE_SHIFT);
-
- style->i.font_size = length;
-
- return CSS_OK;
-}
-#undef FONT_SIZE_SHIFT
-#undef FONT_SIZE_INDEX
-
-#define BORDER_TOP_WIDTH_INDEX 2
-#define BORDER_TOP_WIDTH_SHIFT 1
-#define BORDER_TOP_WIDTH_MASK 0xfe
-static inline css_error set_border_top_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[BORDER_TOP_WIDTH_INDEX];
-
- /* 7bits: uuuuttt : units | type */
- *bits = (*bits & ~BORDER_TOP_WIDTH_MASK) |
- (((type & 0x7) | (unit << 3)) << BORDER_TOP_WIDTH_SHIFT);
-
- style->i.border_width[0] = length;
-
- return CSS_OK;
-}
-#undef BORDER_TOP_WIDTH_MASK
-#undef BORDER_TOP_WIDTH_SHIFT
-#undef BORDER_TOP_WIDTH_INDEX
-
-#define BORDER_RIGHT_WIDTH_INDEX 3
-#define BORDER_RIGHT_WIDTH_SHIFT 1
-#define BORDER_RIGHT_WIDTH_MASK 0xfe
-static inline css_error set_border_right_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[BORDER_RIGHT_WIDTH_INDEX];
-
- /* 7bits: uuuuttt : units | type */
- *bits = (*bits & ~BORDER_RIGHT_WIDTH_MASK) |
- (((type & 0x7) | (unit << 3)) << BORDER_RIGHT_WIDTH_SHIFT);
-
- style->i.border_width[1] = length;
-
- return CSS_OK;
-}
-#undef BORDER_RIGHT_WIDTH_MASK
-#undef BORDER_RIGHT_WIDTH_SHIFT
-#undef BORDER_RIGHT_WIDTH_INDEX
-
-#define BORDER_BOTTOM_WIDTH_INDEX 4
-#define BORDER_BOTTOM_WIDTH_SHIFT 1
-#define BORDER_BOTTOM_WIDTH_MASK 0xfe
-static inline css_error set_border_bottom_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[BORDER_BOTTOM_WIDTH_INDEX];
-
- /* 7bits: uuuuttt : units | type */
- *bits = (*bits & ~BORDER_BOTTOM_WIDTH_MASK) |
- (((type & 0x7) | (unit << 3)) << BORDER_BOTTOM_WIDTH_SHIFT);
-
- style->i.border_width[2] = length;
-
- return CSS_OK;
-}
-#undef BORDER_BOTTOM_WIDTH_MASK
-#undef BORDER_BOTTOM_WIDTH_SHIFT
-#undef BORDER_BOTTOM_WIDTH_INDEX
-
-#define BORDER_LEFT_WIDTH_INDEX 5
-#define BORDER_LEFT_WIDTH_SHIFT 1
-#define BORDER_LEFT_WIDTH_MASK 0xfe
-static inline css_error set_border_left_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[BORDER_LEFT_WIDTH_INDEX];
-
- /* 7bits: uuuuttt : units | type */
- *bits = (*bits & ~BORDER_LEFT_WIDTH_MASK) |
- (((type & 0x7) | (unit << 3)) << BORDER_LEFT_WIDTH_SHIFT);
-
- style->i.border_width[3] = length;
-
- return CSS_OK;
-}
-#undef BORDER_LEFT_WIDTH_MASK
-#undef BORDER_LEFT_WIDTH_SHIFT
-#undef BORDER_LEFT_WIDTH_INDEX
-
-#define BACKGROUND_IMAGE_INDEX 2
-#define BACKGROUND_IMAGE_SHIFT 0
-#define BACKGROUND_IMAGE_MASK 0x1
-static inline css_error set_background_image(
- css_computed_style *style, uint8_t type,
- lwc_string *url)
-{
- uint8_t *bits = &style->i.bits[BACKGROUND_IMAGE_INDEX];
- lwc_string *oldurl = style->i.background_image;
-
- /* 1bit: type */
- *bits = (*bits & ~BACKGROUND_IMAGE_MASK) |
- ((type & 0x1) << BACKGROUND_IMAGE_SHIFT);
-
- if (url != NULL) {
- style->i.background_image = lwc_string_ref(url);
- } else {
- style->i.background_image = NULL;
- }
-
- if (oldurl != NULL)
- lwc_string_unref(oldurl);
-
- return CSS_OK;
-}
-#undef BACKGROUND_IMAGE_MASK
-#undef BACKGROUND_IMAGE_SHIFT
-#undef BACKGROUND_IMAGE_INDEX
-
-#define COLOR_INDEX 3
-#define COLOR_SHIFT 0
-#define COLOR_MASK 0x1
-static inline css_error set_color(
- css_computed_style *style, uint8_t type,
- css_color color)
-{
- uint8_t *bits = &style->i.bits[COLOR_INDEX];
-
- /* 1bit: type */
- *bits = (*bits & ~COLOR_MASK) |
- ((type & 0x1) << COLOR_SHIFT);
-
- style->i.color = color;
-
- return CSS_OK;
-}
-#undef COLOR_MASK
-#undef COLOR_SHIFT
-#undef COLOR_INDEX
-
-#define LIST_STYLE_IMAGE_INDEX 4
-#define LIST_STYLE_IMAGE_SHIFT 0
-#define LIST_STYLE_IMAGE_MASK 0x1
-static inline css_error set_list_style_image(
- css_computed_style *style, uint8_t type,
- lwc_string *url)
-{
- uint8_t *bits = &style->i.bits[LIST_STYLE_IMAGE_INDEX];
- lwc_string *oldurl = style->i.list_style_image;
-
- /* 1bit: type */
- *bits = (*bits & ~LIST_STYLE_IMAGE_MASK) |
- ((type & 0x1) << LIST_STYLE_IMAGE_SHIFT);
-
- if (url != NULL) {
- style->i.list_style_image = lwc_string_ref(url);
- } else {
- style->i.list_style_image = NULL;
- }
-
- if (oldurl != NULL)
- lwc_string_unref(oldurl);
-
- return CSS_OK;
-}
-#undef LIST_STYLE_IMAGE_MASK
-#undef LIST_STYLE_IMAGE_SHIFT
-#undef LIST_STYLE_IMAGE_INDEX
-
-#define QUOTES_INDEX 5
-#define QUOTES_SHIFT 0
-#define QUOTES_MASK 0x1
-static inline css_error set_quotes(
- css_computed_style *style, uint8_t type,
- lwc_string **quotes)
-{
- uint8_t *bits = &style->i.bits[QUOTES_INDEX];
- lwc_string **oldquotes = style->quotes;
- lwc_string **s;
-
- /* 1bit: type */
- *bits = (*bits & ~QUOTES_MASK) |
- ((type & 0x1) << QUOTES_SHIFT);
-
- for (s = quotes; s != NULL && *s != NULL; s++)
- *s = lwc_string_ref(*s);
-
- style->quotes = quotes;
-
- /* Free current quotes */
- if (oldquotes != NULL) {
- for (s = oldquotes; *s != NULL; s++)
- lwc_string_unref(*s);
-
- if (oldquotes != quotes)
- free(oldquotes);
- }
-
- return CSS_OK;
-}
-#undef QUOTES_MASK
-#undef QUOTES_SHIFT
-#undef QUOTES_INDEX
-
-#define TOP_INDEX 6
-#define TOP_SHIFT 2
-#define TOP_MASK 0xfc
-static inline css_error set_top(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[TOP_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~TOP_MASK) |
- (((type & 0x3) | (unit << 2)) << TOP_SHIFT);
-
- style->i.top = length;
-
- return CSS_OK;
-}
-#undef TOP_MASK
-#undef TOP_SHIFT
-#undef TOP_INDEX
-
-#define RIGHT_INDEX 7
-#define RIGHT_SHIFT 2
-#define RIGHT_MASK 0xfc
-static inline css_error set_right(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[RIGHT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~RIGHT_MASK) |
- (((type & 0x3) | (unit << 2)) << RIGHT_SHIFT);
-
- style->i.right = length;
-
- return CSS_OK;
-}
-#undef RIGHT_MASK
-#undef RIGHT_SHIFT
-#undef RIGHT_INDEX
-
-#define BOTTOM_INDEX 8
-#define BOTTOM_SHIFT 2
-#define BOTTOM_MASK 0xfc
-static inline css_error set_bottom(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[BOTTOM_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~BOTTOM_MASK) |
- (((type & 0x3) | (unit << 2)) << BOTTOM_SHIFT);
-
- style->i.bottom = length;
-
- return CSS_OK;
-}
-#undef BOTTOM_MASK
-#undef BOTTOM_SHIFT
-#undef BOTTOM_INDEX
-
-#define LEFT_INDEX 9
-#define LEFT_SHIFT 2
-#define LEFT_MASK 0xfc
-static inline css_error set_left(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[LEFT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~LEFT_MASK) |
- (((type & 0x3) | (unit << 2)) << LEFT_SHIFT);
-
- style->i.left = length;
-
- return CSS_OK;
-}
-#undef LEFT_MASK
-#undef LEFT_SHIFT
-#undef LEFT_INDEX
-
-#define BORDER_TOP_COLOR_INDEX 6
-#define BORDER_TOP_COLOR_SHIFT 0
-#define BORDER_TOP_COLOR_MASK 0x3
-static inline css_error set_border_top_color(
- css_computed_style *style, uint8_t type,
- css_color color)
-{
- uint8_t *bits = &style->i.bits[BORDER_TOP_COLOR_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BORDER_TOP_COLOR_MASK) |
- ((type & 0x3) << BORDER_TOP_COLOR_SHIFT);
-
- style->i.border_color[0] = color;
-
- return CSS_OK;
-}
-#undef BORDER_TOP_COLOR_MASK
-#undef BORDER_TOP_COLOR_SHIFT
-#undef BORDER_TOP_COLOR_INDEX
-
-#define BORDER_RIGHT_COLOR_INDEX 7
-#define BORDER_RIGHT_COLOR_SHIFT 0
-#define BORDER_RIGHT_COLOR_MASK 0x3
-static inline css_error set_border_right_color(
- css_computed_style *style, uint8_t type,
- css_color color)
-{
- uint8_t *bits = &style->i.bits[BORDER_RIGHT_COLOR_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BORDER_RIGHT_COLOR_MASK) |
- ((type & 0x3) << BORDER_RIGHT_COLOR_SHIFT);
-
- style->i.border_color[1] = color;
-
- return CSS_OK;
-}
-#undef BORDER_RIGHT_COLOR_MASK
-#undef BORDER_RIGHT_COLOR_SHIFT
-#undef BORDER_RIGHT_COLOR_INDEX
-
-#define BORDER_BOTTOM_COLOR_INDEX 8
-#define BORDER_BOTTOM_COLOR_SHIFT 0
-#define BORDER_BOTTOM_COLOR_MASK 0x3
-static inline css_error set_border_bottom_color(
- css_computed_style *style, uint8_t type,
- css_color color)
-{
- uint8_t *bits = &style->i.bits[BORDER_BOTTOM_COLOR_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BORDER_BOTTOM_COLOR_MASK) |
- ((type & 0x3) << BORDER_BOTTOM_COLOR_SHIFT);
-
- style->i.border_color[2] = color;
-
- return CSS_OK;
-}
-#undef BORDER_BOTTOM_COLOR_MASK
-#undef BORDER_BOTTOM_COLOR_SHIFT
-#undef BORDER_BOTTOM_COLOR_INDEX
-
-#define BORDER_LEFT_COLOR_INDEX 9
-#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)
-{
- uint8_t *bits = &style->i.bits[BORDER_LEFT_COLOR_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BORDER_LEFT_COLOR_MASK) |
- ((type & 0x3) << BORDER_LEFT_COLOR_SHIFT);
-
- style->i.border_color[3] = color;
-
- return CSS_OK;
-}
-#undef BORDER_LEFT_COLOR_MASK
-#undef BORDER_LEFT_COLOR_SHIFT
-#undef BORDER_LEFT_COLOR_INDEX
-
-#define HEIGHT_INDEX 10
-#define HEIGHT_SHIFT 2
-#define HEIGHT_MASK 0xfc
-static inline css_error set_height(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[HEIGHT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~HEIGHT_MASK) |
- (((type & 0x3) | (unit << 2)) << HEIGHT_SHIFT);
-
- style->i.height = length;
-
- return CSS_OK;
-}
-#undef HEIGHT_MASK
-#undef HEIGHT_SHIFT
-#undef HEIGHT_INDEX
-
-#define LINE_HEIGHT_INDEX 11
-#define LINE_HEIGHT_SHIFT 2
-#define LINE_HEIGHT_MASK 0xfc
-static inline css_error set_line_height(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[LINE_HEIGHT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~LINE_HEIGHT_MASK) |
- (((type & 0x3) | (unit << 2)) << LINE_HEIGHT_SHIFT);
-
- style->i.line_height = length;
-
- return CSS_OK;
-}
-#undef LINE_HEIGHT_MASK
-#undef LINE_HEIGHT_SHIFT
-#undef LINE_HEIGHT_INDEX
-
-#define BACKGROUND_COLOR_INDEX 10
-#define BACKGROUND_COLOR_SHIFT 0
-#define BACKGROUND_COLOR_MASK 0x3
-static inline css_error set_background_color(
- css_computed_style *style, uint8_t type,
- css_color color)
-{
- uint8_t *bits = &style->i.bits[BACKGROUND_COLOR_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BACKGROUND_COLOR_MASK) |
- ((type & 0x3) << BACKGROUND_COLOR_SHIFT);
-
- style->i.background_color = color;
-
- return CSS_OK;
-}
-#undef BACKGROUND_COLOR_MASK
-#undef BACKGROUND_COLOR_SHIFT
-#undef BACKGROUND_COLOR_INDEX
-
-#define Z_INDEX_INDEX 11
-#define Z_INDEX_SHIFT 0
-#define Z_INDEX_MASK 0x3
-static inline css_error set_z_index(
- css_computed_style *style, uint8_t type,
- int32_t z_index)
-{
- uint8_t *bits = &style->i.bits[Z_INDEX_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~Z_INDEX_MASK) |
- ((type & 0x3) << Z_INDEX_SHIFT);
-
- style->i.z_index = z_index;
-
- return CSS_OK;
-}
-#undef Z_INDEX_MASK
-#undef Z_INDEX_SHIFT
-#undef Z_INDEX_INDEX
-
-#define MARGIN_TOP_INDEX 12
-#define MARGIN_TOP_SHIFT 2
-#define MARGIN_TOP_MASK 0xfc
-static inline css_error set_margin_top(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MARGIN_TOP_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~MARGIN_TOP_MASK) |
- (((type & 0x3) | (unit << 2)) << MARGIN_TOP_SHIFT);
-
- style->i.margin[0] = length;
-
- return CSS_OK;
-}
-#undef MARGIN_TOP_MASK
-#undef MARGIN_TOP_SHIFT
-#undef MARGIN_TOP_INDEX
-
-#define MARGIN_RIGHT_INDEX 13
-#define MARGIN_RIGHT_SHIFT 2
-#define MARGIN_RIGHT_MASK 0xfc
-static inline css_error set_margin_right(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MARGIN_RIGHT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~MARGIN_RIGHT_MASK) |
- (((type & 0x3) | (unit << 2)) << MARGIN_RIGHT_SHIFT);
-
- style->i.margin[1] = length;
-
- return CSS_OK;
-}
-#undef MARGIN_RIGHT_MASK
-#undef MARGIN_RIGHT_SHIFT
-#undef MARGIN_RIGHT_INDEX
-
-#define MARGIN_BOTTOM_INDEX 14
-#define MARGIN_BOTTOM_SHIFT 2
-#define MARGIN_BOTTOM_MASK 0xfc
-static inline css_error set_margin_bottom(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MARGIN_BOTTOM_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~MARGIN_BOTTOM_MASK) |
- (((type & 0x3) | (unit << 2)) << MARGIN_BOTTOM_SHIFT);
-
- style->i.margin[2] = length;
-
- return CSS_OK;
-}
-#undef MARGIN_BOTTOM_MASK
-#undef MARGIN_BOTTOM_SHIFT
-#undef MARGIN_BOTTOM_INDEX
-
-#define MARGIN_LEFT_INDEX 15
-#define MARGIN_LEFT_SHIFT 2
-#define MARGIN_LEFT_MASK 0xfc
-static inline css_error set_margin_left(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MARGIN_LEFT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~MARGIN_LEFT_MASK) |
- (((type & 0x3) | (unit << 2)) << MARGIN_LEFT_SHIFT);
-
- style->i.margin[3] = length;
-
- return CSS_OK;
-}
-#undef MARGIN_LEFT_MASK
-#undef MARGIN_LEFT_SHIFT
-#undef MARGIN_LEFT_INDEX
-
-#define BACKGROUND_ATTACHMENT_INDEX 12
-#define BACKGROUND_ATTACHMENT_SHIFT 0
-#define BACKGROUND_ATTACHMENT_MASK 0x3
-static inline css_error set_background_attachment(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BACKGROUND_ATTACHMENT_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BACKGROUND_ATTACHMENT_MASK) |
- ((type & 0x3) << BACKGROUND_ATTACHMENT_SHIFT);
-
- return CSS_OK;
-}
-#undef BACKGROUND_ATTACHMENT_MASK
-#undef BACKGROUND_ATTACHMENT_SHIFT
-#undef BACKGROUND_ATTACHMENT_INDEX
-
-#define BOX_SIZING_INDEX 34
-#define BOX_SIZING_SHIFT 0
-#define BOX_SIZING_MASK 0x3
-static inline css_error set_box_sizing(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BOX_SIZING_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BOX_SIZING_MASK) |
- ((type & 0x3) << BOX_SIZING_SHIFT);
-
- return CSS_OK;
-}
-#undef BOX_SIZING_MASK
-#undef BOX_SIZING_SHIFT
-#undef BOX_SIZING_INDEX
-
-#define BORDER_COLLAPSE_INDEX 13
-#define BORDER_COLLAPSE_SHIFT 0
-#define BORDER_COLLAPSE_MASK 0x3
-static inline css_error set_border_collapse(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BORDER_COLLAPSE_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~BORDER_COLLAPSE_MASK) |
- ((type & 0x3) << BORDER_COLLAPSE_SHIFT);
-
- return CSS_OK;
-}
-#undef BORDER_COLLAPSE_MASK
-#undef BORDER_COLLAPSE_SHIFT
-#undef BORDER_COLLAPSE_INDEX
-
-#define CAPTION_SIDE_INDEX 14
-#define CAPTION_SIDE_SHIFT 0
-#define CAPTION_SIDE_MASK 0x3
-static inline css_error set_caption_side(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[CAPTION_SIDE_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~CAPTION_SIDE_MASK) |
- ((type & 0x3) << CAPTION_SIDE_SHIFT);
-
- return CSS_OK;
-}
-#undef CAPTION_SIDE_MASK
-#undef CAPTION_SIDE_SHIFT
-#undef CAPTION_SIDE_INDEX
-
-#define DIRECTION_INDEX 15
-#define DIRECTION_SHIFT 0
-#define DIRECTION_MASK 0x3
-static inline css_error set_direction(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[DIRECTION_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~DIRECTION_MASK) |
- ((type & 0x3) << DIRECTION_SHIFT);
-
- return CSS_OK;
-}
-#undef DIRECTION_MASK
-#undef DIRECTION_SHIFT
-#undef DIRECTION_INDEX
-
-#define MAX_HEIGHT_INDEX 16
-#define MAX_HEIGHT_SHIFT 2
-#define MAX_HEIGHT_MASK 0xfc
-static inline css_error set_max_height(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MAX_HEIGHT_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~MAX_HEIGHT_MASK) |
- (((type & 0x3) | (unit << 2)) << MAX_HEIGHT_SHIFT);
-
- style->i.max_height = length;
-
- return CSS_OK;
-}
-#undef MAX_HEIGHT_MASK
-#undef MAX_HEIGHT_SHIFT
-#undef MAX_HEIGHT_INDEX
-
-#define MAX_WIDTH_INDEX 17
-#define MAX_WIDTH_SHIFT 2
-#define MAX_WIDTH_MASK 0xfc
-static inline css_error set_max_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MAX_WIDTH_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~MAX_WIDTH_MASK) |
- (((type & 0x3) | (unit << 2)) << MAX_WIDTH_SHIFT);
-
- style->i.max_width = length;
-
- return CSS_OK;
-}
-#undef MAX_WIDTH_MASK
-#undef MAX_WIDTH_SHIFT
-#undef MAX_WIDTH_INDEX
-
-#define WIDTH_INDEX 18
-#define WIDTH_SHIFT 2
-#define WIDTH_MASK 0xfc
-static inline css_error set_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[WIDTH_INDEX];
-
- /* 6bits: uuuutt : units | type */
- *bits = (*bits & ~WIDTH_MASK) |
- (((type & 0x3) | (unit << 2)) << WIDTH_SHIFT);
-
- style->i.width = length;
-
- return CSS_OK;
-}
-#undef WIDTH_MASK
-#undef WIDTH_SHIFT
-#undef WIDTH_INDEX
-
-#define EMPTY_CELLS_INDEX 16
-#define EMPTY_CELLS_SHIFT 0
-#define EMPTY_CELLS_MASK 0x3
-static inline css_error set_empty_cells(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[EMPTY_CELLS_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~EMPTY_CELLS_MASK) |
- ((type & 0x3) << EMPTY_CELLS_SHIFT);
-
- return CSS_OK;
-}
-#undef EMPTY_CELLS_MASK
-#undef EMPTY_CELLS_SHIFT
-#undef EMPTY_CELLS_INDEX
-
-#define FLOAT_INDEX 17
-#define FLOAT_SHIFT 0
-#define FLOAT_MASK 0x3
-static inline css_error set_float(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[FLOAT_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~FLOAT_MASK) |
- ((type & 0x3) << FLOAT_SHIFT);
-
- return CSS_OK;
-}
-#undef FLOAT_MASK
-#undef FLOAT_SHIFT
-#undef FLOAT_INDEX
-
-#define FONT_STYLE_INDEX 18
-#define FONT_STYLE_SHIFT 0
-#define FONT_STYLE_MASK 0x3
-static inline css_error set_font_style(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[FONT_STYLE_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~FONT_STYLE_MASK) |
- ((type & 0x3) << FONT_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef FONT_STYLE_MASK
-#undef FONT_STYLE_SHIFT
-#undef FONT_STYLE_INDEX
-
-#define MIN_HEIGHT_INDEX 19
-#define MIN_HEIGHT_SHIFT 3
-#define MIN_HEIGHT_MASK 0xf8
-static inline css_error set_min_height(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MIN_HEIGHT_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~MIN_HEIGHT_MASK) |
- (((type & 0x1) | (unit << 1)) << MIN_HEIGHT_SHIFT);
-
- style->i.min_height = length;
-
- return CSS_OK;
-}
-#undef MIN_HEIGHT_MASK
-#undef MIN_HEIGHT_SHIFT
-#undef MIN_HEIGHT_INDEX
-
-#define MIN_WIDTH_INDEX 20
-#define MIN_WIDTH_SHIFT 3
-#define MIN_WIDTH_MASK 0xf8
-static inline css_error set_min_width(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[MIN_WIDTH_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~MIN_WIDTH_MASK) |
- (((type & 0x1) | (unit << 1)) << MIN_WIDTH_SHIFT);
-
- style->i.min_width = length;
-
- return CSS_OK;
-}
-#undef MIN_WIDTH_MASK
-#undef MIN_WIDTH_SHIFT
-#undef MIN_WIDTH_INDEX
-
-#define BACKGROUND_REPEAT_INDEX 19
-#define BACKGROUND_REPEAT_SHIFT 0
-#define BACKGROUND_REPEAT_MASK 0x7
-static inline css_error set_background_repeat(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BACKGROUND_REPEAT_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~BACKGROUND_REPEAT_MASK) |
- ((type & 0x7) << BACKGROUND_REPEAT_SHIFT);
-
- return CSS_OK;
-}
-#undef BACKGROUND_REPEAT_MASK
-#undef BACKGROUND_REPEAT_SHIFT
-#undef BACKGROUND_REPEAT_INDEX
-
-#define CLEAR_INDEX 20
-#define CLEAR_SHIFT 0
-#define CLEAR_MASK 0x7
-static inline css_error set_clear(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[CLEAR_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~CLEAR_MASK) |
- ((type & 0x7) << CLEAR_SHIFT);
-
- return CSS_OK;
-}
-#undef CLEAR_MASK
-#undef CLEAR_SHIFT
-#undef CLEAR_INDEX
-
-#define PADDING_TOP_INDEX 21
-#define PADDING_TOP_SHIFT 3
-#define PADDING_TOP_MASK 0xf8
-static inline css_error set_padding_top(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[PADDING_TOP_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~PADDING_TOP_MASK) |
- (((type & 0x1) | (unit << 1)) << PADDING_TOP_SHIFT);
-
- style->i.padding[0] = length;
-
- return CSS_OK;
-}
-#undef PADDING_TOP_MASK
-#undef PADDING_TOP_SHIFT
-#undef PADDING_TOP_INDEX
-
-#define PADDING_RIGHT_INDEX 22
-#define PADDING_RIGHT_SHIFT 3
-#define PADDING_RIGHT_MASK 0xf8
-static inline css_error set_padding_right(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[PADDING_RIGHT_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~PADDING_RIGHT_MASK) |
- (((type & 0x1) | (unit << 1)) << PADDING_RIGHT_SHIFT);
-
- style->i.padding[1] = length;
-
- return CSS_OK;
-}
-#undef PADDING_RIGHT_MASK
-#undef PADDING_RIGHT_SHIFT
-#undef PADDING_RIGHT_INDEX
-
-#define PADDING_BOTTOM_INDEX 23
-#define PADDING_BOTTOM_SHIFT 3
-#define PADDING_BOTTOM_MASK 0xf8
-static inline css_error set_padding_bottom(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[PADDING_BOTTOM_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~PADDING_BOTTOM_MASK) |
- (((type & 0x1) | (unit << 1)) << PADDING_BOTTOM_SHIFT);
-
- style->i.padding[2] = length;
-
- return CSS_OK;
-}
-#undef PADDING_BOTTOM_MASK
-#undef PADDING_BOTTOM_SHIFT
-#undef PADDING_BOTTOM_INDEX
-
-#define PADDING_LEFT_INDEX 24
-#define PADDING_LEFT_SHIFT 3
-#define PADDING_LEFT_MASK 0xf8
-static inline css_error set_padding_left(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[PADDING_LEFT_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~PADDING_LEFT_MASK) |
- (((type & 0x1) | (unit << 1)) << PADDING_LEFT_SHIFT);
-
- style->i.padding[3] = length;
-
- return CSS_OK;
-}
-#undef PADDING_LEFT_MASK
-#undef PADDING_LEFT_SHIFT
-#undef PADDING_LEFT_INDEX
-
-#define OVERFLOW_X_INDEX 21
-#define OVERFLOW_X_SHIFT 0
-#define OVERFLOW_X_MASK 0x7
-static inline css_error set_overflow_x(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[OVERFLOW_X_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~OVERFLOW_X_MASK) |
- ((type & 0x7) << OVERFLOW_X_SHIFT);
-
- return CSS_OK;
-}
-#undef OVERFLOW_X_MASK
-#undef OVERFLOW_X_SHIFT
-#undef OVERFLOW_X_INDEX
-
-#define OVERFLOW_Y_INDEX 34
-#define OVERFLOW_Y_SHIFT 5
-#define OVERFLOW_Y_MASK 0xe0
-static inline css_error set_overflow_y(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[OVERFLOW_Y_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~OVERFLOW_Y_MASK) |
- ((type & 0x7) << OVERFLOW_Y_SHIFT);
-
- return CSS_OK;
-}
-#undef OVERFLOW_Y_MASK
-#undef OVERFLOW_Y_SHIFT
-#undef OVERFLOW_Y_INDEX
-
-#define POSITION_INDEX 22
-#define POSITION_SHIFT 0
-#define POSITION_MASK 0x7
-static inline css_error set_position(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[POSITION_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~POSITION_MASK) |
- ((type & 0x7) << POSITION_SHIFT);
-
- return CSS_OK;
-}
-#undef POSITION_MASK
-#undef POSITION_SHIFT
-#undef POSITION_INDEX
-
-#define OPACITY_INDEX 23
-#define OPACITY_SHIFT 2
-#define OPACITY_MASK 0x04
-static inline css_error set_opacity(
- css_computed_style *style,
- uint8_t type, css_fixed opacity)
-{
- uint8_t *bits = &style->i.bits[OPACITY_INDEX];
-
- /* 1bit: t : type */
- *bits = (*bits & ~OPACITY_MASK) |
- ((type & 0x1) << OPACITY_SHIFT);
-
- style->i.opacity = opacity;
-
- return CSS_OK;
-}
-#undef OPACITY_MASK
-#undef OPACITY_SHIFT
-#undef OPACITY_INDEX
-
-#define TEXT_TRANSFORM_INDEX 24
-#define TEXT_TRANSFORM_SHIFT 0
-#define TEXT_TRANSFORM_MASK 0x7
-static inline css_error set_text_transform(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[TEXT_TRANSFORM_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~TEXT_TRANSFORM_MASK) |
- ((type & 0x7) << TEXT_TRANSFORM_SHIFT);
-
- return CSS_OK;
-}
-#undef TEXT_TRANSFORM_MASK
-#undef TEXT_TRANSFORM_SHIFT
-#undef TEXT_TRANSFORM_INDEX
-
-#define TEXT_INDENT_INDEX 25
-#define TEXT_INDENT_SHIFT 3
-#define TEXT_INDENT_MASK 0xf8
-static inline css_error set_text_indent(
- css_computed_style *style, uint8_t type,
- css_fixed length, css_unit unit)
-{
- uint8_t *bits = &style->i.bits[TEXT_INDENT_INDEX];
-
- /* 5bits: uuuut : units | type */
- *bits = (*bits & ~TEXT_INDENT_MASK) |
- (((type & 0x1) | (unit << 1)) << TEXT_INDENT_SHIFT);
-
- style->i.text_indent = length;
-
- return CSS_OK;
-}
-#undef TEXT_INDENT_MASK
-#undef TEXT_INDENT_SHIFT
-#undef TEXT_INDENT_INDEX
-
-#define WHITE_SPACE_INDEX 25
-#define WHITE_SPACE_SHIFT 0
-#define WHITE_SPACE_MASK 0x7
-static inline css_error set_white_space(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[WHITE_SPACE_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~WHITE_SPACE_MASK) |
- ((type & 0x7) << WHITE_SPACE_SHIFT);
-
- return CSS_OK;
-}
-#undef WHITE_SPACE_MASK
-#undef WHITE_SPACE_SHIFT
-#undef WHITE_SPACE_INDEX
-
-#define BACKGROUND_POSITION_INDEX 27
-#define BACKGROUND_POSITION_SHIFT 7
-#define BACKGROUND_POSITION_MASK 0x80
-#define BACKGROUND_POSITION_INDEX1 26
-#define BACKGROUND_POSITION_SHIFT1 0
-static inline css_error set_background_position(
- css_computed_style *style, uint8_t type,
- css_fixed hlength, css_unit hunit,
- css_fixed vlength, css_unit vunit)
-{
- uint8_t *bits;
-
- bits = &style->i.bits[BACKGROUND_POSITION_INDEX];
-
- /* 1 bit: type */
- *bits = (*bits & ~BACKGROUND_POSITION_MASK) |
- ((type & 0x1) << BACKGROUND_POSITION_SHIFT);
-
- bits = &style->i.bits[BACKGROUND_POSITION_INDEX1];
-
- /* 8bits: hhhhvvvv : hunit | vunit */
- *bits = (((hunit << 4) | vunit) << BACKGROUND_POSITION_SHIFT1);
-
- style->i.background_position[0] = hlength;
- style->i.background_position[1] = vlength;
-
- return CSS_OK;
-}
-#undef BACKGROUND_POSITION_SHIFT1
-#undef BACKGROUND_POSITION_INDEX1
-#undef BACKGROUND_POSITION_MASK
-#undef BACKGROUND_POSITION_SHIFT
-#undef BACKGROUND_POSITION_INDEX
-
-#define DISPLAY_INDEX 27
-#define DISPLAY_SHIFT 2
-#define DISPLAY_MASK 0x7c
-static inline css_error set_display(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[DISPLAY_INDEX];
-
- /* 5bits: type */
- *bits = (*bits & ~DISPLAY_MASK) |
- ((type & 0x1f) << DISPLAY_SHIFT);
-
- return CSS_OK;
-}
-#undef DISPLAY_MASK
-#undef DISPLAY_SHIFT
-#undef DISPLAY_INDEX
-
-#define FONT_VARIANT_INDEX 27
-#define FONT_VARIANT_SHIFT 0
-#define FONT_VARIANT_MASK 0x3
-static inline css_error set_font_variant(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[FONT_VARIANT_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~FONT_VARIANT_MASK) |
- ((type & 0x3) << FONT_VARIANT_SHIFT);
-
- return CSS_OK;
-}
-#undef FONT_VARIANT_MASK
-#undef FONT_VARIANT_SHIFT
-#undef FONT_VARIANT_INDEX
-
-#define TEXT_DECORATION_INDEX 28
-#define TEXT_DECORATION_SHIFT 3
-#define TEXT_DECORATION_MASK 0xf8
-static inline css_error set_text_decoration(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[TEXT_DECORATION_INDEX];
-
- /* 5bits: type */
- *bits = (*bits & ~TEXT_DECORATION_MASK) |
- ((type & 0x1f) << TEXT_DECORATION_SHIFT);
-
- return CSS_OK;
-}
-#undef TEXT_DECORATION_MASK
-#undef TEXT_DECORATION_SHIFT
-#undef TEXT_DECORATION_INDEX
-
-#define FONT_FAMILY_INDEX 28
-#define FONT_FAMILY_SHIFT 0
-#define FONT_FAMILY_MASK 0x7
-static inline css_error set_font_family(
- css_computed_style *style, uint8_t type,
- lwc_string **names)
-{
- uint8_t *bits = &style->i.bits[FONT_FAMILY_INDEX];
- lwc_string **oldnames = style->font_family;
- lwc_string **s;
-
- /* 3bits: type */
- *bits = (*bits & ~FONT_FAMILY_MASK) |
- ((type & 0x7) << FONT_FAMILY_SHIFT);
-
- for (s = names; s != NULL && *s != NULL; s++)
- *s = lwc_string_ref(*s);
-
- style->font_family = names;
-
- /* Free existing families */
- if (oldnames != NULL) {
- for (s = oldnames; *s != NULL; s++)
- lwc_string_unref(*s);
-
- if (oldnames != names)
- free(oldnames);
- }
-
- return CSS_OK;
-}
-#undef FONT_FAMILY_MASK
-#undef FONT_FAMILY_SHIFT
-#undef FONT_FAMILY_INDEX
-
-#define BORDER_TOP_STYLE_INDEX 29
-#define BORDER_TOP_STYLE_SHIFT 4
-#define BORDER_TOP_STYLE_MASK 0xf0
-static inline css_error set_border_top_style(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BORDER_TOP_STYLE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BORDER_TOP_STYLE_MASK) |
- ((type & 0xf) << BORDER_TOP_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef BORDER_TOP_STYLE_MASK
-#undef BORDER_TOP_STYLE_SHIFT
-#undef BORDER_TOP_STYLE_INDEX
-
-#define BORDER_RIGHT_STYLE_INDEX 29
-#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)
-{
- uint8_t *bits = &style->i.bits[BORDER_RIGHT_STYLE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BORDER_RIGHT_STYLE_MASK) |
- ((type & 0xf) << BORDER_RIGHT_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef BORDER_RIGHT_STYLE_MASK
-#undef BORDER_RIGHT_STYLE_SHIFT
-#undef BORDER_RIGHT_STYLE_INDEX
-
-#define BORDER_BOTTOM_STYLE_INDEX 30
-#define BORDER_BOTTOM_STYLE_SHIFT 4
-#define BORDER_BOTTOM_STYLE_MASK 0xf0
-static inline css_error set_border_bottom_style(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BORDER_BOTTOM_STYLE_MASK) |
- ((type & 0xf) << BORDER_BOTTOM_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef BORDER_BOTTOM_STYLE_MASK
-#undef BORDER_BOTTOM_STYLE_SHIFT
-#undef BORDER_BOTTOM_STYLE_INDEX
-
-#define BORDER_LEFT_STYLE_INDEX 30
-#define BORDER_LEFT_STYLE_SHIFT 0
-#define BORDER_LEFT_STYLE_MASK 0xf
-static inline css_error set_border_left_style(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[BORDER_LEFT_STYLE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~BORDER_LEFT_STYLE_MASK) |
- ((type & 0xf) << BORDER_LEFT_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef BORDER_LEFT_STYLE_MASK
-#undef BORDER_LEFT_STYLE_SHIFT
-#undef BORDER_LEFT_STYLE_INDEX
-
-#define FONT_WEIGHT_INDEX 31
-#define FONT_WEIGHT_SHIFT 4
-#define FONT_WEIGHT_MASK 0xf0
-static inline css_error set_font_weight(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[FONT_WEIGHT_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~FONT_WEIGHT_MASK) |
- ((type & 0xf) << FONT_WEIGHT_SHIFT);
-
- return CSS_OK;
-}
-#undef FONT_WEIGHT_MASK
-#undef FONT_WEIGHT_SHIFT
-#undef FONT_WEIGHT_INDEX
-
-#define LIST_STYLE_TYPE_INDEX 31
-#define LIST_STYLE_TYPE_SHIFT 0
-#define LIST_STYLE_TYPE_MASK 0xf
-static inline css_error set_list_style_type(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[LIST_STYLE_TYPE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~LIST_STYLE_TYPE_MASK) |
- ((type & 0xf) << LIST_STYLE_TYPE_SHIFT);
-
- return CSS_OK;
-}
-#undef LIST_STYLE_TYPE_MASK
-#undef LIST_STYLE_TYPE_SHIFT
-#undef LIST_STYLE_TYPE_INDEX
-
-#define OUTLINE_STYLE_INDEX 32
-#define OUTLINE_STYLE_SHIFT 4
-#define OUTLINE_STYLE_MASK 0xf0
-static inline css_error set_outline_style(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[OUTLINE_STYLE_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~OUTLINE_STYLE_MASK) |
- ((type & 0xf) << OUTLINE_STYLE_SHIFT);
-
- return CSS_OK;
-}
-#undef OUTLINE_STYLE_MASK
-#undef OUTLINE_STYLE_SHIFT
-#undef OUTLINE_STYLE_INDEX
-
-#define TABLE_LAYOUT_INDEX 32
-#define TABLE_LAYOUT_SHIFT 2
-#define TABLE_LAYOUT_MASK 0xc
-static inline css_error set_table_layout(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[TABLE_LAYOUT_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~TABLE_LAYOUT_MASK) |
- ((type & 0x3) << TABLE_LAYOUT_SHIFT);
-
- return CSS_OK;
-}
-#undef TABLE_LAYOUT_MASK
-#undef TABLE_LAYOUT_SHIFT
-#undef TABLE_LAYOUT_INDEX
-
-#define UNICODE_BIDI_INDEX 32
-#define UNICODE_BIDI_SHIFT 0
-#define UNICODE_BIDI_MASK 0x3
-static inline css_error set_unicode_bidi(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[UNICODE_BIDI_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~UNICODE_BIDI_MASK) |
- ((type & 0x3) << UNICODE_BIDI_SHIFT);
-
- return CSS_OK;
-}
-#undef UNICODE_BIDI_MASK
-#undef UNICODE_BIDI_SHIFT
-#undef UNICODE_BIDI_INDEX
-
-#define VISIBILITY_INDEX 33
-#define VISIBILITY_SHIFT 6
-#define VISIBILITY_MASK 0xc0
-static inline css_error set_visibility(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[VISIBILITY_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~VISIBILITY_MASK) |
- ((type & 0x3) << VISIBILITY_SHIFT);
-
- return CSS_OK;
-}
-#undef VISIBILITY_MASK
-#undef VISIBILITY_SHIFT
-#undef VISIBILITY_INDEX
-
-#define LIST_STYLE_POSITION_INDEX 33
-#define LIST_STYLE_POSITION_SHIFT 4
-#define LIST_STYLE_POSITION_MASK 0x30
-static inline css_error set_list_style_position(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[LIST_STYLE_POSITION_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~LIST_STYLE_POSITION_MASK) |
- ((type & 0x3) << LIST_STYLE_POSITION_SHIFT);
-
- return CSS_OK;
-}
-#undef LIST_STYLE_POSITION_MASK
-#undef LIST_STYLE_POSITION_SHIFT
-#undef LIST_STYLE_POSITION_INDEX
-
-#define TEXT_ALIGN_INDEX 33
-#define TEXT_ALIGN_SHIFT 0
-#define TEXT_ALIGN_MASK 0xf
-static inline uint8_t set_text_align(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits = &style->i.bits[TEXT_ALIGN_INDEX];
-
- /* 4bits: type */
- *bits = (*bits & ~TEXT_ALIGN_MASK) |
- ((type & 0xf) << TEXT_ALIGN_SHIFT);
-
- return CSS_OK;
-}
-#undef TEXT_ALIGN_MASK
-#undef TEXT_ALIGN_SHIFT
-#undef TEXT_ALIGN_INDEX
-
-#define PAGE_BREAK_AFTER_INDEX 0
-#define PAGE_BREAK_AFTER_SHIFT 0
-#define PAGE_BREAK_AFTER_MASK 0x7
-static inline css_error set_page_break_after(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- if (style->page == NULL) {
- if (type == CSS_PAGE_BREAK_AFTER_AUTO) {
- return CSS_OK;
- }
- }
-
- ENSURE_PAGE;
-
- bits = &style->page->bits[PAGE_BREAK_AFTER_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~PAGE_BREAK_AFTER_MASK) |
- ((type & 0x7) << PAGE_BREAK_AFTER_SHIFT);
-
- return CSS_OK;
-}
-#undef PAGE_BREAK_AFTER_INDEX
-#undef PAGE_BREAK_AFTER_SHIFT
-#undef PAGE_BREAK_AFTER_MASK
-
-#define PAGE_BREAK_BEFORE_INDEX 0
-#define PAGE_BREAK_BEFORE_SHIFT 3
-#define PAGE_BREAK_BEFORE_MASK 0x38
-static inline css_error set_page_break_before(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- if (style->page == NULL) {
- if (type == CSS_PAGE_BREAK_BEFORE_AUTO) {
- return CSS_OK;
- }
- }
-
- ENSURE_PAGE;
-
- bits = &style->page->bits[PAGE_BREAK_BEFORE_INDEX];
-
- /* 3bits: type */
- *bits = (*bits & ~PAGE_BREAK_BEFORE_MASK) |
- ((type & 0x7) << PAGE_BREAK_BEFORE_SHIFT);
-
- return CSS_OK;
-}
-#undef PAGE_BREAK_BEFORE_INDEX
-#undef PAGE_BREAK_BEFORE_SHIFT
-#undef PAGE_BREAK_BEFORE_MASK
-
-#define PAGE_BREAK_INSIDE_INDEX 0
-#define PAGE_BREAK_INSIDE_SHIFT 6
-#define PAGE_BREAK_INSIDE_MASK 0xc0
-static inline css_error set_page_break_inside(
- css_computed_style *style, uint8_t type)
-{
- uint8_t *bits;
-
- if (style->page == NULL) {
- if (type == CSS_PAGE_BREAK_INSIDE_AUTO) {
- return CSS_OK;
- }
- }
-
- ENSURE_PAGE;
-
- bits = &style->page->bits[PAGE_BREAK_INSIDE_INDEX];
-
- /* 2bits: type */
- *bits = (*bits & ~PAGE_BREAK_INSIDE_MASK) |
- ((type & 0x3) << PAGE_BREAK_INSIDE_SHIFT);
-
- return CSS_OK;
-}
-#undef PAGE_BREAK_INSIDE_INDEX
-#undef PAGE_BREAK_INSIDE_SHIFT
-#undef PAGE_BREAK_INSIDE_MASK
-
-#define ORPHANS_INDEX 1
-#define ORPHANS_SHIFT 0
-#define ORPHANS_MASK 0x1
-static inline css_error set_orphans(
- css_computed_style *style, uint8_t type, int32_t count)
-{
- uint8_t *bits;
-
- if (style->page == NULL) {
- if (type == CSS_ORPHANS_SET && count == 2) {
- return CSS_OK;
- }
- }
-
- ENSURE_PAGE;
-
- bits = &style->page->bits[ORPHANS_INDEX];
-
- /* 1bit: type */
- *bits = (*bits & ~ORPHANS_MASK) | ((type & 0x1) << ORPHANS_SHIFT);
-
- style->page->orphans = count;
-
- return CSS_OK;
-}
-#undef ORPHANS_INDEX
-#undef ORPHANS_SHIFT
-#undef ORPHANS_MASK
-
-#define WIDOWS_INDEX 1
-#define WIDOWS_SHIFT 1
-#define WIDOWS_MASK 0x2
-static inline css_error set_widows(
- css_computed_style *style, uint8_t type, int32_t count)
-{
- uint8_t *bits;
-
- if (style->page == NULL) {
- if (type == CSS_WIDOWS_SET && count == 2) {
- return CSS_OK;
- }
- }
-
- ENSURE_PAGE;
-
- bits = &style->page->bits[WIDOWS_INDEX];
-
- /* 1bit: type */
- *bits = (*bits & ~WIDOWS_MASK) | ((type & 0x1) << WIDOWS_SHIFT);
-
- style->page->widows = count;
-
- return CSS_OK;
-}
-#undef WIDOWS_INDEX
-#undef WIDOWS_SHIFT
-#undef WIDOWS_MASK
+#include "autogenerated_propset.h"
#endif
diff --git a/src/select/select_config.py b/src/select/select_config.py
new file mode 100644
index 0000000..a543542
--- a/dev/null
+++ b/src/select/select_config.py
@@ -0,0 +1,176 @@
+# This file is part of LibCSS.
+# Licensed under the MIT License,
+# http://www.opensource.org/licenses/mit-license.php
+# Copyright 2017 Lucas Neves <lcneves@gmail.com>
+
+# Configuration of CSS values.
+# The tuples in this set will be unpacked as arguments to the CSSValue
+# class.
+# Args: see docstring for class CSSValue in select_generator.py.
+values = {
+ ('length', 'css_fixed', 4, '0',
+ 'unit', 'css_unit', 5, 'CSS_UNIT_PX'),
+ ('integer', 'int32_t', 4, '0'),
+ ('fixed', 'css_fixed', 4, '0'),
+ ('color', 'css_color', 4, '0'),
+ ('string', 'lwc_string*'),
+ ('string_arr', 'lwc_string**'),
+ ('counter_arr', 'css_computed_counter*'),
+ ('content_item', 'css_computed_content_item*')
+}
+
+# Configuration of property groups.
+# The tuples in these sets will be unpacked as arguments to the
+# CSSproperty class.
+# Args: see docstring for class CSSProperty in select_generator.py.
+style = {
+ # Style group, only opcode
+ ('align_content', 3),
+ ('align_items', 3),
+ ('align_self', 3),
+ ('background_attachment', 2),
+ ('background_repeat', 3),
+ ('border_collapse', 2),
+ ('border_top_style', 4),
+ ('border_right_style', 4),
+ ('border_bottom_style', 4),
+ ('border_left_style', 4),
+ ('box_sizing', 2),
+ ('caption_side', 2),
+ ('clear', 3),
+ ('direction', 2),
+ ('display', 5),
+ ('empty_cells', 2),
+ ('flex_direction', 3),
+ ('flex_wrap', 2),
+ ('float', 2),
+ ('font_style', 2),
+ ('font_variant', 2),
+ ('font_weight', 4),
+ ('justify_content', 3),
+ ('list_style_position', 2),
+ ('list_style_type', 4),
+ ('overflow_x', 3),
+ ('overflow_y', 3),
+ ('outline_style', 4),
+ ('position', 3),
+ ('table_layout', 2),
+ ('text_align', 4),
+ ('text_decoration', 5),
+ ('text_transform', 3),
+ ('unicode_bidi', 2),
+ ('visibility', 2),
+ ('white_space', 3),
+ # Style group, with additional value
+ ('background_color', 2, 'color'),
+ ('background_image', 1, 'string'),
+ ('background_position', 1, (('length',), ('length',)),
+ 'CSS_BACKGROUND_POSITION_SET'),
+ ('border_top_color', 2, 'color'),
+ ('border_right_color', 2, 'color'),
+ ('border_bottom_color', 2, 'color'),
+ ('border_left_color', 2, 'color'),
+ ('border_top_width', 3, 'length', 'CSS_BORDER_WIDTH_WIDTH'),
+ ('border_right_width', 3, 'length', 'CSS_BORDER_WIDTH_WIDTH'),
+ ('border_bottom_width', 3, 'length', 'CSS_BORDER_WIDTH_WIDTH'),
+ ('border_left_width', 3, 'length', 'CSS_BORDER_WIDTH_WIDTH'),
+ ('top', 2, 'length', 'CSS_TOP_SET', None, None, 'get'),
+ ('right', 2, 'length', 'CSS_RIGHT_SET', None, None, 'get'),
+ ('bottom', 2, 'length', 'CSS_BOTTOM_SET', None, None, 'get'),
+ ('left', 2, 'length', 'CSS_LEFT_SET', None, None, 'get'),
+ ('color', 1, 'color'),
+ ('flex_basis', 2, 'length', 'CSS_FLEX_BASIS_SET'),
+ ('flex_grow', 1, 'fixed', 'CSS_FLEX_GROW_SET'),
+ ('flex_shrink', 1, 'fixed', 'CSS_FLEX_SHRINK_SET'),
+ ('font_size', 4, 'length', 'CSS_FONT_SIZE_DIMENSION'),
+ ('height', 2, 'length', 'CSS_HEIGHT_SET'),
+ ('line_height', 2, 'length', None, None, None, 'get'),
+ ('list_style_image', 1, 'string'),
+ ('margin_top', 2, 'length', 'CSS_MARGIN_SET'),
+ ('margin_right', 2, 'length', 'CSS_MARGIN_SET'),
+ ('margin_bottom', 2, 'length', 'CSS_MARGIN_SET'),
+ ('margin_left', 2, 'length', 'CSS_MARGIN_SET'),
+ ('max_height', 2, 'length', 'CSS_MAX_HEIGHT_SET'),
+ ('max_width', 2, 'length', 'CSS_MAX_WIDTH_SET'),
+ ('min_height', 2, 'length', 'CSS_MIN_HEIGHT_SET'),
+ ('min_width', 2, 'length', 'CSS_MIN_WIDTH_SET'),
+ ('opacity', 1, 'fixed', 'CSS_OPACITY_SET'),
+ ('order', 1, 'integer', 'CSS_ORDER_SET'),
+ ('padding_top', 1, 'length', 'CSS_PADDING_SET'),
+ ('padding_right', 1, 'length', 'CSS_PADDING_SET'),
+ ('padding_left', 1, 'length', 'CSS_PADDING_SET'),
+ ('padding_bottom', 1, 'length', 'CSS_PADDING_SET'),
+ ('text_indent', 1, 'length', 'CSS_TEXT_INDENT_SET'),
+ ('vertical_align', 4, 'length', 'CSS_VERTICAL_ALIGN_SET'),
+ ('width', 2, 'length', 'CSS_WIDTH_SET'),
+ ('z_index', 2, 'integer'),
+ # Style group, arrays
+ ('font_family', 3, 'string_arr', None, None,
+ 'Encode font family as an array of string objects, terminated with a '
+ 'blank entry.'),
+ ('quotes', 1, 'string_arr', None, None,
+ 'Encode quotes as an array of string objects, terminated with a '
+ 'blank entry.')
+}
+
+page = {
+ # Page group
+ ('page_break_after', 3, None, None, 'CSS_PAGE_BREAK_AFTER_AUTO'),
+ ('page_break_before', 3, None, None, 'CSS_PAGE_BREAK_BEFORE_AUTO'),
+ ('page_break_inside', 2, None, None, 'CSS_PAGE_BREAK_INSIDE_AUTO'),
+ ('widows', 1, (('integer', '2'),), None,
+ 'CSS_WIDOWS_SET'),
+ ('orphans', 1, (('integer', '2'),), None,
+ 'CSS_ORPHANS_SET')
+}
+
+uncommon = {
+ # Uncommon group
+ ('border_spacing', 1, (('length',), ('length',)), 'CSS_BORDER_SPACING_SET',
+ 'CSS_BORDER_SPACING_SET'),
+ ('break_after', 4, None, None, 'CSS_BREAK_AFTER_AUTO'),
+ ('break_before', 4, None, None, 'CSS_BREAK_BEFORE_AUTO'),
+ ('break_inside', 4, None, None, 'CSS_BREAK_INSIDE_AUTO'),
+ ('clip', 6, (('length',), ('length',), ('length',), ('length',)),
+ 'CSS_CLIP_RECT', 'CSS_CLIP_AUTO', None, ('get', 'set')),
+ ('column_count', 2, 'integer', None, 'CSS_COLUMN_COUNT_AUTO'),
+ ('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_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'),
+ ('column_span', 2, None, None, 'CSS_COLUMN_SPAN_NONE'),
+ ('column_width', 2, 'length',
+ 'CSS_COLUMN_WIDTH_SET', 'CSS_COLUMN_WIDTH_AUTO'),
+ ('letter_spacing', 2, 'length',
+ 'CSS_LETTER_SPACING_SET', 'CSS_LETTER_SPACING_NORMAL'),
+ ('outline_color', 2, 'color',
+ 'CSS_OUTLINE_COLOR_COLOR', 'CSS_OUTLINE_COLOR_INVERT'),
+ ('outline_width', 3, 'length',
+ '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, '
+ 'terminated with a blank entry.'),
+ ('counter_reset', 1, 'counter_arr', None, 'CSS_COUNTER_RESET_NONE',
+ 'Encode counter_reset as an array of name, value pairs, '
+ 'terminated with a blank entry.'),
+ ('cursor', 5, 'string_arr', None, 'CSS_CURSOR_AUTO',
+ 'Encode cursor uri(s) as an array of string objects, terminated '
+ 'with a blank entry'),
+ ('content', 2, 'content_item', 'CSS_CONTENT_SET', 'CSS_CONTENT_NORMAL',
+ 'Encode content as an array of content items, terminated with '
+ 'a blank entry.', 'set')
+}
+
+groups = [
+ { 'name': 'uncommon', 'props': uncommon },
+ { 'name': 'page', 'props': page },
+ { 'name': 'style', 'props': style }
+]
diff --git a/src/select/select_generator.py b/src/select/select_generator.py
new file mode 100644
index 0000000..f87c929
--- a/dev/null
+++ b/src/select/select_generator.py
@@ -0,0 +1,831 @@
+# This file is part of LibCSS.
+# Licensed under the MIT License,
+# http://www.opensource.org/licenses/mit-license.php
+# Copyright 2017 Lucas Neves <lcneves@gmail.com>
+
+import math
+import string
+import os
+from select_config import values, groups
+from assets import assets
+from overrides import overrides
+
+def get_tuple(from_var):
+ """Convert tuples, strings and None into tuple."""
+ if type(from_var) is tuple:
+ return from_var
+ elif type(from_var) is str:
+ return (from_var,)
+ elif from_var is None:
+ return ()
+ else:
+ raise TypeError('Value should be either tuple, string or None, ' +
+ 'received: ' + type(from_var).__name__)
+
+def shift_star(value_type, prop_name):
+ """Shift the asterisks from a pointer type to its name.
+
+ Example: `lwc_string** str_array` would become
+ `lwc_string **str_array`
+ """
+ star_i = value_type.find('*')
+ v_type = value_type if star_i is -1 else value_type[:star_i]
+ v_name = prop_name if star_i is -1 else value_type[star_i:] + prop_name
+ return (v_type, v_name)
+
+class Text:
+ """Class for building strings for output files."""
+ def __init__(self):
+ self._lines = []
+ self._comment = False
+ self._esc_nl = False
+ self._indent = 0
+
+ name_width = 31
+ bits_width = 16
+
+ def indent(self, value):
+ """Increase or decrease indent by <value>.
+
+ Args:
+ value <int>: positive or negative value to be added to
+ indentation.
+ """
+ self._indent += value
+
+ def comment(self):
+ """Toggle C-style comment in the output text."""
+ comm = self._comment
+ self._comment = False
+ self.append(' */' if comm else '/*')
+ self._comment = not comm
+
+ def escape_newline(self):
+ """Toggle escape of newline character."""
+ self._esc_nl = not self._esc_nl
+
+ def append(self, text=None, pre_formatted=False):
+ """Append text to file builder.
+
+ Args:
+ text:
+ <str> add contents, breaking lines and adding comment
+ markers or newline escapes as needed.
+ <list> recursively call this method for list items.
+ <falsey value> add a new line.
+ pre_formatted: just add text without preprocessing.
+ """
+ if not text:
+ self._lines.append('{}{}{}'.format(
+ '\t' * self._indent,
+ ' * ' if self._comment else '',
+ '\t' * (9 - self._indent) + '\\' if self._esc_nl else ''))
+ return
+
+ if isinstance(text, list):
+ for t in text:
+ self.append(t, pre_formatted)
+ return
+
+ if pre_formatted:
+ self._lines.append(text)
+ return
+
+ line_break_before = [ c for c in ' +/' ]
+ line_break_after = [ c for c in '({[' ]
+ column_max = 72 if self._esc_nl else 80
+ multiline = False
+
+ while text:
+ line = '\t' * self._indent
+ if self._comment:
+ line += ' * '
+ prefix_size = (3 if self._comment else 0) + 8 * self._indent
+ if prefix_size + len(text) <= column_max:
+ line += text
+ text = ''
+ else:
+ break_index = 0
+ for c in (line_break_before + line_break_after):
+ after = 1 if c in line_break_after else 0
+ break_index = max(break_index,
+ text[:column_max - prefix_size].rfind(c) + after)
+ break_index = break_index or len(text)
+ line += text[:break_index].rstrip()
+ text = text[break_index:].lstrip()
+ if self._esc_nl:
+ n_tabs = 9 - self._indent - math.floor(len(line.lstrip()) / 8)
+ line += '\t' * n_tabs + '\\'
+ self._lines.append(line)
+ if text and not self._comment and not multiline:
+ self.indent(2)
+ multiline = True
+
+ if multiline:
+ self.indent(-2)
+
+ def table_line(self):
+ """Add a sum line for the tables in computed.h"""
+ self.append('{0:{n}}{0:{b}}{0}'.format(
+ '---', n=self.name_width, b=self.bits_width))
+
+ def table_header(self):
+ """Add a header line for the tables in computed.h"""
+ self.append('{:{n}}{:{b}}{}'.format(
+ 'Property', 'Size (bits)', 'Size (bytes)',
+ n=self.name_width, b=self.bits_width))
+ self.table_line()
+
+ def result_line(self):
+ """Add a result line for the tables in computed.h"""
+ self.append(' ' * self.name_width + '=' * (self.bits_width + 3))
+
+ def to_string(self):
+ """Output contents of file builder as a string."""
+ return '\n'.join(self._lines)
+
+class CSSValue:
+ """Values to be associated with properties.
+
+ Args:
+ name <str>: value name (required).
+ css_type <str>: C type of value (required).
+ size <int>: value size, in bytes (default: None, for pointers).
+ defaults <str>: default value (default: 'NULL', for pointers).
+ The fields below are only needed if the value stores data in the
+ array of bits (currently only css_unit uses it).
+ bits_name <str>: name of bits value (default: None).
+ bits_type <str>: C type of bits value (default: None).
+ bits_size <int>: value size, in bits (default: None).
+ bits_defaults <str>: default value (default: '0').
+ """
+ def __init__(self, name, css_type, size=None, defaults='NULL',
+ bits_name=None, bits_type=None,
+ bits_size=None, bits_defaults='0'):
+ self.name = name
+ self.type = css_type
+ self.size = size # `None` means sizeof(ptr)
+ self.defaults = defaults
+ self.suffix = ''
+ self.bits = None if bits_size is None else {
+ 'name': bits_name,
+ 'type': bits_type,
+ 'size': bits_size,
+ 'defaults': bits_defaults
+ }
+
+ @property
+ def is_ptr(self):
+ """Return True if value is a pointer; False otherwise."""
+ return ((self.type, self.name) != shift_star(self.type, self.name))
+
+class CSSProperty:
+ """Class for CSS properties.
+
+ Args:
+ name <str>: property name (required).
+ type_size <int>: opcode size, in bits (required).
+ values <tuple or str>: property values (default: None).
+ To set one value, using the value's defaults:
+ 'value_name'
+ To set multiple values, using the values' defaults:
+ (('value_name',), ('value_name',))
+ To override the default of one or multiple values:
+ (('value_name', 'default'),)
+ (('value_name', 'default'), ('value_name', 'default'))
+ condition <str>: condition (opcode value) to get property
+ values in propget.h (default: None).
+ defaults <str>: default opcode (default: None)
+ comments <str>: comments for properties that are stored in
+ "struct css_computed_{group}", instead of
+ "struct css_computed_{group}_i (default: None)
+ NOTE: passing this argument will result in the property being
+ stored in "struct css_computed_{group}"!
+ overrides <tuple | str>: files for which this property shouldn't
+ autogenerate content; instead, read entry from from overrides.py
+ Possible values:
+ 'get': overrides output to autogenerated_propget.h
+ 'set': overrides output to autogenerated_propset.h
+ ('get', 'set'): overrides output to both files.
+ """
+ def __init__(self, name, type_size, values=None, condition=None,
+ defaults=None, comments=None, override=None):
+ self.name = name
+ self.type_size = type_size
+ self.values = self.make_values(values)
+ self.defaults = defaults
+ self.condition = condition
+ self.override = get_tuple(override)
+ self.comments = comments
+ self.__mask = None
+ self.index = None
+ self.shift = None
+
+ def make_values(self, vals):
+ """Make list of values for this property."""
+ if vals is None:
+ return []
+ elif type(vals) is str:
+ return self.make_values(((vals,),))
+ elif type(vals) is tuple:
+ val_list = []
+ for i, v in enumerate(vals):
+ for x in values:
+ if x[0] == v[0]:
+ value = CSSValue(*x)
+ if len(v) is 2:
+ value.defaults = v[1]
+ if len(vals) > 1:
+ value.suffix = '_' + string.ascii_lowercase[i]
+ val_list.append(value)
+ break
+ else:
+ raise ValueError('Value ' + v[0] + ' not found!')
+ return val_list
+ else:
+ raise TypeError('Expected None, str or tuple, got ' +
+ type(vals).__name__)
+
+ @property
+ def bits_size(self):
+ """Size of this property in the bits array."""
+ return self.type_size + sum([ v.bits['size'] for v in self.values
+ if v.bits is not None ])
+
+ @property
+ def bytes_size(self):
+ """Size of this property's values, in bytes (excluding pointers)."""
+ return sum([ v.size for v in self.values if v.size is not None ])
+
+ @property
+ def ptr_size(self):
+ """Number of values of this property that are pointers."""
+ return sum([ 1 for v in self.values if v.size is None ])
+
+ @property
+ def size_line(self):
+ """String for computed.h with the sizes of this property."""
+ name = '{:{width}}'.format(self.name, width=Text.name_width)
+ type_size = '{:>3}'.format(str(self.type_size))
+ extra_size = sum([ v.bits['size'] for v in self.values
+ if v.bits is not None ])
+ bits_size = '{:{width}}'.format(type_size +
+ (' + ' + str(extra_size) if extra_size else ''),
+ width=Text.bits_width)
+ vars_size = '{:>3}'.format(
+ str(self.bytes_size)) if self.bytes_size else ''
+ ptr = ''
+ for v in self.values:
+ if v.size is None:
+ ptr = 'sizeof(ptr)'
+ break
+
+ return (name + bits_size + vars_size +
+ (' + ' if vars_size and ptr else '') + ptr)
+
+ @property
+ def mask(self):
+ """Getter for the bitwise mask of this property in the bits array."""
+ if self.__mask is None:
+ raise NameError('Attribute `mask` not set yet!')
+ return '0x{:x}'.format(self.__mask).lower()
+
+ @mask.setter
+ def mask(self, val):
+ """Setter for the bitwise mask of this property in the bits array."""
+ if type(val) is not int:
+ raise TypeError('Value of `mask` must be an integer!')
+ if val < 0:
+ raise ValueError('Value of `mask` must be zero or positive!')
+ self.__mask = val
+
+ @property
+ def def_undefs(self):
+ """Return defines and undefs for propget.h and propset.h."""
+ defines = [
+ '#define {}_INDEX {}'.format(self.name.upper(), self.index),
+ '#define {}_SHIFT {}'.format(self.name.upper(), self.shift),
+ '#define {}_MASK {}'.format(self.name.upper(), self.mask)
+ ]
+ undefs = [
+ '#undef {}_INDEX'.format(self.name.upper()),
+ '#undef {}_SHIFT'.format(self.name.upper()),
+ '#undef {}_MASK'.format(self.name.upper())
+ ]
+ return (defines, undefs)
+
+ def get_param_values(self, pointer=False):
+ """Make parameters for functions in propget.h and propset.h.
+
+ Args:
+ pointer <bool>: add a star before value name.
+ """
+ vals = []
+ for v in self.values:
+ vt, vn = shift_star(v.type, v.name)
+ vn += v.suffix
+ if pointer:
+ vn = '*' + vn
+ if v.name == 'counter_arr' or v.name == 'content_item':
+ vt = 'const ' + vt
+ vals.append((vt, vn))
+ if v.bits is not None:
+ bt, bn = shift_star(v.bits['type'], v.bits['name'])
+ bn += v.suffix
+ if pointer:
+ bn = '*' + bn
+ vals.append((bt, bn))
+ return vals
+
+ def get_bits(self):
+ """Make vars for the bitwise operations in propget.h and propset.h."""
+ bits = [
+ { 'letter': v.suffix[1] if v.suffix else v.bits['name'][0],
+ 'name': v.bits['name'] + v.suffix,
+ 'size': v.bits['size'] }
+ for v in self.values if v.bits is not None ]
+ bits.append({ 'letter': 't', 'size': self.type_size, 'name': 'type' })
+ bits_len = sum([ x['size'] for x in bits ])
+ comment = '/* {}bit{}: {} : {} */'.format(
+ bits_len,
+ ('' if bits_len is 1 else 's'),
+ ''.join([ b['letter'] * b['size'] for b in bits ]),
+ ' | '.join([ b['name'] for b in bits ]))
+ rev_bits = list(reversed(bits))
+ type_mask = '0x{:x}'.format(
+ sum([ 2 ** x for x in range(rev_bits[0]['size']) ])).lower()
+ shift_list = [ (x['name'],
+ sum([ b['size'] for b in rev_bits[:(i + 1)] ]),
+ sum([ 2 ** x for x in range(x['size']) ]) * 2 **
+ sum([ b['size'] for b in rev_bits[:(i + 1)] ]))
+ for i, x in enumerate(rev_bits[1:]) ]
+ return (type_mask, shift_list, comment)
+
+class Bin:
+ """The storage unit for the bits array of properties."""
+ def __init__(self, first_object):
+ self.contents = [ first_object ]
+
+ @property
+ def size(self):
+ return sum([ x.bits_size for x in self.contents ])
+
+ def push(self, obj):
+ self.contents.append(obj)
+
+class CSSGroup:
+ """Group of CSS properties (i.e. style, page, uncommon).
+
+ Args:
+ config <tuple>: imported from select_config.py.
+ """
+ def __init__(self, config):
+ self.name = config['name']
+ self.props = [ CSSProperty(*x) for x in config['props'] ]
+ self.bits_array = self.make_bits_array()
+
+ @property
+ def bits_size(self):
+ """Sum of all property bits in the bits array."""
+ return sum([ p.bits_size for p in self.props ])
+
+ @property
+ def bytes_size(self):
+ """Sum of all property value bytes (excluded pointers)."""
+ return sum([ p.bytes_size for p in self.props ])
+
+ @property
+ def ptr_size(self):
+ """Sum of all property pointers."""
+ return sum([ p.ptr_size for p in self.props ])
+
+ def make_bits_array(self):
+ """Implement a `best fit first` heuristics for the bin packing
+ of property bits in the bits array.
+ Also generate index, shift and mask for each property in group."""
+
+ bin_size = 32 # We're using uint32_t as concrete bins.
+ bits_array = []
+ props = sorted(self.props, key=(lambda x: x.bits_size), reverse=True)
+
+ for p in props:
+ for b in bits_array:
+ if b.size + p.bits_size <= bin_size:
+ b.push(p)
+ p.shift = (bin_size -
+ sum([ x.bits_size for x in b.contents ]))
+ break
+ else:
+ p.shift = bin_size - p.bits_size
+ bits_array.append(Bin(p))
+
+ p.mask = (sum([ 2 ** x for x in range(p.bits_size) ]) *
+ 2 ** p.shift)
+ bits_array.sort(key=(lambda x: x.size), reverse=True)
+
+ for i, b in enumerate(bits_array):
+ for p in b.contents:
+ p.index = i
+
+ return bits_array
+
+ def get_idot_grp(self):
+ """Make parameters for accessing bits and values in this group."""
+ i_dot = '' if self.name is 'page' else 'i.'
+ grp = '' if self.name is 'style' else '->{}{}'.format(
+ '' if self.name is 'page' else i_dot, self.name)
+ return (i_dot, grp)
+
+ def make_computed_h(self):
+ """Output this group's text for the computed.h file."""
+ t = Text()
+ t.append()
+
+ typedef = 'typedef ' if self.name is 'page' else ''
+ t.append('{}struct css_computed_{}{} {{'.format(
+ typedef, self.name, '' if self.name is 'page' else '_i'))
+
+ t.comment()
+ commented = []
+ t.table_header()
+
+ for prop in sorted(self.props, key=(lambda x: x.name)):
+ if prop.comments is None:
+ t.append(prop.size_line)
+ else:
+ commented.extend(( '', prop.comments, '', prop.size_line ))
+
+ t.append(commented)
+ t.append()
+ t.table_line()
+ t.append('{:{len_1}}{:>3}{:{len_2}}{:>3}{}{}'.format('',
+ str(self.bits_size), ' bits', str(self.bytes_size),
+ ' + ' + str(self.ptr_size) + 'sizeof(ptr)'
+ if self.ptr_size else '',
+ ' bytes',
+ len_1=Text.name_width, len_2=(Text.bits_width - 3)))
+ t.result_line()
+ t.append('{:{len_1}}{:>3}{}{}'.format('',
+ math.ceil(self.bits_size / 8) + self.bytes_size,
+ ' + ' + str(self.ptr_size) + 'sizeof(ptr)'
+ if self.ptr_size else '',
+ ' bytes', len_1=Text.name_width))
+ t.append()
+
+ t.append('Bit allocations:')
+ for i, b in enumerate(self.bits_array):
+ bits = []
+ for prop in b.contents:
+ for char in prop.name + prop.name.upper():
+ if char not in bits and char in string.ascii_letters:
+ bits.extend(char * prop.bits_size)
+ break
+ t.append()
+ t.append('{:<2} {:.<32}'.format(str(i), ''.join(bits)))
+ t.append('; '.join([ p.name for p in b.contents ]))
+ t.comment()
+
+ t.indent(1)
+ t.append('uint32_t bits[' + str(len(self.bits_array)) + '];')
+ t.append()
+ t.append(self.make_value_declaration(for_commented=False))
+
+ if self.name is 'style':
+ t.append()
+ for g in css_groups:
+ if g.name is not 'style' and g.name is not 'page':
+ t.append('css_computed_{0} *{0};'.format(g.name))
+ t.append('void *aural;')
+
+ t.indent(-1)
+ t.append('}}{};'.format(
+ ' css_computed_' + self.name if typedef else ''))
+
+ if self.name is not 'page':
+ typedef = 'typedef ' if self.name is not 'style' else ''
+ t.append()
+ t.append('{}struct css_computed_{} {{'.format(
+ typedef, self.name))
+ t.indent(1)
+ t.append('struct css_computed_' + self.name + '_i i;')
+ t.append()
+ t.append(self.make_value_declaration(for_commented=True))
+ t.append()
+
+ if self.name is 'style':
+ t.append('css_computed_page *page;')
+
+ t.append('struct css_computed_' + self.name + ' *next;')
+ t.append('uint32_t count;')
+ t.append('uint32_t bin;')
+ t.indent(-1)
+ t.append('}}{};'.format(
+ ' css_computed_' + self.name if typedef else ''))
+
+ return t.to_string()
+
+ def make_propset_h(self):
+ """Output this group's property functions for the propset.h file.
+
+ If group is not `style`, will also output the defaults
+ and the ENSURE_{group} texts.
+ """
+ t = Text()
+ i_dot, grp = self.get_idot_grp()
+
+ if self.name is not 'style':
+ t.append('static const css_computed_{0} default_{0} = {{'.format(
+ self.name))
+ t.indent(1)
+
+ if self.name is not 'page':
+ t.append('.i = {')
+ t.indent(1)
+
+ t.append('.bits = {')
+ t.indent(1)
+
+ bits_ops = []
+ for b in self.bits_array:
+ or_ops = []
+ for p in b.contents:
+ or_ops.append('({} << {})'.format(p.defaults, str(p.shift))
+ if p.shift else p.defaults)
+ bits_ops.append(' | '.join(or_ops))
+
+ t.append(',\n'.join(bits_ops).split('\n'))
+ t.indent(-1)
+ t.append('},')
+ t.append(',\n'.join(
+ self.make_value_declaration(False, True)).split('\n'))
+
+ if self.name is not 'page':
+ t.indent(-1)
+ t.append('},')
+ t.append(',\n'.join(
+ self.make_value_declaration(True, True) +
+ [ '.next = NULL', '.count = 0', '.bin = UINT32_MAX' ]
+ ).split('\n'))
+
+ t.indent(-1)
+ t.append('};')
+
+ t.append()
+ t.escape_newline()
+ t.append('#define ENSURE_{} do {{'.format(self.name.upper()))
+ t.indent(1)
+ t.append('if (style->{}{} == NULL) {{'.format(i_dot, self.name))
+ t.indent(1)
+ t.append('style->{}{n} = malloc(sizeof(css_computed_{n}));'.format(
+ i_dot, n=self.name))
+ t.append('if (style->{}{} == NULL)'.format(i_dot, self.name))
+ t.indent(1)
+ t.append('return CSS_NOMEM;')
+ t.indent(-1)
+ t.append()
+ t.append('memcpy(style->{}{n}, &default_{n}, '
+ 'sizeof(css_computed_{n}));'.format(i_dot, n=self.name))
+ t.indent(-1)
+ t.append('}')
+ t.indent(-1)
+ t.append('} while(0)')
+ t.escape_newline()
+ t.append()
+
+ for p in sorted(self.props, key=(lambda x: x.name)):
+ defines, undefs = p.def_undefs
+
+ t.append()
+ t.append(defines)
+
+ if p.name in overrides['set']:
+ t.append(overrides['set'][p.name], pre_formatted=True)
+ t.append(undefs)
+ continue
+
+ vals = p.get_param_values()
+ params = ', '.join([ 'css_computed_style *style', 'uint8_t type' ]
+ + [ ' '.join(x) for x in vals ])
+ t.append()
+ t.append('static inline css_error set_{}({})'.format(
+ p.name, params))
+ t.append('{')
+ t.indent(1)
+
+ t.append('uint32_t *bits;')
+ t.append()
+
+ if self.name is not 'style':
+ t.append('ENSURE_{};'.format(self.name.upper()))
+ t.append()
+
+ t.append('bits = &style{}->{}bits[{}_INDEX];'.format(
+ grp, i_dot, p.name.upper()))
+ t.append()
+
+ type_mask, shift_list, bits_comment = p.get_bits()
+ t.append(bits_comment)
+ type_mask = '(type & {})'.format(type_mask)
+ val_list = [ '({} << {})'.format(x[0], x[1]) for x in shift_list ]
+ ops_str = ' | '.join([ type_mask ] + val_list)
+ t.append('*bits = (*bits & ~{0}_MASK) | '
+ '({1}{2}{3} << {0}_SHIFT);'.format(
+ p.name.upper(),
+ '(' if val_list else '',
+ ops_str,
+ ')' if val_list else ''))
+
+ t.append()
+ for v in p.values:
+ old_n = 'old_' + v.name + v.suffix
+ old_t, old_n_shift = shift_star(v.type, old_n)
+
+ if v.name is 'string':
+ t.append('{} {} = style{}->{}{};'.format(
+ old_t, old_n_shift,
+ grp, i_dot, p.name + v.suffix))
+ t.append()
+ t.append('if ({} != NULL) {{'.format(v.name + v.suffix))
+ t.indent(1)
+ t.append('style{}->{}{} = lwc_string_ref({});'.format(
+ grp, i_dot, p.name + v.suffix, v.name + v.suffix))
+ t.indent(-1)
+ t.append('} else {')
+ t.indent(1)
+ 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.indent(1)
+ t.append('lwc_string_unref({});'.format(old_n))
+ t.indent(-1)
+
+ elif v.name is 'string_arr' or v.name is 'counter_arr':
+ iter_var = 's' if v.name is 'string_arr' else 'c'
+ iter_deref = '*s' if v.name is 'string_arr' else 'c->name'
+ t.append('{} {} = style{}->{};'.format(
+ old_t, old_n_shift,
+ grp, p.name + v.suffix))
+ t.append('{} {};'.format(old_t,
+ shift_star(v.type, iter_var)[1]))
+ t.append()
+ t.append('for ({0} = {2}; {0} != NULL && '
+ '{1} != NULL; {0}++)'.format(iter_var, iter_deref,
+ v.name + v.suffix))
+ t.indent(1)
+ t.append('{0} = lwc_string_ref({0});'.format(iter_deref))
+ t.indent(-1)
+ t.append()
+ t.append('style{}->{} = {};'.format(
+ grp, p.name + v.suffix, v.name + v.suffix))
+ t.append()
+ t.append('/* Free existing array */')
+ t.append('if ({} != NULL) {{'.format(old_n))
+ t.indent(1)
+ t.append('for ({0} = {2}; {1} != NULL; {0}++)'.format(
+ iter_var, iter_deref, old_n))
+ t.indent(1)
+ t.append('lwc_string_unref({});'.format(iter_deref))
+ t.indent(-1)
+ t.append()
+ t.append('if ({} != {})'.format(old_n, v.name + v.suffix))
+ t.indent(1)
+ t.append('free({});'.format(old_n))
+ t.indent(-2)
+ t.append('}')
+
+ elif not v.is_ptr:
+ t.append('style{}->{}{} = {};'.format(
+ grp, i_dot, p.name + v.suffix, v.name + v.suffix))
+
+ else:
+ raise ValueError('Cannot handle value ' + v.name +'!')
+
+ t.append()
+ t.append('return CSS_OK;')
+ t.indent(-1)
+ t.append('}')
+ t.append(undefs)
+
+ return t.to_string()
+
+ def make_propget_h(self):
+ """Output this group's property functions for the propget.h file."""
+ t = Text()
+ i_dot, grp = self.get_idot_grp()
+
+ for p in sorted(self.props, key=(lambda x: x.name)):
+ defines, undefs = p.def_undefs
+
+ t.append()
+ t.append(defines)
+
+ if p.name in overrides['get']:
+ t.append(overrides['get'][p.name], pre_formatted=True)
+ t.append(undefs)
+ continue
+
+ vals = p.get_param_values(pointer=True)
+ params = ', '.join([ 'css_computed_style *style' ]
+ + [ ' '.join(x) for x in vals ])
+ t.append('static inline uint8_t get_{}(const {})'.format(
+ p.name, params))
+ t.append('{')
+ t.indent(1)
+
+ if self.name is not 'style':
+ t.append('if (style{} != NULL) {{'.format(grp))
+ t.indent(1)
+
+ t.append('uint32_t bits = style{}->{}bits[{}_INDEX];'.format(
+ grp, i_dot, p.name.upper()))
+ t.append('bits &= {}_MASK;'.format(p.name.upper()))
+ t.append('bits >>= {}_SHIFT;'.format(p.name.upper()))
+ t.append()
+
+ type_mask, shift_list, bits_comment = p.get_bits()
+ t.append(bits_comment)
+
+ if p.condition:
+ t.append('if ((bits & {}) == {}) {{'.format(
+ type_mask, p.condition))
+ 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, 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]))
+ else:
+ t.append('*{} = (bits & 0x{:x}) >> {};'.format(
+ v[0], v[2], v[1]).lower())
+
+ if p.condition:
+ t.indent(-1)
+ t.append('}')
+
+ t.append()
+ t.append('return (bits & {});'.format(type_mask))
+
+ if self.name is not 'style':
+ t.indent(-1)
+ t.append('}')
+ t.append()
+ t.append('/* Initial value */')
+ for v in p.values:
+ t.append('*{} = {};'.format(v.name + v.suffix, v.defaults))
+ if v.bits is not None:
+ t.append('*{} = {};'.format(
+ v.bits['name'] + v.suffix, v.bits['defaults']))
+ t.append('return {};'.format(p.defaults))
+
+ t.indent(-1)
+ t.append('}')
+ t.append(undefs)
+
+ return t.to_string()
+
+ def make_value_declaration(self, for_commented, defaults=False):
+ """Output declarations of values for this group's properties.
+
+ Args:
+ for_commented: only parse values that have a `comment` field
+ defaults: outputs default value assignments.
+ """
+
+ r = []
+ for p in sorted(self.props, key=(lambda x: x.name)):
+ if bool(p.comments) == for_commented:
+ for v in p.values:
+ if defaults:
+ r.append('.{}{} = {}'.format(p.name, v.suffix,
+ v.defaults))
+ else:
+ v_type, v_name = shift_star(v.type, p.name)
+ r.append('{} {}{};'.format(v_type, v_name, v.suffix))
+ return r
+
+ def make_text(self, filename):
+ """Return this group's text for the given file."""
+ if filename == 'computed.h':
+ return self.make_computed_h()
+ elif filename == 'propset.h':
+ return self.make_propset_h()
+ elif filename == 'propget.h':
+ return self.make_propget_h()
+ else:
+ raise ValueError()
+
+css_groups = [ CSSGroup(g) for g in groups ]
+dir_path = os.path.dirname(os.path.realpath(__file__))
+
+for k, v in assets.items():
+ # Key is filename string (e.g. "computed.h") without autogenerated_ prefix
+ body = '\n'.join([ g.make_text(k) for g in css_groups ])
+ text = '\n'.join([ v['header'], body, v['footer'] ])
+ with open(os.path.join(dir_path, 'autogenerated_') + k, 'w') as file_k:
+ file_k.write(text)
diff --git a/test/data/parse2/INDEX b/test/data/parse2/INDEX
index 1afb4da..e020747 100644
--- a/test/data/parse2/INDEX
+++ b/test/data/parse2/INDEX
@@ -20,3 +20,5 @@ outline.dat Outline property tests
overflow.dat Overflow property tests
padding.dat Padding property tests
multicol.dat Multi-column layout property tests
+flexbox.dat Flexbox properties and shorthands tests
+units.dat Length unit tests
diff --git a/test/data/parse2/flexbox.dat b/test/data/parse2/flexbox.dat
new file mode 100644
index 0000000..99ac2df
--- a/dev/null
+++ b/test/data/parse2/flexbox.dat
@@ -0,0 +1,1713 @@
+#data
+* { align-content: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { align-content: inherit; }
+#errors
+#expected
+| *
+| align-content: inherit
+#reset
+
+#data
+* { align-content: stretch; }
+#errors
+#expected
+| *
+| align-content: stretch
+#reset
+
+#data
+* { align-content: flex-start; }
+#errors
+#expected
+| *
+| align-content: flex-start
+#reset
+
+#data
+* { align-content: flex-end; }
+#errors
+#expected
+| *
+| align-content: flex-end
+#reset
+
+#data
+* { align-content: center; }
+#errors
+#expected
+| *
+| align-content: center
+#reset
+
+#data
+* { align-content: space-between; }
+#errors
+#expected
+| *
+| align-content: space-between
+#reset
+
+#data
+* { align-content: space-around; }
+#errors
+#expected
+| *
+| align-content: space-around
+#reset
+
+#data
+* { align-content: space-evenly; }
+#errors
+#expected
+| *
+| align-content: space-evenly
+#reset
+
+#data
+* { align-content: inherit !important; }
+#errors
+#expected
+| *
+| align-content: inherit !important
+#reset
+
+#data
+* { align-content: stretch !important; }
+#errors
+#expected
+| *
+| align-content: stretch !important
+#reset
+
+#data
+* { align-content: flex-start !important; }
+#errors
+#expected
+| *
+| align-content: flex-start !important
+#reset
+
+#data
+* { align-content: flex-end !important; }
+#errors
+#expected
+| *
+| align-content: flex-end !important
+#reset
+
+#data
+* { align-content: center !important; }
+#errors
+#expected
+| *
+| align-content: center !important
+#reset
+
+#data
+* { align-content: space-between !important; }
+#errors
+#expected
+| *
+| align-content: space-between !important
+#reset
+
+#data
+* { align-content: space-around !important; }
+#errors
+#expected
+| *
+| align-content: space-around !important
+#reset
+
+#data
+* { align-content: space-evenly !important; }
+#errors
+#expected
+| *
+| align-content: space-evenly !important
+#reset
+
+#data
+* { align-items: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { align-items: inherit; }
+#errors
+#expected
+| *
+| align-items: inherit
+#reset
+
+#data
+* { align-items: stretch; }
+#errors
+#expected
+| *
+| align-items: stretch
+#reset
+
+#data
+* { align-items: flex-start; }
+#errors
+#expected
+| *
+| align-items: flex-start
+#reset
+
+#data
+* { align-items: flex-end; }
+#errors
+#expected
+| *
+| align-items: flex-end
+#reset
+
+#data
+* { align-items: center; }
+#errors
+#expected
+| *
+| align-items: center
+#reset
+
+#data
+* { align-items: baseline; }
+#errors
+#expected
+| *
+| align-items: baseline
+#reset
+
+#data
+* { align-items: inherit !important; }
+#errors
+#expected
+| *
+| align-items: inherit !important
+#reset
+
+#data
+* { align-items: stretch !important; }
+#errors
+#expected
+| *
+| align-items: stretch !important
+#reset
+
+#data
+* { align-items: flex-start !important; }
+#errors
+#expected
+| *
+| align-items: flex-start !important
+#reset
+
+#data
+* { align-items: flex-end !important; }
+#errors
+#expected
+| *
+| align-items: flex-end !important
+#reset
+
+#data
+* { align-items: center !important; }
+#errors
+#expected
+| *
+| align-items: center !important
+#reset
+
+#data
+* { align-items: baseline !important; }
+#errors
+#expected
+| *
+| align-items: baseline !important
+#reset
+
+#data
+* { align-self: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { align-self: inherit; }
+#errors
+#expected
+| *
+| align-self: inherit
+#reset
+
+#data
+* { align-self: stretch; }
+#errors
+#expected
+| *
+| align-self: stretch
+#reset
+
+#data
+* { align-self: flex-start; }
+#errors
+#expected
+| *
+| align-self: flex-start
+#reset
+
+#data
+* { align-self: flex-end; }
+#errors
+#expected
+| *
+| align-self: flex-end
+#reset
+
+#data
+* { align-self: center; }
+#errors
+#expected
+| *
+| align-self: center
+#reset
+
+#data
+* { align-self: baseline; }
+#errors
+#expected
+| *
+| align-self: baseline
+#reset
+
+#data
+* { align-self: auto; }
+#errors
+#expected
+| *
+| align-self: auto
+#reset
+
+#data
+* { align-self: inherit !important; }
+#errors
+#expected
+| *
+| align-self: inherit !important
+#reset
+
+#data
+* { align-self: stretch !important; }
+#errors
+#expected
+| *
+| align-self: stretch !important
+#reset
+
+#data
+* { align-self: flex-start !important; }
+#errors
+#expected
+| *
+| align-self: flex-start !important
+#reset
+
+#data
+* { align-self: flex-end !important; }
+#errors
+#expected
+| *
+| align-self: flex-end !important
+#reset
+
+#data
+* { align-self: center !important; }
+#errors
+#expected
+| *
+| align-self: center !important
+#reset
+
+#data
+* { align-self: baseline !important; }
+#errors
+#expected
+| *
+| align-self: baseline !important
+#reset
+
+#data
+* { align-self: auto !important; }
+#errors
+#expected
+| *
+| align-self: auto !important
+#reset
+
+#data
+* { flex-basis: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-basis: inherit; }
+#errors
+#expected
+| *
+| flex-basis: inherit
+#reset
+
+#data
+* { flex-basis: auto; }
+#errors
+#expected
+| *
+| flex-basis: auto
+#reset
+
+#data
+* { flex-basis: content; }
+#errors
+#expected
+| *
+| flex-basis: content
+#reset
+
+#data
+* { flex-basis: 0; }
+#errors
+#expected
+| *
+| flex-basis: 0px
+#reset
+
+#data
+* { flex-basis: 10px; }
+#errors
+#expected
+| *
+| flex-basis: 10px
+#reset
+
+#data
+* { flex-basis: 10em; }
+#errors
+#expected
+| *
+| flex-basis: 10em
+#reset
+
+#data
+* { flex-basis: 10invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-basis: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-basis: inherit !important; }
+#errors
+#expected
+| *
+| flex-basis: inherit !important
+#reset
+
+#data
+* { flex-basis: auto !important; }
+#errors
+#expected
+| *
+| flex-basis: auto !important
+#reset
+
+#data
+* { flex-basis: content !important; }
+#errors
+#expected
+| *
+| flex-basis: content !important
+#reset
+
+#data
+* { flex-basis: 0 !important; }
+#errors
+#expected
+| *
+| flex-basis: 0px !important
+#reset
+
+#data
+* { flex-basis: 10px !important; }
+#errors
+#expected
+| *
+| flex-basis: 10px !important
+#reset
+
+#data
+* { flex-basis: 10em !important; }
+#errors
+#expected
+| *
+| flex-basis: 10em !important
+#reset
+
+#data
+* { flex-basis: 10invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-direction: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-direction: inherit; }
+#errors
+#expected
+| *
+| flex-direction: inherit
+#reset
+
+#data
+* { flex-direction: row; }
+#errors
+#expected
+| *
+| flex-direction: row
+#reset
+
+#data
+* { flex-direction: row-reverse; }
+#errors
+#expected
+| *
+| flex-direction: row-reverse
+#reset
+
+#data
+* { flex-direction: column; }
+#errors
+#expected
+| *
+| flex-direction: column
+#reset
+
+#data
+* { flex-direction: column-reverse; }
+#errors
+#expected
+| *
+| flex-direction: column-reverse
+#reset
+
+#data
+* { flex-direction: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-direction: inherit !important; }
+#errors
+#expected
+| *
+| flex-direction: inherit !important
+#reset
+
+#data
+* { flex-direction: row !important; }
+#errors
+#expected
+| *
+| flex-direction: row !important
+#reset
+
+#data
+* { flex-direction: row-reverse !important; }
+#errors
+#expected
+| *
+| flex-direction: row-reverse !important
+#reset
+
+#data
+* { flex-direction: column !important; }
+#errors
+#expected
+| *
+| flex-direction: column !important
+#reset
+
+#data
+* { flex-direction: column-reverse !important; }
+#errors
+#expected
+| *
+| flex-direction: column-reverse !important
+#reset
+
+#data
+* { flex-grow: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-grow: 10px; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-grow: -2; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-grow: inherit; }
+#errors
+#expected
+| *
+| flex-grow: inherit
+#reset
+
+#data
+* { flex-grow: 0; }
+#errors
+#expected
+| *
+| flex-grow: 0
+#reset
+
+#data
+* { flex-grow: 0.5; }
+#errors
+#expected
+| *
+| flex-grow: 0.500
+#reset
+
+#data
+* { flex-grow: 1; }
+#errors
+#expected
+| *
+| flex-grow: 1
+#reset
+
+#data
+* { flex-grow: 3.5; }
+#errors
+#expected
+| *
+| flex-grow: 3.500
+#reset
+
+#data
+* { flex-grow: 20; }
+#errors
+#expected
+| *
+| flex-grow: 20
+#reset
+
+#data
+* { flex-grow: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-grow: 10px !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-grow: -2 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-grow: inherit !important; }
+#errors
+#expected
+| *
+| flex-grow: inherit !important
+#reset
+
+#data
+* { flex-grow: 0 !important; }
+#errors
+#expected
+| *
+| flex-grow: 0 !important
+#reset
+
+#data
+* { flex-grow: 0.5 !important; }
+#errors
+#expected
+| *
+| flex-grow: 0.500 !important
+#reset
+
+#data
+* { flex-grow: 1 !important; }
+#errors
+#expected
+| *
+| flex-grow: 1 !important
+#reset
+
+#data
+* { flex-grow: 3.5 !important; }
+#errors
+#expected
+| *
+| flex-grow: 3.500 !important
+#reset
+
+#data
+* { flex-grow: 20 !important; }
+#errors
+#expected
+| *
+| flex-grow: 20 !important
+#reset
+
+#data
+* { flex-shrink: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-shrink: 10px; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-shrink: -2; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-shrink: inherit; }
+#errors
+#expected
+| *
+| flex-shrink: inherit
+#reset
+
+#data
+* { flex-shrink: 0; }
+#errors
+#expected
+| *
+| flex-shrink: 0
+#reset
+
+#data
+* { flex-shrink: 0.5; }
+#errors
+#expected
+| *
+| flex-shrink: 0.500
+#reset
+
+#data
+* { flex-shrink: 1; }
+#errors
+#expected
+| *
+| flex-shrink: 1
+#reset
+
+#data
+* { flex-shrink: 3.5; }
+#errors
+#expected
+| *
+| flex-shrink: 3.500
+#reset
+
+#data
+* { flex-shrink: 20; }
+#errors
+#expected
+| *
+| flex-shrink: 20
+#reset
+
+#data
+* { flex-shrink: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-shrink: 10px !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-shrink: -2 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-shrink: inherit !important; }
+#errors
+#expected
+| *
+| flex-shrink: inherit !important
+#reset
+
+#data
+* { flex-shrink: 0 !important; }
+#errors
+#expected
+| *
+| flex-shrink: 0 !important
+#reset
+
+#data
+* { flex-shrink: 0.5 !important; }
+#errors
+#expected
+| *
+| flex-shrink: 0.500 !important
+#reset
+
+#data
+* { flex-shrink: 1 !important; }
+#errors
+#expected
+| *
+| flex-shrink: 1 !important
+#reset
+
+#data
+* { flex-shrink: 3.5 !important; }
+#errors
+#expected
+| *
+| flex-shrink: 3.500 !important
+#reset
+
+#data
+* { flex-shrink: 20 !important; }
+#errors
+#expected
+| *
+| flex-shrink: 20 !important
+#reset
+
+#data
+* { flex-wrap: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-wrap: inherit; }
+#errors
+#expected
+| *
+| flex-wrap: inherit
+#reset
+
+#data
+* { flex-wrap: nowrap; }
+#errors
+#expected
+| *
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-wrap: wrap; }
+#errors
+#expected
+| *
+| flex-wrap: wrap
+#reset
+
+#data
+* { flex-wrap: wrap-reverse; }
+#errors
+#expected
+| *
+| flex-wrap: wrap-reverse
+#reset
+
+#data
+* { flex-wrap: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-wrap: inherit !important; }
+#errors
+#expected
+| *
+| flex-wrap: inherit !important
+#reset
+
+#data
+* { flex-wrap: nowrap !important; }
+#errors
+#expected
+| *
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-wrap: wrap !important; }
+#errors
+#expected
+| *
+| flex-wrap: wrap !important
+#reset
+
+#data
+* { flex-wrap: wrap-reverse !important; }
+#errors
+#expected
+| *
+| flex-wrap: wrap-reverse !important
+#reset
+
+#data
+* { justify-content: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { justify-content: inherit; }
+#errors
+#expected
+| *
+| justify-content: inherit
+#reset
+
+#data
+* { justify-content: stretch; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { justify-content: flex-start; }
+#errors
+#expected
+| *
+| justify-content: flex-start
+#reset
+
+#data
+* { justify-content: flex-end; }
+#errors
+#expected
+| *
+| justify-content: flex-end
+#reset
+
+#data
+* { justify-content: center; }
+#errors
+#expected
+| *
+| justify-content: center
+#reset
+
+#data
+* { justify-content: space-between; }
+#errors
+#expected
+| *
+| justify-content: space-between
+#reset
+
+#data
+* { justify-content: space-around; }
+#errors
+#expected
+| *
+| justify-content: space-around
+#reset
+
+#data
+* { justify-content: space-evenly; }
+#errors
+#expected
+| *
+| justify-content: space-evenly
+#reset
+
+#data
+* { justify-content: inherit !important; }
+#errors
+#expected
+| *
+| justify-content: inherit !important
+#reset
+
+#data
+* { justify-content: stretch !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { justify-content: flex-start !important; }
+#errors
+#expected
+| *
+| justify-content: flex-start !important
+#reset
+
+#data
+* { justify-content: flex-end !important; }
+#errors
+#expected
+| *
+| justify-content: flex-end !important
+#reset
+
+#data
+* { justify-content: center !important; }
+#errors
+#expected
+| *
+| justify-content: center !important
+#reset
+
+#data
+* { justify-content: space-between !important; }
+#errors
+#expected
+| *
+| justify-content: space-between !important
+#reset
+
+#data
+* { justify-content: space-around !important; }
+#errors
+#expected
+| *
+| justify-content: space-around !important
+#reset
+
+#data
+* { justify-content: space-evenly !important; }
+#errors
+#expected
+| *
+| justify-content: space-evenly !important
+#reset
+
+#data
+* { order: invalid; }
+#errors
+#expected
+| *
+#reset
+#
+#data
+* { order: 0.5; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { order: 10px; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { order: inherit; }
+#errors
+#expected
+| *
+| order: inherit
+#reset
+
+#data
+* { order: 0; }
+#errors
+#expected
+| *
+| order: 0
+#reset
+
+#data
+* { order: -2; }
+#errors
+#expected
+| *
+| order: -2
+#reset
+
+#data
+* { order: 1; }
+#errors
+#expected
+| *
+| order: 1
+#reset
+
+#data
+* { order: 10000; }
+#errors
+#expected
+| *
+| order: 10000
+#reset
+
+#data
+* { order: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { order: 0.5 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { order: 10px !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { order: inherit !important; }
+#errors
+#expected
+| *
+| order: inherit !important
+#reset
+
+#data
+* { order: 0 !important; }
+#errors
+#expected
+| *
+| order: 0 !important
+#reset
+
+#data
+* { order: -2 !important; }
+#errors
+#expected
+| *
+| order: -2 !important
+#reset
+
+#data
+* { order: 1 !important; }
+#errors
+#expected
+| *
+| order: 1 !important
+#reset
+
+#data
+* { order: 10000 !important; }
+#errors
+#expected
+| *
+| order: 10000 !important
+#reset
+
+#data
+* { flex: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex: -1; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex: 2 2 2px 2; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex: inherit; }
+#errors
+#expected
+| *
+| flex-grow: inherit
+| flex-shrink: inherit
+| flex-basis: inherit
+#reset
+
+#data
+* { flex: 0; }
+#errors
+#expected
+| *
+| flex-grow: 0
+| flex-shrink: 1
+| flex-basis: 0px
+#reset
+
+#data
+* { flex: 2; }
+#errors
+#expected
+| *
+| flex-grow: 2
+| flex-shrink: 1
+| flex-basis: 0px
+#reset
+
+#data
+* { flex: 3em; }
+#errors
+#expected
+| *
+| flex-grow: 0
+| flex-shrink: 1
+| flex-basis: 3em
+#reset
+
+#data
+* { flex: 3 4; }
+#errors
+#expected
+| *
+| flex-grow: 3
+| flex-shrink: 4
+| flex-basis: 0px
+#reset
+
+#data
+* { flex: 2.5 3.75; }
+#errors
+#expected
+| *
+| flex-grow: 2.500
+| flex-shrink: 3.750
+| flex-basis: 0px
+#reset
+
+#data
+* { flex: 10 20 30px; }
+#errors
+#expected
+| *
+| flex-grow: 10
+| flex-shrink: 20
+| flex-basis: 30px
+#reset
+
+#data
+* { flex: none; }
+#errors
+#expected
+| *
+| flex-grow: 0
+| flex-shrink: 0
+| flex-basis: auto
+#reset
+
+#data
+* { flex: auto; }
+#errors
+#expected
+| *
+| flex-grow: 1
+| flex-shrink: 1
+| flex-basis: auto
+#reset
+
+#data
+* { flex: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex: -1 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex: 2 2 2px 2 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex: inherit !important; }
+#errors
+#expected
+| *
+| flex-grow: inherit !important
+| flex-shrink: inherit !important
+| flex-basis: inherit !important
+#reset
+
+#data
+* { flex: 0 !important; }
+#errors
+#expected
+| *
+| flex-grow: 0 !important
+| flex-shrink: 1 !important
+| flex-basis: 0px !important
+#reset
+
+#data
+* { flex: 2 !important; }
+#errors
+#expected
+| *
+| flex-grow: 2 !important
+| flex-shrink: 1 !important
+| flex-basis: 0px !important
+#reset
+
+#data
+* { flex: 3em !important; }
+#errors
+#expected
+| *
+| flex-grow: 0 !important
+| flex-shrink: 1 !important
+| flex-basis: 3em !important
+#reset
+
+#data
+* { flex: 3 4 !important; }
+#errors
+#expected
+| *
+| flex-grow: 3 !important
+| flex-shrink: 4 !important
+| flex-basis: 0px !important
+#reset
+
+#data
+* { flex: 2.5 3.75 !important; }
+#errors
+#expected
+| *
+| flex-grow: 2.500 !important
+| flex-shrink: 3.750 !important
+| flex-basis: 0px !important
+#reset
+
+#data
+* { flex: 10 20 30px !important; }
+#errors
+#expected
+| *
+| flex-grow: 10 !important
+| flex-shrink: 20 !important
+| flex-basis: 30px !important
+#reset
+
+#data
+* { flex: none !important; }
+#errors
+#expected
+| *
+| flex-grow: 0 !important
+| flex-shrink: 0 !important
+| flex-basis: auto !important
+#reset
+
+#data
+* { flex: auto !important; }
+#errors
+#expected
+| *
+| flex-grow: 1 !important
+| flex-shrink: 1 !important
+| flex-basis: auto !important
+#reset
+
+#data
+* { flex-flow: invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-flow: 1; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-flow: wrap 0; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-flow: inherit; }
+#errors
+#expected
+| *
+| flex-direction: inherit
+| flex-wrap: inherit
+#reset
+
+#data
+* { flex-flow: row; }
+#errors
+#expected
+| *
+| flex-direction: row
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: column; }
+#errors
+#expected
+| *
+| flex-direction: column
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: row-reverse; }
+#errors
+#expected
+| *
+| flex-direction: row-reverse
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: column-reverse; }
+#errors
+#expected
+| *
+| flex-direction: column-reverse
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: nowrap; }
+#errors
+#expected
+| *
+| flex-direction: row
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: wrap; }
+#errors
+#expected
+| *
+| flex-direction: row
+| flex-wrap: wrap
+#reset
+
+#data
+* { flex-flow: wrap-reverse; }
+#errors
+#expected
+| *
+| flex-direction: row
+| flex-wrap: wrap-reverse
+#reset
+
+#data
+* { flex-flow: column wrap; }
+#errors
+#expected
+| *
+| flex-direction: column
+| flex-wrap: wrap
+#reset
+
+#data
+* { flex-flow: row-reverse wrap-reverse; }
+#errors
+#expected
+| *
+| flex-direction: row-reverse
+| flex-wrap: wrap-reverse
+#reset
+
+#data
+* { flex-flow: row nowrap; }
+#errors
+#expected
+| *
+| flex-direction: row
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: column nowrap; }
+#errors
+#expected
+| *
+| flex-direction: column
+| flex-wrap: nowrap
+#reset
+
+#data
+* { flex-flow: invalid !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-flow: 1 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-flow: wrap 0 !important; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { flex-flow: inherit !important; }
+#errors
+#expected
+| *
+| flex-direction: inherit !important
+| flex-wrap: inherit !important
+#reset
+
+#data
+* { flex-flow: row !important; }
+#errors
+#expected
+| *
+| flex-direction: row !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-flow: column !important; }
+#errors
+#expected
+| *
+| flex-direction: column !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-flow: row-reverse !important; }
+#errors
+#expected
+| *
+| flex-direction: row-reverse !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-flow: column-reverse !important; }
+#errors
+#expected
+| *
+| flex-direction: column-reverse !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-flow: nowrap !important; }
+#errors
+#expected
+| *
+| flex-direction: row !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-flow: wrap !important; }
+#errors
+#expected
+| *
+| flex-direction: row !important
+| flex-wrap: wrap !important
+#reset
+
+#data
+* { flex-flow: wrap-reverse !important; }
+#errors
+#expected
+| *
+| flex-direction: row !important
+| flex-wrap: wrap-reverse !important
+#reset
+
+#data
+* { flex-flow: column wrap !important; }
+#errors
+#expected
+| *
+| flex-direction: column !important
+| flex-wrap: wrap !important
+#reset
+
+#data
+* { flex-flow: row-reverse wrap-reverse !important; }
+#errors
+#expected
+| *
+| flex-direction: row-reverse !important
+| flex-wrap: wrap-reverse !important
+#reset
+
+#data
+* { flex-flow: row nowrap !important; }
+#errors
+#expected
+| *
+| flex-direction: row !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { flex-flow: column nowrap !important; }
+#errors
+#expected
+| *
+| flex-direction: column !important
+| flex-wrap: nowrap !important
+#reset
+
+#data
+* { display: flex; }
+#errors
+#expected
+| *
+| display: flex
+#reset
+
+#data
+* { display: inline-flex; }
+#errors
+#expected
+| *
+| display: inline-flex
+#reset
+
+#data
+* { display: flex !important; }
+#errors
+#expected
+| *
+| display: flex !important
+#reset
+
+#data
+* { display: inline-flex !important; }
+#errors
+#expected
+| *
+| display: inline-flex !important
+#reset
+
+#data
+* { min-width: auto; min-height: auto; }
+#errors
+#expected
+| *
+| min-width: auto
+| min-height: auto
+#reset
+
+#data
+* { min-width: auto !important; min-height: auto !important; }
+#errors
+#expected
+| *
+| min-width: auto !important
+| min-height: auto !important
+#reset
diff --git a/test/data/parse2/tests1.dat b/test/data/parse2/tests1.dat
index 30afea8..ec826b2 100644
--- a/test/data/parse2/tests1.dat
+++ b/test/data/parse2/tests1.dat
@@ -94,6 +94,14 @@
#reset
#data
+* { line-height: 3.5; }
+#errors
+#expected
+| *
+| line-height: 3.500
+#reset
+
+#data
* { max-height: inherit; }
#errors
#expected
diff --git a/test/data/parse2/units.dat b/test/data/parse2/units.dat
new file mode 100644
index 0000000..1052dc5
--- a/dev/null
+++ b/test/data/parse2/units.dat
@@ -0,0 +1,182 @@
+#data
+* { width: 10invalid; }
+#errors
+#expected
+| *
+#reset
+
+#data
+* { width: inherit; }
+#errors
+#expected
+| *
+| width: inherit
+#reset
+
+#data
+* { width: 10ex; }
+#errors
+#expected
+| *
+| width: 10ex
+#reset
+
+#data
+* { width: 10em; }
+#errors
+#expected
+| *
+| width: 10em
+#reset
+
+#data
+* { width: 10in; }
+#errors
+#expected
+| *
+| width: 10in
+#reset
+
+#data
+* { width: 10cm; }
+#errors
+#expected
+| *
+| width: 10cm
+#reset
+
+#data
+* { width: 10mm; }
+#errors
+#expected
+| *
+| width: 10mm
+#reset
+
+#data
+* { width: 10pt; }
+#errors
+#expected
+| *
+| width: 10pt
+#reset
+
+#data
+* { width: 10pc; }
+#errors
+#expected
+| *
+| width: 10pc
+#reset
+
+#data
+* { width: 10cap; }
+#errors
+#expected
+| *
+| width: 10cap
+#reset
+
+#data
+* { width: 10ch; }
+#errors
+#expected
+| *
+| width: 10ch
+#reset
+
+#data
+* { width: 10ic; }
+#errors
+#expected
+| *
+| width: 10ic
+#reset
+
+#data
+* { width: 10rem; }
+#errors
+#expected
+| *
+| width: 10rem
+#reset
+
+#data
+* { width: 10lh; }
+#errors
+#expected
+| *
+| width: 10lh
+#reset
+
+#data
+* { width: 10rlh; }
+#errors
+#expected
+| *
+| width: 10rlh
+#reset
+
+#data
+* { width: 10vh; }
+#errors
+#expected
+| *
+| width: 10vh
+#reset
+
+#data
+* { width: 10vw; }
+#errors
+#expected
+| *
+| width: 10vw
+#reset
+
+#data
+* { width: 10vi; }
+#errors
+#expected
+| *
+| width: 10vi
+#reset
+
+#data
+* { width: 10vb; }
+#errors
+#expected
+| *
+| width: 10vb
+#reset
+
+#data
+* { width: 10vmin; }
+#errors
+#expected
+| *
+| width: 10vmin
+#reset
+
+#data
+* { width: 10vmax; }
+#errors
+#expected
+| *
+| width: 10vmax
+#reset
+
+#data
+* { width: 10q; }
+#errors
+#expected
+| *
+| width: 10q
+#reset
+
+#data
+* { width: 10%; }
+#errors
+#expected
+| *
+| width: 10%
+#reset
diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat
index ff8bbe1..0b84eb4 100644
--- a/test/data/select/tests1.dat
+++ b/test/data/select/tests1.dat
@@ -6,6 +6,9 @@ div { display: block; }
div { display: inline; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -49,6 +52,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -56,6 +64,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -71,6 +80,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -110,6 +120,9 @@ p { display: block; }
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -153,6 +166,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -160,6 +178,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -175,6 +194,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -218,6 +238,9 @@ div#foo { background-color: #bbc; }
div#foo { float: right; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -261,6 +284,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -268,6 +296,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -283,6 +312,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -327,6 +357,9 @@ div#foo { background-color: #bbc; }
div p.green { float: left !important; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -370,6 +403,11 @@ cursor: auto
direction: ltr
display: table-cell
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -377,6 +415,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -392,6 +431,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -436,6 +476,9 @@ div.moose > div { border-top-style: none; }
div.moose > div + div { border-top-style: solid; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -479,6 +522,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -486,6 +534,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -501,6 +550,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -545,6 +595,9 @@ div.moose > div { border-top-style: none; }
div.moose > div + div { border-top-style: solid; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -588,6 +641,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -595,6 +653,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -610,6 +669,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -644,6 +704,9 @@ z-index: auto
div { color: currentColor; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -687,6 +750,11 @@ cursor: auto
direction: ltr
display: inline
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -694,6 +762,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -709,6 +778,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -744,6 +814,9 @@ div { background-color: #000; }
div:active { background-color: #bbc; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #ff000000
background-image: none
@@ -787,6 +860,11 @@ cursor: auto
direction: ltr
display: inline
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -794,6 +872,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -809,6 +888,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -844,6 +924,9 @@ z-index: auto
p:first-child { background-color: #bbc; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #ffbbbbcc
background-image: none
@@ -887,6 +970,11 @@ cursor: auto
direction: ltr
display: inline
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -894,6 +982,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -909,6 +998,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -943,6 +1033,9 @@ z-index: auto
div { quotes: "a" "b" }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -986,6 +1079,11 @@ cursor: auto
direction: ltr
display: inline
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -993,6 +1091,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1008,6 +1107,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1047,6 +1147,9 @@ div, p { display: block; }
div p + p { background-attachment: fixed; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: fixed
background-color: #00000000
background-image: none
@@ -1090,6 +1193,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1097,6 +1205,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1112,6 +1221,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1151,6 +1261,9 @@ div, p { display: block; }
div p + p { background-attachment: fixed; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -1194,6 +1307,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1201,6 +1319,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1216,6 +1335,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1256,6 +1376,9 @@ div p { background-attachment: scroll; }
div p + p { background-attachment: fixed; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -1299,6 +1422,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1306,6 +1434,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1321,6 +1450,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1364,6 +1494,9 @@ div p + p { background-image: url("Sonic2.png"); background-position: center; }
div p + p { background-image: url("Sonic_the_Hedgehog.png"); background-position: bottom right; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: url('Sonic_the_Hedgehog.png')
@@ -1407,6 +1540,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1414,6 +1552,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1429,6 +1568,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1471,6 +1611,9 @@ div p + p { background-image: url("Sonic2.png"); }
div p + p { background-image: url("Sonic_the_Hedgehog.png"); background-repeat: repeat}
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: url('Sonic_the_Hedgehog.png')
@@ -1514,6 +1657,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1521,6 +1669,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1536,6 +1685,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1584,6 +1734,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -1627,6 +1780,11 @@ cursor: auto
direction: ltr
display: table-row
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1634,6 +1792,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1649,6 +1808,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1697,6 +1857,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -1740,6 +1903,11 @@ cursor: auto
direction: ltr
display: table-cell
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1747,6 +1915,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1762,6 +1931,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1810,6 +1980,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -1853,6 +2026,11 @@ cursor: auto
direction: ltr
display: table-cell
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1860,6 +2038,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1875,6 +2054,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -1927,6 +2107,9 @@ td,th {border-top-style: none;border-right-style: hidden;border-bottom-style: do
tr > td {border-top-width: thin;border-right-width: medium;border-bottom-width: thick;border-left-width: 2px;}
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -1970,6 +2153,11 @@ cursor: auto
direction: ltr
display: table-cell
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -1977,6 +2165,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -1992,6 +2181,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2043,6 +2233,9 @@ td,th {border-top-style: solid;border-right-style: double;border-bottom-style: g
tr > td {border-top-width: 0;border-right-width: 2em;border-bottom-width: thick;border-left-width: -2px;}
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2086,6 +2279,11 @@ cursor: auto
direction: ltr
display: table-cell
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2093,6 +2291,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2108,6 +2307,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2157,6 +2357,9 @@ td,th {display:table-cell;}
.hedgehog > tr > td {border-style:inset outset;}
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2200,6 +2403,11 @@ cursor: auto
direction: ltr
display: table-cell
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2207,6 +2415,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2222,6 +2431,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2270,6 +2480,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2313,6 +2526,11 @@ cursor: auto
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2320,6 +2538,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2335,6 +2554,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2383,6 +2603,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2426,6 +2649,11 @@ cursor: auto
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2433,6 +2661,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2448,6 +2677,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2496,6 +2726,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #ff1122ee
background-image: url('sonic-the-hedgehog.png')
@@ -2539,6 +2772,11 @@ cursor: auto
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2546,6 +2784,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2561,6 +2800,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2609,6 +2849,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2652,6 +2895,11 @@ cursor: crosshair
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2659,6 +2907,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2674,6 +2923,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2722,6 +2972,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2765,6 +3018,11 @@ cursor: default
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2772,6 +3030,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2787,6 +3046,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2835,6 +3095,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2878,6 +3141,11 @@ cursor: pointer
direction: ltr
display: table
empty-cells: hide
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2885,6 +3153,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -2900,6 +3169,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -2948,6 +3218,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -2991,6 +3264,11 @@ cursor: move
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -2998,6 +3276,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3013,6 +3292,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3061,6 +3341,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3104,6 +3387,11 @@ cursor: e-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -3111,6 +3399,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3126,6 +3415,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3174,6 +3464,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3217,6 +3510,11 @@ cursor: ne-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -3224,6 +3522,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3239,6 +3538,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3287,6 +3587,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3330,13 +3633,19 @@ cursor: nw-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
-font-size: 14.391pt
+font-size: 10.600pt
font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3352,6 +3661,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3400,6 +3710,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3443,6 +3756,11 @@ cursor: n-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 14.391pt
@@ -3450,6 +3768,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3465,6 +3784,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3513,6 +3833,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3556,6 +3879,11 @@ cursor: se-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 24pt
@@ -3563,6 +3891,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3578,6 +3907,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3626,6 +3956,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3669,6 +4002,11 @@ cursor: sw-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 18pt
@@ -3676,6 +4014,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3691,6 +4030,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3739,6 +4079,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3782,6 +4125,11 @@ cursor: s-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 13.500pt
@@ -3789,6 +4137,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3804,6 +4153,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3852,6 +4202,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -3895,6 +4248,11 @@ cursor: w-resize
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -3902,6 +4260,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -3917,6 +4276,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -3965,6 +4325,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4008,6 +4371,11 @@ cursor: text
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 9.750pt
@@ -4015,6 +4383,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4030,6 +4399,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4078,6 +4448,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4121,6 +4494,11 @@ cursor: wait
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 7.500pt
@@ -4128,6 +4506,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4143,6 +4522,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4191,6 +4571,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4234,6 +4617,11 @@ cursor: help
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 6.750pt
@@ -4241,6 +4629,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4256,6 +4645,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4304,6 +4694,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4347,6 +4740,11 @@ cursor: progress
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 40px
@@ -4354,6 +4752,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4369,6 +4768,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 0.500
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4417,6 +4817,9 @@ td,th {display:table-cell;}
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4460,6 +4863,11 @@ cursor: url('sonic-team.png') pointer
direction: ltr
display: table
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -4467,6 +4875,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4482,6 +4891,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4523,6 +4933,9 @@ div#foo { background-color: #bbc; letter-spacing: 200%; }
div#foo p { letter-spacing: 300%; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4566,6 +4979,11 @@ cursor: auto
direction: ltr
display: none
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -4573,6 +4991,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4588,6 +5007,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4629,6 +5049,9 @@ div#foo { background-color: #bbc; letter-spacing: 20mm; }
div#foo p { letter-spacing: 300px; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4672,6 +5095,11 @@ cursor: auto
direction: ltr
display: none
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -4679,6 +5107,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: 300px
line-height: normal
@@ -4694,6 +5123,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4735,6 +5165,9 @@ div#foo p { letter-spacing: inherit; }
div p { letter-spacing: horizontal-tb; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4778,6 +5211,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -4785,6 +5223,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4800,6 +5239,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4838,6 +5278,9 @@ p{display: block;}
p{column-count: 2; column-rule-color: #bbc; column-rule-style: solid; column-rule-width: 2px; column-span: all; column-width: 6em;}
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4881,6 +5324,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -4888,6 +5336,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -4903,6 +5352,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -4942,6 +5392,9 @@ p { display: block; break-after: avoid; break-before: column; }
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -4985,6 +5438,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -4992,6 +5450,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -5007,6 +5466,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -5046,6 +5506,9 @@ p { display: block; break-after: avoid-page; break-before: always; }
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -5089,6 +5552,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -5096,6 +5564,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -5111,6 +5580,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -5150,6 +5620,9 @@ p { display: block; break-after: avoid-page; break-before: always; break-inside:
#author
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -5193,6 +5666,11 @@ cursor: auto
direction: ltr
display: block
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -5200,6 +5678,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -5215,6 +5694,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -5250,6 +5730,9 @@ div { box-sizing: inherit; }
#user
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -5293,6 +5776,11 @@ cursor: auto
direction: ltr
display: inline
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -5300,6 +5788,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -5315,6 +5804,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -5351,6 +5841,9 @@ div { box-sizing: inherit; }
div { box-sizing: border-box; }
#errors
#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
background-attachment: scroll
background-color: #00000000
background-image: none
@@ -5394,6 +5887,2432 @@ cursor: auto
direction: ltr
display: inline
empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: space-between; align-items: stretch; align-self: flex-start; }
+#user
+#errors
+#expected
+align-content: space-between
+align-items: stretch
+align-self: flex-start
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: stretch; align-items: flex-start; align-self: flex-end; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: flex-start
+align-self: flex-end
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: flex-start; align-items: flex-end; align-self: center; }
+#user
+#errors
+#expected
+align-content: flex-start
+align-items: flex-end
+align-self: center
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: flex-end; align-items: center; align-self: baseline; }
+#user
+#errors
+#expected
+align-content: flex-end
+align-items: center
+align-self: baseline
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: center; align-items: baseline; align-self: auto; }
+#user
+#errors
+#expected
+align-content: center
+align-items: baseline
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div
+| p*
+#ua
+div { align-content: center; align-items: center; align-self: center; }
+p { align-content: inherit; align-items: inherit; align-self: inherit; }
+#user
+#errors
+#expected
+align-content: center
+align-items: center
+align-self: center
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: space-around; align-items: stretch; align-self: stretch; }
+#user
+#errors
+#expected
+align-content: space-around
+align-items: stretch
+align-self: stretch
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: space-evenly; align-items: flex-start; align-self: stretch; }
+#user
+#errors
+#expected
+align-content: space-evenly
+align-items: flex-start
+align-self: stretch
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { align-content: center; align-items: center; align-self: center; }
+#user
+div { align-content: flex-end; align-items: flex-end; align-self: flex-end; }
+#errors
+#expected
+align-content: flex-end
+align-items: flex-end
+align-self: flex-end
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+#
+#tree
+| div*
+#ua
+div { flex: 2 3 10px; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 10px
+flex-direction: row
+flex-grow: 2.000
+flex-shrink: 3.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: auto; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 1.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: none; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 0.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 0; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 0 0; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 0 0 0; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 0.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 3; }
+#user
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 3.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 3px; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 3px
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 2 3em; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 3em
+flex-direction: row
+flex-grow: 2.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 20 30; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 20.000
+flex-shrink: 30.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 2 2 2px; }
+#user
+div { flex: 3 3; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 3.000
+flex-shrink: 3.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 2 2 2px; }
+#user
+div { flex-grow: 3; flex-shrink: 3; flex-basis: 3px; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 3px
+flex-direction: row
+flex-grow: 3.000
+flex-shrink: 3.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex: 0 0 0; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 0px
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 0.000
+flex-wrap: nowrap
float: none
font-family: sans-serif
font-size: 12pt
@@ -5401,6 +8320,7 @@ font-style: normal
font-variant: normal
font-weight: normal
height: auto
+justify-content: flex-start
left: auto
letter-spacing: normal
line-height: normal
@@ -5416,6 +8336,7 @@ max-width: none
min-height: 0px
min-width: 0px
opacity: 1.000
+order: 0
outline-color: invert
outline-style: none
outline-width: 2px
@@ -5443,3 +8364,5580 @@ word-spacing: normal
writing-mode: horizontal-tb
z-index: auto
#reset
+
+#tree
+| div*
+#ua
+div { flex-grow: 2; flex-basis: 20rem; }
+#user
+div { flex: none; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 0.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+| p
+#ua
+div { flex: 3 3 3%; }
+p { flex: inherit; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 3%
+flex-direction: row
+flex-grow: 3.000
+flex-shrink: 3.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div
+| p*
+#ua
+div { flex: 3 3 3%; }
+p { flex: inherit; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: 3%
+flex-direction: row
+flex-grow: 3.000
+flex-shrink: 3.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: nowrap; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: wrap; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: wrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: wrap-reverse; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: wrap-reverse
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: row; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: column; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: column
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: row-reverse; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: row-reverse
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: column-reverse; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: column-reverse
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: nowrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div*
+#ua
+div { flex-flow: column-reverse wrap-reverse; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: column-reverse
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: wrap-reverse
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div
+| p*
+#ua
+div { flex-flow: column wrap; }
+p {flex-flow: inherit; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
+column-span: none
+column-width: auto
+content: normal
+counter-increment: none
+counter-reset: none
+cursor: auto
+direction: ltr
+display: inline
+empty-cells: show
+flex-basis: auto
+flex-direction: column
+flex-grow: 0.000
+flex-shrink: 1.000
+flex-wrap: wrap
+float: none
+font-family: sans-serif
+font-size: 12pt
+font-style: normal
+font-variant: normal
+font-weight: normal
+height: auto
+justify-content: flex-start
+left: auto
+letter-spacing: normal
+line-height: normal
+list-style-image: none
+list-style-position: outside
+list-style-type: disc
+margin-top: 0px
+margin-right: 0px
+margin-bottom: 0px
+margin-left: 0px
+max-height: none
+max-width: none
+min-height: 0px
+min-width: 0px
+opacity: 1.000
+order: 0
+outline-color: invert
+outline-style: none
+outline-width: 2px
+overflow-x: visible
+overflow-y: visible
+padding-top: 0px
+padding-right: 0px
+padding-bottom: 0px
+padding-left: 0px
+position: static
+quotes: none
+right: auto
+table-layout: auto
+text-align: default
+text-decoration: none
+text-indent: 0px
+text-transform: none
+top: auto
+unicode-bidi: normal
+vertical-align: baseline
+visibility: visible
+white-space: normal
+width: auto
+word-spacing: normal
+writing-mode: horizontal-tb
+z-index: auto
+#reset
+
+#tree
+| div
+| p*
+#ua
+div { flex-flow: row-reverse wrap-reverse; }
+p { flex-direction: inherit; flex-wrap: inherit; }
+#errors
+#expected
+align-content: stretch
+align-items: stretch
+align-self: auto
+background-attachment: scroll
+background-color: #00000000
+background-image: none
+background-position: 0% 0%
+background-repeat: repeat
+border-collapse: separate
+border-spacing: 0px 0px
+border-top-color: #ff000000
+border-right-color: #ff000000
+border-bottom-color: #ff000000
+border-left-color: #ff000000
+border-top-style: none
+border-right-style: none
+border-bottom-style: none
+border-left-style: none
+border-top-width: 2px
+border-right-width: 2px
+border-bottom-width: 2px
+border-left-width: 2px
+bottom: auto
+box-sizing: content-box
+break-after: auto
+break-before: auto
+break-inside: auto
+caption-side: top
+clear: none
+clip: auto
+color: #ff000000
+column-count: auto
+column-fill: balance
+column-gap: normal
+column-rule-color: #ff000000
+column-rule-style: none
+column-rule-width: 2px
<