Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
| index ae3f5d5196e7e557e76a443cab7ebb0c62449414..be528ccafe4b3eec5c309aad7105d53f62f765ed 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
| @@ -1516,6 +1516,12 @@ static LayoutUnit InitialJustifyContentOffset( |
| return available_free_space / 2; |
| } |
| + if (justify_content_distribution == kContentDistributionSpaceEvenly) { |
| + if (available_free_space > 0 && number_of_children) |
| + return available_free_space / (number_of_children + 1); |
| + // Fallback to 'center' |
|
Manuel Rego
2017/04/20 08:57:06
Supernit: End comment with dot.
|
| + return available_free_space / 2; |
| + } |
| return LayoutUnit(); |
| } |
| @@ -1528,6 +1534,8 @@ static LayoutUnit JustifyContentSpaceBetweenChildren( |
| return available_free_space / (number_of_children - 1); |
| if (justify_content_distribution == kContentDistributionSpaceAround) |
| return available_free_space / number_of_children; |
| + if (justify_content_distribution == kContentDistributionSpaceEvenly) |
| + return available_free_space / (number_of_children + 1); |
| } |
| return LayoutUnit(); |
| } |
| @@ -1965,6 +1973,12 @@ static LayoutUnit InitialAlignContentOffset( |
| if (available_free_space < 0) |
| return available_free_space / 2; |
| } |
| + if (align_content_distribution == kContentDistributionSpaceEvenly) { |
| + if (available_free_space > 0) |
| + return available_free_space / (number_of_lines + 1); |
| + // Fallback to 'center' |
|
Manuel Rego
2017/04/20 08:57:06
Ditto.
|
| + return available_free_space / 2; |
| + } |
| return LayoutUnit(); |
| } |
| @@ -1978,6 +1992,8 @@ static LayoutUnit AlignContentSpaceBetweenChildren( |
| if (align_content_distribution == kContentDistributionSpaceAround || |
| align_content_distribution == kContentDistributionStretch) |
| return available_free_space / number_of_lines; |
| + if (align_content_distribution == kContentDistributionSpaceEvenly) |
| + return available_free_space / (number_of_lines + 1); |
| } |
| return LayoutUnit(); |
| } |