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

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

Issue 224723023: Implements hanging property for text-indent from CSS3 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update description Created 6 years, 8 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 4bdd78dfc0bfc5574f20f7c6d4adf79491a23424..5bb5efa89c75dcf504b57630b01475a7988d5b99 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -2221,11 +2221,18 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValu
}
}
case CSSPropertyTextIndent: {
+ // If RuntimeEnabledFeatures::css3TextEnabled() returns false or text-indent has only one value(<length> | <percentage>),
+ // getPropertyCSSValue() returns CSSValue.
+ // If RuntimeEnabledFeatures::css3TextEnabled() returns true and text-indent has each-line or hanging,
+ // getPropertyCSSValue() returns CSSValueList.
RefPtrWillBeRawPtr<CSSValue> textIndent = zoomAdjustedPixelValueForLength(style->textIndent(), *style);
- if (RuntimeEnabledFeatures::css3TextEnabled() && style->textIndentLine() == TextIndentEachLine) {
+ if (RuntimeEnabledFeatures::css3TextEnabled() && (style->textIndentLine() == TextIndentEachLine || style->textIndentType() == TextIndentHanging)) {
RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
list->append(textIndent.release());
- list->append(cssValuePool().createIdentifierValue(CSSValueEachLine));
+ if (style->textIndentLine() == TextIndentEachLine)
+ list->append(cssValuePool().createIdentifierValue(CSSValueEachLine));
+ if (style->textIndentType() == TextIndentHanging)
+ list->append(cssValuePool().createIdentifierValue(CSSValueHanging));
return list.release();
}
return textIndent.release();

Powered by Google App Engine
This is Rietveld 408576698