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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2361733003: [css-align] Initial value of align-content should be 'stretch'. (Closed)
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index a435498634552f75aa277e1f3e24c91de66b2d6a..e084680bf118876a9f657fbd3c5abbf47cf9ee06 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -556,13 +556,17 @@ static CSSValueList* valuesForBackgroundShorthand(const ComputedStyle& style, co
return ret;
}
-static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data)
+static CSSValueList* valueForContentPositionAndDistributionWithOverflowAlignment(const StyleContentAlignmentData& data, CSSValueID normalBehaviorValueID)
{
CSSValueList* result = CSSValueList::createSpaceSeparated();
if (data.distribution() != ContentDistributionDefault)
result->append(*CSSPrimitiveValue::create(data.distribution()));
- if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal)
- result->append(*CSSPrimitiveValue::create(data.position()));
+ if (data.distribution() == ContentDistributionDefault || data.position() != ContentPositionNormal) {
+ if (!RuntimeEnabledFeatures::cssGridLayoutEnabled() && data.position() == ContentPositionNormal)
+ result->append(*CSSPrimitiveValue::createIdentifier(normalBehaviorValueID));
+ else
+ result->append(*CSSPrimitiveValue::create(data.position()));
+ }
if ((data.position() >= ContentPositionCenter || data.distribution() != ContentDistributionDefault) && data.overflow() != OverflowAlignmentDefault)
result->append(*CSSPrimitiveValue::create(data.overflow()));
ASSERT(result->length() > 0);
@@ -1880,7 +1884,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
case CSSPropertyEmptyCells:
return CSSPrimitiveValue::create(style.emptyCells());
case CSSPropertyAlignContent:
- return valueForContentPositionAndDistributionWithOverflowAlignment(style.alignContent());
+ return valueForContentPositionAndDistributionWithOverflowAlignment(style.alignContent(), CSSValueStretch);
case CSSPropertyAlignItems:
return valueForItemPositionWithOverflowAlignment(style.alignItems());
case CSSPropertyAlignSelf:
@@ -1900,7 +1904,7 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
case CSSPropertyFlexWrap:
return CSSPrimitiveValue::create(style.flexWrap());
case CSSPropertyJustifyContent:
- return valueForContentPositionAndDistributionWithOverflowAlignment(style.justifyContent());
+ return valueForContentPositionAndDistributionWithOverflowAlignment(style.justifyContent(), CSSValueFlexStart);
case CSSPropertyOrder:
return CSSPrimitiveValue::create(style.order(), CSSPrimitiveValue::UnitType::Number);
case CSSPropertyFloat:

Powered by Google App Engine
This is Rietveld 408576698