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

Unified Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 636993002: [CSS Grid Layout] Upgrade justify-content parsing to CSS3 Box Alignment spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Using a custom CSSValue to simplify parsing and style building. Created 6 years, 2 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
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index dc278e60be6e74766c7a3126440e13ee641804c2..5929d1214c476d1cb5d149b73ab2b457091357d8 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -295,6 +295,18 @@ void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl
style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment());
}
}
+
+ // Block Containers: For table cells, the behavior of the 'auto' depends on the computed
+ // value of 'vertical-align', otherwise behaves as 'start'.
+ // Flex Containers: 'auto' computes to 'flex-start'.
+ // Grid Containers: 'auto' computes to 'start', and 'stretch' behaves like 'start'.
+ if ((style.justifyContent() == ContentPositionAuto) && (style.justifyContentDistribution() == ContentDistributionDefault)) {
+ if (style.isDisplayFlexibleBox()) {
+ style.setJustifyContent(ContentPositionFlexStart);
+ } else {
+ style.setJustifyContent(ContentPositionStart);
+ }
+ }
}
void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* parentStyle, Element& element)

Powered by Google App Engine
This is Rietveld 408576698