Index: Source/core/css/resolver/StyleBuilderCustom.cpp |
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp |
index bd29c27edd87f9ead6f1bf9d90fb668c8540d157..6fba559c2b2c5e5825886a19725b88784dd03f89 100644 |
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp |
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp |
@@ -551,12 +551,14 @@ void StyleBuilderFunctions::applyInheritCSSPropertyTextIndent(StyleResolverState |
{ |
state.style()->setTextIndent(state.parentStyle()->textIndent()); |
state.style()->setTextIndentLine(state.parentStyle()->textIndentLine()); |
+ state.style()->setTextIndentType(state.parentStyle()->textIndentType()); |
} |
void StyleBuilderFunctions::applyInitialCSSPropertyTextIndent(StyleResolverState& state) |
{ |
state.style()->setTextIndent(RenderStyle::initialTextIndent()); |
state.style()->setTextIndentLine(RenderStyle::initialTextIndentLine()); |
+ state.style()->setTextIndentType(RenderStyle::initialTextIndentType()); |
} |
void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState& state, CSSValue* value) |
@@ -564,22 +566,25 @@ void StyleBuilderFunctions::applyValueCSSPropertyTextIndent(StyleResolverState& |
if (!value->isValueList()) |
return; |
- // [ <length> | <percentage> ] each-line |
- // The order is guaranteed. See BisonCSSParser::parseTextIndent. |
- // The second value, each-line is handled only when css3TextEnabled() returns true. |
+ Length lengthOrPercentageValue; |
+ TextIndentLine textIndentLineValue = RenderStyle::initialTextIndentLine(); |
+ TextIndentType textIndentTypeValue = RenderStyle::initialTextIndentType(); |
- CSSValueList* valueList = toCSSValueList(value); |
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->itemWithoutBoundsCheck(0)); |
- Length lengthOrPercentageValue = primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData()); |
- state.style()->setTextIndent(lengthOrPercentageValue); |
+ for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { |
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(i.value()); |
+ if (!primitiveValue->getValueID()) |
+ lengthOrPercentageValue = primitiveValue->convertToLength<FixedConversion | PercentConversion>(state.cssToLengthConversionData()); |
+ else if (primitiveValue->getValueID() == CSSValueEachLine) |
+ textIndentLineValue = TextIndentEachLine; |
+ else if (primitiveValue->getValueID() == CSSValueHanging) |
+ textIndentTypeValue = TextIndentHanging; |
+ else |
+ ASSERT_NOT_REACHED(); |
+ } |
- ASSERT(valueList->length() <= 2); |
- CSSPrimitiveValue* eachLineValue = toCSSPrimitiveValue(valueList->item(1)); |
- if (eachLineValue) { |
- ASSERT(eachLineValue->getValueID() == CSSValueEachLine); |
- state.style()->setTextIndentLine(TextIndentEachLine); |
- } else |
- state.style()->setTextIndentLine(TextIndentFirstLine); |
+ state.style()->setTextIndent(lengthOrPercentageValue); |
+ state.style()->setTextIndentLine(textIndentLineValue); |
+ state.style()->setTextIndentType(textIndentTypeValue); |
} |
void StyleBuilderFunctions::applyInitialCSSPropertyTransformOrigin(StyleResolverState& state) |