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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 333423005: [CSS Grid Layout] Implement 'justify-items' parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Suggested changes and additional test cases. Created 6 years, 6 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/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 1c1eb5780f5380fa6fc7e183fc073d7bb97ed3fa..e02e1084570020698f58459c2b86e844aff54bfa 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -136,6 +136,7 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyHeight,
CSSPropertyImageRendering,
CSSPropertyIsolation,
+ CSSPropertyJustifyItems,
CSSPropertyJustifySelf,
CSSPropertyLeft,
CSSPropertyLetterSpacing,
@@ -1554,9 +1555,11 @@ Node* CSSComputedStyleDeclaration::styledNode() const
return m_node.get();
}
-static PassRefPtrWillBeRawPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPosition itemPosition, OverflowAlignment overflowAlignment)
+static PassRefPtrWillBeRawPtr<CSSValueList> valueForItemPositionWithOverflowAlignment(ItemPosition itemPosition, OverflowAlignment overflowAlignment, bool isLegacy)
{
RefPtrWillBeRawPtr<CSSValueList> result = CSSValueList::createSpaceSeparated();
+ if (isLegacy)
+ result->append(CSSPrimitiveValue::createIdentifier(CSSValueLegacy));
result->append(CSSPrimitiveValue::create(itemPosition));
if (itemPosition >= ItemPositionCenter && overflowAlignment != OverflowAlignmentDefault)
result->append(CSSPrimitiveValue::create(overflowAlignment));
@@ -1886,7 +1889,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
case CSSPropertyAlignContent:
return cssValuePool().createValue(style->alignContent());
case CSSPropertyAlignItems:
- return valueForItemPositionWithOverflowAlignment(style->alignItems(), style->alignItemsOverflowAlignment());
+ return valueForItemPositionWithOverflowAlignment(style->alignItems(), style->alignItemsOverflowAlignment(), false);
case CSSPropertyAlignSelf: {
ItemPosition alignSelf = style->alignSelf();
if (alignSelf == ItemPositionAuto) {
@@ -1896,7 +1899,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
else
alignSelf = ItemPositionStretch;
}
- return valueForItemPositionWithOverflowAlignment(alignSelf, style->alignSelfOverflowAlignment());
+ return valueForItemPositionWithOverflowAlignment(alignSelf, style->alignSelfOverflowAlignment(), false);
}
case CSSPropertyFlex:
return valuesForShorthandProperty(flexShorthand());
@@ -2027,8 +2030,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
return CSSPrimitiveValue::create(style->imageRendering());
case CSSPropertyIsolation:
return cssValuePool().createValue(style->isolation());
+ case CSSPropertyJustifyItems:
+ return valueForItemPositionWithOverflowAlignment(style->justifyItems(), style->justifyItemsOverflowAlignment(), style->justifyItemsIsLegacy());
case CSSPropertyJustifySelf:
- return valueForItemPositionWithOverflowAlignment(style->justifySelf(), style->justifySelfOverflowAlignment());
+ return valueForItemPositionWithOverflowAlignment(style->justifySelf(), style->justifySelfOverflowAlignment(), false);
case CSSPropertyLeft:
return valueForPositionOffset(*style, CSSPropertyLeft, renderer);
case CSSPropertyLetterSpacing:

Powered by Google App Engine
This is Rietveld 408576698