summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Neves <lcneves@gmail.com>2017-09-28 15:21:36 (GMT)
committer Lucas Neves <lcneves@gmail.com>2017-10-01 18:29:54 (GMT)
commitbccdcf3846822b530ac62ad3994d775d05d9a2fb (patch)
tree1004c3d2ba597aadb408466cd93c5f38d96e5dca
parent3e58dd9a29a10cd6400031f0b510084ffacc41d0 (diff)
downloadlibcss-bccdcf3846822b530ac62ad3994d775d05d9a2fb.tar.gz
libcss-bccdcf3846822b530ac62ad3994d775d05d9a2fb.tar.bz2
Add codes to flexbox properties.
-rw-r--r--docs/Bytecode107
-rw-r--r--include/libcss/properties.h96
-rw-r--r--src/bytecode/opcodes.h78
3 files changed, 269 insertions, 12 deletions
diff --git a/docs/Bytecode b/docs/Bytecode
index 852a918..e857193 100644
--- a/docs/Bytecode
+++ b/docs/Bytecode
@@ -464,6 +464,8 @@ Opcodes
d => table-cell,
e => table-caption,
f => none,
+ 10 => flex,
+ 11 => inline-flex,
other => Reserved for future expansion.
21 - elevation
@@ -678,8 +680,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 +690,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 +1259,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/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/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
-