Chromium Code Reviews| Index: Source/core/css/resolver/StyleBuilderConverter.cpp |
| diff --git a/Source/core/css/resolver/StyleBuilderConverter.cpp b/Source/core/css/resolver/StyleBuilderConverter.cpp |
| index a0b7c0ddee2fc658775701d0d9019fa6b02ba19b..4f976b7c8d9f5734844b2cdb31e99d41c17735cf 100644 |
| --- a/Source/core/css/resolver/StyleBuilderConverter.cpp |
| +++ b/Source/core/css/resolver/StyleBuilderConverter.cpp |
| @@ -338,6 +338,46 @@ EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverSt |
| return GO_270DEG; |
| } |
| +GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolverState&, CSSValue* value) |
| +{ |
| + CSSValueList* list = toCSSValueList(value); |
| + |
| + CSSPrimitiveValue* first = list->length() >= 1 ? toCSSPrimitiveValue(list->item(0)) : nullptr; |
| + |
| + if (!first) |
| + return RenderStyle::initialGridAutoFlow(); |
|
Timothy Loh
2014/10/10 14:38:45
Looks like the parser always puts at least one val
|
| + |
| + CSSPrimitiveValue* second = list->length() == 2 ? toCSSPrimitiveValue(list->item(1)) : nullptr; |
|
Timothy Loh
2014/10/10 14:38:45
All the logic here should probably get moved to th
Timothy Loh
2014/10/10 16:12:20
Err probably we'd have either a single value for t
|
| + |
| + switch (first->getValueID()) { |
| + case CSSValueRow: |
| + if (second) { |
| + if (second->getValueID() == CSSValueDense) |
| + return AutoFlowRowDense; |
| + return AutoFlowStackRow; |
| + } |
| + return AutoFlowRow; |
| + case CSSValueColumn: |
| + if (second) { |
| + if (second->getValueID() == CSSValueDense) |
| + return AutoFlowColumnDense; |
| + return AutoFlowStackColumn; |
| + } |
| + return AutoFlowColumn; |
| + case CSSValueDense: |
| + if (second && second->getValueID() == CSSValueColumn) |
| + return AutoFlowColumnDense; |
| + return AutoFlowRowDense; |
| + case CSSValueStack: |
| + if (second && second->getValueID() == CSSValueColumn) |
| + return AutoFlowStackColumn; |
| + return AutoFlowStackRow; |
| + default: |
| + ASSERT_NOT_REACHED(); |
| + return RenderStyle::initialGridAutoFlow(); |
| + } |
| +} |
| + |
| GridPosition StyleBuilderConverter::convertGridPosition(StyleResolverState&, CSSValue* value) |
| { |
| // We accept the specification's grammar: |