Chromium Code Reviews| Index: Source/core/css/resolver/StyleBuilderCustom.cpp |
| diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp |
| index fc398e94d81b97711bae6c0a8681b72b8e785929..982fa45ee446d15e21abd4d9127717276e7795f6 100644 |
| --- a/Source/core/css/resolver/StyleBuilderCustom.cpp |
| +++ b/Source/core/css/resolver/StyleBuilderCustom.cpp |
| @@ -189,6 +189,47 @@ void StyleBuilderFunctions::applyValueCSSPropertyJustifyItems(StyleResolverState |
| } |
| } |
| +void StyleBuilderFunctions::applyInitialCSSPropertyJustifyContent(StyleResolverState& state) |
| +{ |
| + state.style()->setJustifyContent(RenderStyle::initialJustifyContent()); |
| + state.style()->setJustifyContentOverflowAlignment(RenderStyle::initialJustifyContentOverflowAlignment()); |
| + state.style()->setJustifyContentDistribution(RenderStyle::initialJustifyContentDistribution()); |
| +} |
| + |
| +void StyleBuilderFunctions::applyInheritCSSPropertyJustifyContent(StyleResolverState& state) |
| +{ |
| + state.style()->setJustifyContent(state.parentStyle()->justifyContent()); |
| + state.style()->setJustifyContentOverflowAlignment(state.parentStyle()->justifyContentOverflowAlignment()); |
| + state.style()->setJustifyContentDistribution(state.parentStyle()->justifyContentDistribution()); |
| +} |
| + |
| +void StyleBuilderFunctions::applyValueCSSPropertyJustifyContent(StyleResolverState& state, CSSValue* value) |
| +{ |
| + CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| + if (Pair* pairValue = primitiveValue->getPairValue()) { |
| + if (Pair* nestedPairValue = pairValue->first()->getPairValue()) { |
| + state.style()->setJustifyContentDistribution(*nestedPairValue->first()); |
| + state.style()->setJustifyContent(*nestedPairValue->second()); |
| + state.style()->setJustifyContentOverflowAlignment(*pairValue->second()); |
| + } else if (CSSPrimitiveValue::isContentDistributionKeyword(pairValue->first()->getValueID())) { |
| + state.style()->setJustifyContentDistribution(*pairValue->first()); |
| + if (CSSPrimitiveValue::isContentPositionKeyword(pairValue->second()->getValueID())) |
| + state.style()->setJustifyContent(*pairValue->second()); |
| + else |
| + state.style()->setJustifyContentOverflowAlignment(*pairValue->second()); |
| + } else { |
|
Timothy Loh
2014/10/21 03:51:09
Seems weird to not set all three values in these c
jfernandez
2014/10/27 11:44:37
Well, only explicit values are set. The ones not s
Timothy Loh
2014/10/27 11:55:30
We can go through this function multiple times for
jfernandez
2014/10/27 14:09:24
Oh, I see now. I'll assign the 2 values as you sug
|
| + state.style()->setJustifyContent(*pairValue->first()); |
| + state.style()->setJustifyContentOverflowAlignment(*pairValue->second()); |
| + } |
| + } else { |
| + if (CSSPrimitiveValue::isContentDistributionKeyword(primitiveValue->getValueID())) { |
|
Julien - ping for review
2014/10/20 21:24:02
I usually say that we control the format that gets
jfernandez
2014/10/27 11:44:37
Good idea, thanks. Ill try that approach in the ne
|
| + state.style()->setJustifyContentDistribution(*primitiveValue); |
| + } else { |
| + state.style()->setJustifyContent(*primitiveValue); |
| + } |
| + } |
| +} |
| + |
| void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& state) |
| { |
| state.style()->clearCursorList(); |