Commit 41e72abe authored by Anders Hartvoll Ruud's avatar Anders Hartvoll Ruud Committed by Commit Bot

[mpc] Make flexbox properties computed_value_comparable

Bug: 1057072
Change-Id: I1ce62770cc27561d577a1508a87d677fad9da043
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210350
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: default avatarXiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772051}
parent ceea7af1
......@@ -1043,6 +1043,7 @@
default_value: "StyleContentAlignmentData(ContentPosition::kNormal, ContentDistributionType::kDefault, OverflowAlignment::kDefault)",
type_name: "StyleContentAlignmentData",
converter: "ConvertContentAlignmentData",
computed_value_comparable: true,
},
{
name: "align-items",
......@@ -1053,6 +1054,7 @@
default_value: "StyleSelfAlignmentData(ItemPosition::kNormal, OverflowAlignment::kDefault)",
type_name: "StyleSelfAlignmentData",
converter: "ConvertSelfOrDefaultAlignmentData",
computed_value_comparable: true,
},
{
name: "alignment-baseline",
......@@ -1070,6 +1072,7 @@
default_value: "StyleSelfAlignmentData(ItemPosition::kAuto, OverflowAlignment::kDefault)",
type_name: "StyleSelfAlignmentData",
converter: "ConvertSelfOrDefaultAlignmentData",
computed_value_comparable: true,
},
{
name: "aspect-ratio",
......@@ -1997,7 +2000,8 @@
default_value: "Length::Auto()",
converter: "ConvertLengthOrAuto",
typedom_types: ["Keyword", "Length", "Percentage"],
keywords: ["auto"]
keywords: ["auto"],
computed_value_comparable: true,
},
{
name: "flex-direction",
......@@ -2007,6 +2011,7 @@
typedom_types: ["Keyword"],
keywords: ["row", "row-reverse", "column", "column-reverse"],
default_value: "row",
computed_value_comparable: true,
},
{
name: "flex-grow",
......@@ -2017,6 +2022,7 @@
default_value: "0.0f",
type_name: "float",
typedom_types: ["Number"],
computed_value_comparable: true,
},
{
name: "flex-shrink",
......@@ -2027,6 +2033,7 @@
default_value: "1.0f",
type_name: "float",
typedom_types: ["Number"],
computed_value_comparable: true,
},
{
name: "flex-wrap",
......@@ -2036,6 +2043,7 @@
typedom_types: ["Keyword"],
keywords: ["nowrap", "wrap", "wrap-reverse"],
default_value: "nowrap",
computed_value_comparable: true,
},
{
name: "float",
......@@ -2264,6 +2272,7 @@
default_value: "StyleContentAlignmentData(ContentPosition::kNormal, ContentDistributionType::kDefault, OverflowAlignment::kDefault)",
type_name: "StyleContentAlignmentData",
converter: "ConvertContentAlignmentData",
computed_value_comparable: true,
},
{
name: "justify-items",
......@@ -2274,6 +2283,7 @@
default_value: "StyleSelfAlignmentData(ItemPosition::kLegacy, OverflowAlignment::kDefault)",
type_name: "StyleSelfAlignmentData",
converter: "ConvertSelfOrDefaultAlignmentData",
computed_value_comparable: true,
},
{
name: "justify-self",
......@@ -2284,6 +2294,7 @@
default_value: "StyleSelfAlignmentData(ItemPosition::kAuto, OverflowAlignment::kDefault)",
type_name: "StyleSelfAlignmentData",
converter: "ConvertSelfOrDefaultAlignmentData",
computed_value_comparable: true,
},
{
name: "left",
......
......@@ -148,15 +148,24 @@ namespace {
// Examples must produce unique computed values. For example, it's not
// allowed to list both 2px and calc(1px + 1px).
const char* align_content_examples[] = {"normal", "first baseline", "stretch",
"safe end", nullptr};
const char* border_style_examples[] = {"none", "solid", "dashed", nullptr};
const char* color_examples[] = {"red", "green", "#fef", "#faf", nullptr};
const char* direction_examples[] = {"ltr", "rtl", nullptr};
const char* flex_direction_examples[] = {"row", "column", nullptr};
const char* flex_wrap_examples[] = {"nowrap", "wrap", nullptr};
const char* float_examples[] = {"1", "2.5", nullptr};
const char* justify_content_examples[] = {"normal", "stretch", "safe end",
"left", nullptr};
const char* length_or_auto_examples[] = {"auto", "1px", "2px", "5%", nullptr};
const char* length_or_none_examples[] = {"none", "1px", "2px", "5%", nullptr};
const char* length_size_examples[] = {"4px", "1px 2px", "3%", "calc(1% + 1px)",
nullptr};
const char* line_width_examples[] = {"medium", "thin", "100px", nullptr};
const char* none_auto_examples[] = {"none", "auto", nullptr};
const char* self_align_examples[] = {"flex-start", "flex-end", "first baseline",
"safe end", nullptr};
const char* text_decoration_line_examples[] = {"none", "underline", nullptr};
const char* text_decoration_style_examples[] = {"solid", "dashed", nullptr};
const char* vertical_align_examples[] = {"sub", "super", "1px", "3%", nullptr};
......@@ -167,6 +176,9 @@ struct ComputedValuesEqualData {
const char** examples;
} computed_values_equal_data[] = {
{"-webkit-writing-mode", writing_mode_examples},
{"align-content", align_content_examples},
{"align-items", self_align_examples},
{"align-self", self_align_examples},
{"border-bottom-color", color_examples},
{"border-bottom-left-radius", length_size_examples},
{"border-bottom-right-radius", length_size_examples},
......@@ -185,7 +197,15 @@ struct ComputedValuesEqualData {
{"border-top-width", line_width_examples},
{"bottom", length_or_auto_examples},
{"direction", direction_examples},
{"flex-basis", length_or_auto_examples},
{"flex-direction", flex_direction_examples},
{"flex-grow", float_examples},
{"flex-shrink", float_examples},
{"flex-wrap", flex_wrap_examples},
{"height", length_or_auto_examples},
{"justify-content", justify_content_examples},
{"justify-items", self_align_examples},
{"justify-self", self_align_examples},
{"left", length_or_auto_examples},
{"max-height", length_or_none_examples},
{"max-width", length_or_none_examples},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment