Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 2832503003: [css-flex] Implement the space-evenly content-distribution value (Closed)
Patch Set: Fixed layout tests. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/true-centering.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 512f64f3b365b1c734ef26493590e1283311f8a2..79ca989986b700afb12c74e39484c1ddff478e20 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -1539,6 +1539,12 @@ static LayoutUnit InitialContentPositionOffset(
return available_free_space / 2;
}
+ if (data.Distribution() == kContentDistributionSpaceEvenly) {
+ if (available_free_space > 0 && number_of_items)
+ return available_free_space / (number_of_items + 1);
+ // Fallback to 'center'
+ return available_free_space / 2;
+ }
return LayoutUnit();
}
@@ -1552,6 +1558,8 @@ static LayoutUnit ContentDistributionSpaceBetweenChildren(
if (data.Distribution() == kContentDistributionSpaceAround ||
data.Distribution() == kContentDistributionStretch)
return available_free_space / number_of_items;
+ if (data.Distribution() == kContentDistributionSpaceEvenly)
+ return available_free_space / (number_of_items + 1);
}
return LayoutUnit();
}
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/true-centering.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698