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

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

Issue 433153003: [CSS Grid Layout] Don't resolve align-self and justify-self properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested comments. Created 6 years, 3 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 | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/Source/core/css/resolver/StyleAdjuster.cpp b/Source/core/css/resolver/StyleAdjuster.cpp
index 01b0857a3e2e95ba27a5e8c6f42dbe2f07299594..40acdfd1c83685df2a601b710af257491bcd1ea9 100644
--- a/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/Source/core/css/resolver/StyleAdjuster.cpp
@@ -270,42 +270,28 @@ void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl
if (parentStyle.justifyItemsPositionType() == LegacyPosition) {
style.setJustifyItems(parentStyle.justifyItems());
style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionType());
- } else if (isFlexOrGrid) {
- style.setJustifyItems(ItemPositionStretch);
+ } else {
+ style.setJustifyItems(isFlexOrGrid ? ItemPositionStretch : ItemPositionStart);
}
}
// The 'auto' keyword computes to 'stretch' on absolutely-positioned elements,
// and to the computed value of justify-items on the parent (minus
- // any legacy keywords) on all other boxes.
- if (style.justifySelf() == ItemPositionAuto) {
- if (absolutePositioned) {
- style.setJustifySelf(ItemPositionStretch);
- } else {
- style.setJustifySelf(parentStyle.justifyItems());
- style.setJustifySelfOverflowAlignment(parentStyle.justifyItemsOverflowAlignment());
- }
- }
+ // any 'legacy' keywords) on all other boxes (to be resolved during the layout).
+ if ((style.justifySelf() == ItemPositionAuto) && absolutePositioned)
+ style.setJustifySelf(ItemPositionStretch);
// The 'auto' keyword computes to:
// - 'stretch' for flex containers and grid containers,
// - 'start' for everything else.
- if (style.alignItems() == ItemPositionAuto) {
- if (isFlexOrGrid)
- style.setAlignItems(ItemPositionStretch);
- }
+ if (style.alignItems() == ItemPositionAuto)
+ style.setAlignItems(isFlexOrGrid ? ItemPositionStretch : ItemPositionStart);
// The 'auto' keyword computes to 'stretch' on absolutely-positioned elements,
// and to the computed value of align-items on the parent (minus
- // any 'legacy' keywords) on all other boxes.
- if (style.alignSelf() == ItemPositionAuto) {
- if (absolutePositioned) {
- style.setAlignSelf(ItemPositionStretch);
- } else {
- style.setAlignSelf(parentStyle.alignItems());
- style.setAlignSelfOverflowAlignment(parentStyle.alignItemsOverflowAlignment());
- }
- }
+ // any 'legacy' keywords) on all other boxes (to be resolved during the layout).
+ if ((style.alignSelf() == ItemPositionAuto) && absolutePositioned)
+ style.setAlignSelf(ItemPositionStretch);
}
void StyleAdjuster::adjustStyleForTagName(RenderStyle* style, RenderStyle* parentStyle, Element& element)
« no previous file with comments | « Source/core/css/CSSComputedStyleDeclaration.cpp ('k') | Source/core/rendering/RenderFlexibleBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698