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

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

Issue 1709963002: [css-align] New CSS Value 'normal' for Self Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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: third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
index feba20988d9c968c54c49e513113436250ec246f..1141fef7d45877655a1ad6c94a74451c0af89c96 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -262,37 +262,14 @@ void StyleAdjuster::adjustStyleForFirstLetter(ComputedStyle& style)
void StyleAdjuster::adjustStyleForAlignment(ComputedStyle& style, const ComputedStyle& parentStyle)
{
- bool isFlexOrGrid = style.isDisplayFlexibleOrGridBox();
- bool absolutePositioned = style.position() == AbsolutePosition;
-
- // If the inherited value of justify-items includes the legacy keyword, 'auto'
+ // If the inherited value of justify-items includes the 'legacy' keyword, 'auto'
// computes to the the inherited value.
- // Otherwise, auto computes to:
- // - 'stretch' for flex containers and grid containers.
- // - 'start' for everything else.
+ // Otherwise, 'auto' computes to 'normal'.
if (style.justifyItemsPosition() == ItemPositionAuto) {
if (parentStyle.justifyItemsPositionType() == LegacyPosition)
style.setJustifyItems(parentStyle.justifyItems());
- else if (isFlexOrGrid)
- style.setJustifyItemsPosition(ItemPositionStretch);
- }
-
- // 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.justifySelfPosition() == ItemPositionAuto) {
- if (absolutePositioned)
- style.setJustifySelfPosition(ItemPositionStretch);
else
- style.setJustifySelf(parentStyle.justifyItems());
- }
-
- // The 'auto' keyword computes to:
- // - 'stretch' for flex containers and grid containers,
- // - 'start' for everything else.
- if (style.alignItemsPosition() == ItemPositionAuto) {
- if (isFlexOrGrid)
- style.setAlignItemsPosition(ItemPositionStretch);
+ style.setJustifyItemsPosition(ItemPositionNormal);
}
}

Powered by Google App Engine
This is Rietveld 408576698