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 6449b765b3dd55410b1ec7aa281c116cf76cac66..32af4bd85173f799e7387bb6a727cad39f426f91 100644 |
| --- a/Source/core/css/resolver/StyleBuilderConverter.cpp |
| +++ b/Source/core/css/resolver/StyleBuilderConverter.cpp |
| @@ -28,6 +28,7 @@ |
| #include "core/css/resolver/StyleBuilderConverter.h" |
| #include "core/css/BasicShapeFunctions.h" |
| +#include "core/css/CSSContentDistributionValue.h" |
| #include "core/css/CSSFontFeatureValue.h" |
| #include "core/css/CSSFunctionValue.h" |
| #include "core/css/CSSGridLineNamesValue.h" |
| @@ -331,6 +332,45 @@ EGlyphOrientation StyleBuilderConverter::convertGlyphOrientation(StyleResolverSt |
| return GO_270DEG; |
| } |
| +StyleAlignmentData StyleBuilderConverter::convertSelfAlignmentData(StyleResolverState&, CSSValue* value) |
| +{ |
| + ItemPosition position = ItemPositionAuto; |
| + OverflowAlignment overflow = OverflowAlignmentDefault; |
| + ItemPositionType positionType = NonLegacyPosition; |
|
Julien - ping for review
2015/04/13 14:46:20
This is subtly duplicating the logic from the init
jfernandez
2015/04/14 00:18:42
Done.
|
| + |
| + CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| + if (Pair* pairValue = primitiveValue->getPairValue()) { |
| + if (pairValue->first()->getValueID() == CSSValueLegacy) { |
| + positionType = LegacyPosition; |
| + position = *pairValue->second(); |
| + } else { |
| + position = *pairValue->first(); |
| + overflow = *pairValue->second(); |
| + } |
| + } else { |
| + position = *primitiveValue; |
| + } |
| + |
| + return StyleAlignmentData(position, overflow, positionType); |
| +} |
| + |
| +StyleAlignmentData StyleBuilderConverter::convertContentAlignmentData(StyleResolverState&, CSSValue* value) |
| +{ |
| + ContentPosition position = ContentPositionAuto; |
| + ContentDistributionType distribution = ContentDistributionDefault; |
| + OverflowAlignment overflow = OverflowAlignmentDefault; |
|
Julien - ping for review
2015/04/13 14:46:20
Same comment.
jfernandez
2015/04/14 00:18:42
Done.
|
| + |
| + CSSContentDistributionValue* contentValue = toCSSContentDistributionValue(value); |
| + if (contentValue->distribution()->getValueID() != CSSValueInvalid) |
| + distribution = *contentValue->distribution(); |
| + if (contentValue->position()->getValueID() != CSSValueInvalid) |
| + position = *contentValue->position(); |
| + if (contentValue->overflow()->getValueID() != CSSValueInvalid) |
| + overflow = *contentValue->overflow(); |
| + |
| + return StyleAlignmentData(position, distribution, overflow); |
| +} |
| + |
| GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolverState&, CSSValue* value) |
| { |
| CSSValueList* list = toCSSValueList(value); |