summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Neves <lcneves@gmail.com>2017-09-23 01:28:30 (GMT)
committer Lucas Neves <lcneves@gmail.com>2017-09-26 02:01:56 (GMT)
commit1ab324489a2bb1902c4a665d9aab0c1a4688458b (patch)
tree06a4cca7a9f7edd4ea74890c6b781c73d5a14546
parent5840b8a87cea6f24ab1e9d48de34a2469a6015a9 (diff)
downloadlibcss-1ab324489a2bb1902c4a665d9aab0c1a4688458b.tar.gz
libcss-1ab324489a2bb1902c4a665d9aab0c1a4688458b.tar.bz2
Tests: Add support for dumping the flexbox properties.
-rw-r--r--test/dump.h181
1 files changed, 181 insertions, 0 deletions
diff --git a/test/dump.h b/test/dump.h
index 0159b19..729b0a3 100644
--- a/test/dump.h
+++ b/test/dump.h
@@ -479,6 +479,16 @@ static const char *opcode_names[] = {
"writing-mode",
"overflow-y",
"box-sizing",
+ "align-content",
+ "align-items",
+ "align-self",
+ "flex-basis",
+ "flex-direction",
+ "flex-grow",
+ "flex-shrink",
+ "flex-wrap",
+ "justify-content",
+ "order",
};
static void dump_css_fixed(css_fixed f, char **ptr)
@@ -752,6 +762,72 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
value = getValue(opv);
switch (op) {
+ case CSS_PROP_ALIGN_CONTENT:
+ switch (value) {
+ case ALIGN_CONTENT_STRETCH:
+ *ptr += sprintf(*ptr, "stretch");
+ break;
+ case ALIGN_CONTENT_FLEX_START:
+ *ptr += sprintf(*ptr, "flex-start");
+ break;
+ case ALIGN_CONTENT_FLEX_END:
+ *ptr += sprintf(*ptr, "flex-end");
+ break;
+ case ALIGN_CONTENT_CENTER:
+ *ptr += sprintf(*ptr, "center");
+ break;
+ case ALIGN_CONTENT_SPACE_BETWEEN:
+ *ptr += sprintf(*ptr, "space-between");
+ break;
+ case ALIGN_CONTENT_SPACE_AROUND:
+ *ptr += sprintf(*ptr, "space-around");
+ break;
+ case ALIGN_CONTENT_SPACE_EVENLY:
+ *ptr += sprintf(*ptr, "space-evenly");
+ break;
+ }
+ break;
+ case CSS_PROP_ALIGN_ITEMS:
+ switch (value) {
+ case ALIGN_ITEMS_STRETCH:
+ *ptr += sprintf(*ptr, "stretch");
+ break;
+ case ALIGN_ITEMS_FLEX_START:
+ *ptr += sprintf(*ptr, "flex-start");
+ break;
+ case ALIGN_ITEMS_FLEX_END:
+ *ptr += sprintf(*ptr, "flex-end");
+ break;
+ case ALIGN_ITEMS_CENTER:
+ *ptr += sprintf(*ptr, "center");
+ break;
+ case ALIGN_ITEMS_BASELINE:
+ *ptr += sprintf(*ptr, "baseline");
+ break;
+ }
+ break;
+ case CSS_PROP_ALIGN_SELF:
+ switch (value) {
+ case ALIGN_SELF_STRETCH:
+ *ptr += sprintf(*ptr, "stretch");
+ break;
+ case ALIGN_SELF_FLEX_START:
+ *ptr += sprintf(*ptr, "flex-start");
+ break;
+ case ALIGN_SELF_FLEX_END:
+ *ptr += sprintf(*ptr, "flex-end");
+ break;
+ case ALIGN_SELF_CENTER:
+ *ptr += sprintf(*ptr, "center");
+ break;
+ case ALIGN_SELF_BASELINE:
+ *ptr += sprintf(*ptr, "baseline");
+ break;
+ case ALIGN_SELF_AUTO:
+ *ptr += sprintf(*ptr, "auto");
+ break;
+ }
+ break;
case CSS_PROP_AZIMUTH:
switch (value & ~AZIMUTH_BEHIND) {
case AZIMUTH_ANGLE:
@@ -1699,6 +1775,77 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
break;
}
break;
+ case CSS_PROP_FLEX_BASIS:
+ switch (value) {
+ case FLEX_BASIS_AUTO:
+ *ptr += sprintf(*ptr, "auto");
+ break;
+ case FLEX_BASIS_CONTENT:
+ *ptr += sprintf(*ptr, "content");
+ break;
+ case FLEX_BASIS_SET:
+ {
+ uint32_t unit;
+ css_fixed val = *((css_fixed *) bytecode);
+ ADVANCE(sizeof(val));
+ unit = *((uint32_t *) bytecode);
+ ADVANCE(sizeof(unit));
+ dump_unit(val, unit, ptr);
+ }
+ break;
+ }
+ break;
+ case CSS_PROP_FLEX_DIRECTION:
+ switch (value) {
+ case FLEX_DIRECTION_ROW:
+ *ptr += sprintf(*ptr, "row");
+ break;
+ case FLEX_DIRECTION_COLUMN:
+ *ptr += sprintf(*ptr, "column");
+ break;
+ case FLEX_DIRECTION_ROW_REVERSE:
+ *ptr += sprintf(*ptr, "row-reverse");
+ break;
+ case FLEX_DIRECTION_COLUMN_REVERSE:
+ *ptr += sprintf(*ptr, "column-reverse");
+ break;
+ }
+ break;
+ case CSS_PROP_FLEX_GROW:
+ switch (value) {
+ case FLEX_GROW_SET:
+ {
+ css_fixed val = *((css_fixed *) bytecode);
+ ADVANCE(sizeof(val));
+ dump_number(val, ptr);
+ }
+ break;
+ }
+ break;
+ case CSS_PROP_FLEX_SHRINK:
+ switch (value) {
+ case FLEX_SHRINK_SET:
+ {
+ css_fixed val = *((css_fixed *) bytecode);
+ ADVANCE(sizeof(val));
+ dump_number(val, ptr);
+ }
+ break;
+ }
+ break;
+ case CSS_PROP_FLEX_WRAP:
+ switch (value) {
+ case FLEX_WRAP_NOWRAP:
+ *ptr += sprintf(*ptr, "nowrap");
+ break;
+ case FLEX_WRAP_WRAP:
+ *ptr += sprintf(*ptr, "wrap");
+ break;
+ case FLEX_WRAP_WRAP_REVERSE:
+ *ptr += sprintf(*ptr, "wrap-reverse");
+ break;
+ }
+ break;
case CSS_PROP_FLOAT:
switch (value) {
case FLOAT_LEFT:
@@ -1858,6 +2005,29 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
break;
}
break;
+ case CSS_PROP_JUSTIFY_CONTENT:
+ switch (value) {
+ case JUSTIFY_CONTENT_FLEX_START:
+ *ptr += sprintf(*ptr, "flex-start");
+ break;
+ case JUSTIFY_CONTENT_FLEX_END:
+ *ptr += sprintf(*ptr, "flex-end");
+ break;
+ case JUSTIFY_CONTENT_CENTER:
+ *ptr += sprintf(*ptr, "center");
+ break;
+ case JUSTIFY_CONTENT_SPACE_BETWEEN:
+ *ptr += sprintf(*ptr, "space-between");
+ break;
+ case JUSTIFY_CONTENT_SPACE_AROUND:
+ *ptr += sprintf(*ptr, "space-around");
+ break;
+ case JUSTIFY_CONTENT_SPACE_EVENLY:
+ *ptr += sprintf(*ptr, "space-evenly");
+ break;
+ }
+ break;
+
case CSS_PROP_LETTER_SPACING:
case CSS_PROP_WORD_SPACING:
assert(LETTER_SPACING_SET ==
@@ -2002,6 +2172,17 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth)
break;
}
break;
+ case CSS_PROP_ORDER:
+ switch (value) {
+ case ORDER_SET:
+ {
+ css_fixed val = *((css_fixed *) bytecode);
+ ADVANCE(sizeof(val));
+ dump_number(val, ptr);
+ }
+ break;
+ }
+ break;
case CSS_PROP_PADDING_TOP:
case CSS_PROP_PADDING_RIGHT:
case CSS_PROP_PADDING_BOTTOM: