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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
2214 case TextEmphasisMarkDoubleCircle: 2214 case TextEmphasisMarkDoubleCircle:
2215 case TextEmphasisMarkTriangle: 2215 case TextEmphasisMarkTriangle:
2216 case TextEmphasisMarkSesame: { 2216 case TextEmphasisMarkSesame: {
2217 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac eSeparated(); 2217 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac eSeparated();
2218 list->append(cssValuePool().createValue(style->textEmphasisFill( ))); 2218 list->append(cssValuePool().createValue(style->textEmphasisFill( )));
2219 list->append(cssValuePool().createValue(style->textEmphasisMark( ))); 2219 list->append(cssValuePool().createValue(style->textEmphasisMark( )));
2220 return list.release(); 2220 return list.release();
2221 } 2221 }
2222 } 2222 }
2223 case CSSPropertyTextIndent: { 2223 case CSSPropertyTextIndent: {
2224 // If RuntimeEnabledFeatures::css3TextEnabled() returns false or tex t-indent has only one value(<length> | <percentage>),
2225 // getPropertyCSSValue() returns CSSValue.
2226 // If RuntimeEnabledFeatures::css3TextEnabled() returns true and tex t-indent has each-line or hanging,
2227 // getPropertyCSSValue() returns CSSValueList.
2224 RefPtrWillBeRawPtr<CSSValue> textIndent = zoomAdjustedPixelValueForL ength(style->textIndent(), *style); 2228 RefPtrWillBeRawPtr<CSSValue> textIndent = zoomAdjustedPixelValueForL ength(style->textIndent(), *style);
2225 if (RuntimeEnabledFeatures::css3TextEnabled() && style->textIndentLi ne() == TextIndentEachLine) { 2229 if (RuntimeEnabledFeatures::css3TextEnabled() && (style->textIndentL ine() == TextIndentEachLine || style->textIndentType() == TextIndentHanging)) {
2226 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac eSeparated(); 2230 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpac eSeparated();
2227 list->append(textIndent.release()); 2231 list->append(textIndent.release());
2228 list->append(cssValuePool().createIdentifierValue(CSSValueEachLi ne)); 2232 if (style->textIndentLine() == TextIndentEachLine)
2233 list->append(cssValuePool().createIdentifierValue(CSSValueEa chLine));
2234 if (style->textIndentType() == TextIndentHanging)
2235 list->append(cssValuePool().createIdentifierValue(CSSValueHa nging));
2229 return list.release(); 2236 return list.release();
2230 } 2237 }
2231 return textIndent.release(); 2238 return textIndent.release();
2232 } 2239 }
2233 case CSSPropertyTextShadow: 2240 case CSSPropertyTextShadow:
2234 return valueForShadowList(style->textShadow(), *style, false); 2241 return valueForShadowList(style->textShadow(), *style, false);
2235 case CSSPropertyTextRendering: 2242 case CSSPropertyTextRendering:
2236 return cssValuePool().createValue(style->fontDescription().textRende ring()); 2243 return cssValuePool().createValue(style->fontDescription().textRende ring());
2237 case CSSPropertyTextOverflow: 2244 case CSSPropertyTextOverflow:
2238 if (style->textOverflow()) 2245 if (style->textOverflow())
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
3044 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 3051 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
3045 CSSPropertyB ackgroundClip }; 3052 CSSPropertyB ackgroundClip };
3046 3053
3047 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ; 3054 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSlashSeparated() ;
3048 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator)))); 3055 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlash Seperator))));
3049 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator)))); 3056 list->append(valuesForShorthandProperty(StylePropertyShorthand(CSSPropertyBa ckground, propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSe perator))));
3050 return list.release(); 3057 return list.release();
3051 } 3058 }
3052 3059
3053 } // namespace WebCore 3060 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698