Chromium Code Reviews

Side by Side Diff: Source/core/css/CSSComputedStyleDeclaration.cpp

Issue 14576017: Implement CSS3TextDecorations runtime flag in favor of CSS3_TEXT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a typo in css-properties-as-js-properties-expected-expected.txt Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 157 matching lines...)
168 CSSPropertyPageBreakInside, 168 CSSPropertyPageBreakInside,
169 CSSPropertyPointerEvents, 169 CSSPropertyPointerEvents,
170 CSSPropertyPosition, 170 CSSPropertyPosition,
171 CSSPropertyResize, 171 CSSPropertyResize,
172 CSSPropertyRight, 172 CSSPropertyRight,
173 CSSPropertySpeak, 173 CSSPropertySpeak,
174 CSSPropertyTableLayout, 174 CSSPropertyTableLayout,
175 CSSPropertyTabSize, 175 CSSPropertyTabSize,
176 CSSPropertyTextAlign, 176 CSSPropertyTextAlign,
177 CSSPropertyTextDecoration, 177 CSSPropertyTextDecoration,
178 CSSPropertyTextDecorationLine,
179 CSSPropertyTextDecorationStyle,
180 CSSPropertyTextDecorationColor,
178 #if ENABLE(CSS3_TEXT) 181 #if ENABLE(CSS3_TEXT)
179 CSSPropertyWebkitTextDecorationLine,
180 CSSPropertyWebkitTextDecorationStyle,
181 CSSPropertyWebkitTextDecorationColor,
182 CSSPropertyWebkitTextAlignLast, 182 CSSPropertyWebkitTextAlignLast,
183 CSSPropertyWebkitTextUnderlinePosition,
184 #endif // CSS3_TEXT 183 #endif // CSS3_TEXT
185 CSSPropertyTextIndent, 184 CSSPropertyTextIndent,
186 CSSPropertyTextRendering, 185 CSSPropertyTextRendering,
187 CSSPropertyTextShadow, 186 CSSPropertyTextShadow,
188 CSSPropertyTextOverflow, 187 CSSPropertyTextOverflow,
189 CSSPropertyTextTransform, 188 CSSPropertyTextTransform,
189 CSSPropertyTextUnderlinePosition,
190 CSSPropertyTop, 190 CSSPropertyTop,
191 CSSPropertyTransitionDelay, 191 CSSPropertyTransitionDelay,
192 CSSPropertyTransitionDuration, 192 CSSPropertyTransitionDuration,
193 CSSPropertyTransitionProperty, 193 CSSPropertyTransitionProperty,
194 CSSPropertyTransitionTimingFunction, 194 CSSPropertyTransitionTimingFunction,
195 CSSPropertyUnicodeBidi, 195 CSSPropertyUnicodeBidi,
196 CSSPropertyVerticalAlign, 196 CSSPropertyVerticalAlign,
197 CSSPropertyVisibility, 197 CSSPropertyVisibility,
198 CSSPropertyWhiteSpace, 198 CSSPropertyWhiteSpace,
199 CSSPropertyWidows, 199 CSSPropertyWidows,
(...skipping 1115 matching lines...)
1315 if (textDecoration & OVERLINE) 1315 if (textDecoration & OVERLINE)
1316 list->append(cssValuePool().createIdentifierValue(CSSValueOverline)); 1316 list->append(cssValuePool().createIdentifierValue(CSSValueOverline));
1317 if (textDecoration & LINE_THROUGH) 1317 if (textDecoration & LINE_THROUGH)
1318 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); 1318 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough));
1319 1319
1320 if (!list->length()) 1320 if (!list->length())
1321 return cssValuePool().createIdentifierValue(CSSValueNone); 1321 return cssValuePool().createIdentifierValue(CSSValueNone);
1322 return list; 1322 return list;
1323 } 1323 }
1324 1324
1325 #if ENABLE(CSS3_TEXT)
1326 static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorat ionStyle textDecorationStyle) 1325 static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorat ionStyle textDecorationStyle)
1327 { 1326 {
1328 switch (textDecorationStyle) { 1327 switch (textDecorationStyle) {
1329 case TextDecorationStyleSolid: 1328 case TextDecorationStyleSolid:
1330 return cssValuePool().createIdentifierValue(CSSValueSolid); 1329 return cssValuePool().createIdentifierValue(CSSValueSolid);
1331 case TextDecorationStyleDouble: 1330 case TextDecorationStyleDouble:
1332 return cssValuePool().createIdentifierValue(CSSValueDouble); 1331 return cssValuePool().createIdentifierValue(CSSValueDouble);
1333 case TextDecorationStyleDotted: 1332 case TextDecorationStyleDotted:
1334 return cssValuePool().createIdentifierValue(CSSValueDotted); 1333 return cssValuePool().createIdentifierValue(CSSValueDotted);
1335 case TextDecorationStyleDashed: 1334 case TextDecorationStyleDashed:
1336 return cssValuePool().createIdentifierValue(CSSValueDashed); 1335 return cssValuePool().createIdentifierValue(CSSValueDashed);
1337 case TextDecorationStyleWavy: 1336 case TextDecorationStyleWavy:
1338 return cssValuePool().createIdentifierValue(CSSValueWavy); 1337 return cssValuePool().createIdentifierValue(CSSValueWavy);
1339 } 1338 }
1340 1339
1341 ASSERT_NOT_REACHED(); 1340 ASSERT_NOT_REACHED();
1342 return cssValuePool().createExplicitInitialValue(); 1341 return cssValuePool().createExplicitInitialValue();
1343 } 1342 }
1344 #endif // CSS3_TEXT
1345 1343
1346 static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepea t yRepeat) 1344 static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepea t yRepeat)
1347 { 1345 {
1348 // For backwards compatibility, if both values are equal, just return one of them. And 1346 // For backwards compatibility, if both values are equal, just return one of them. And
1349 // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand. 1347 // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand.
1350 if (xRepeat == yRepeat) 1348 if (xRepeat == yRepeat)
1351 return cssValuePool().createValue(xRepeat); 1349 return cssValuePool().createValue(xRepeat);
1352 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) 1350 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill)
1353 return cssValuePool().createIdentifierValue(CSSValueRepeatX); 1351 return cssValuePool().createIdentifierValue(CSSValueRepeatX);
1354 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) 1352 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill)
(...skipping 771 matching lines...)
2126 return getPositionOffsetValue(style.get(), CSSPropertyRight, rendere r, m_node->document()->renderView()); 2124 return getPositionOffsetValue(style.get(), CSSPropertyRight, rendere r, m_node->document()->renderView());
2127 case CSSPropertyWebkitRubyPosition: 2125 case CSSPropertyWebkitRubyPosition:
2128 return cssValuePool().createValue(style->rubyPosition()); 2126 return cssValuePool().createValue(style->rubyPosition());
2129 case CSSPropertyTableLayout: 2127 case CSSPropertyTableLayout:
2130 return cssValuePool().createValue(style->tableLayout()); 2128 return cssValuePool().createValue(style->tableLayout());
2131 case CSSPropertyTextAlign: 2129 case CSSPropertyTextAlign:
2132 return cssValuePool().createValue(style->textAlign()); 2130 return cssValuePool().createValue(style->textAlign());
2133 case CSSPropertyTextDecoration: 2131 case CSSPropertyTextDecoration:
2134 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 2132 return renderTextDecorationFlagsToCSSValue(style->textDecoration());
2135 #if ENABLE(CSS3_TEXT) 2133 #if ENABLE(CSS3_TEXT)
2136 case CSSPropertyWebkitTextDecorationLine:
2137 return renderTextDecorationFlagsToCSSValue(style->textDecoration());
2138 case CSSPropertyWebkitTextDecorationStyle:
2139 return renderTextDecorationStyleFlagsToCSSValue(style->textDecoratio nStyle());
2140 case CSSPropertyWebkitTextDecorationColor:
2141 return currentColorOrValidColor(style.get(), style->textDecorationCo lor());
2142 case CSSPropertyWebkitTextAlignLast: 2134 case CSSPropertyWebkitTextAlignLast:
2143 return cssValuePool().createValue(style->textAlignLast()); 2135 return cssValuePool().createValue(style->textAlignLast());
2144 case CSSPropertyWebkitTextUnderlinePosition: 2136 #endif // CSS3_TEXT
2137 case CSSPropertyTextDecorationLine:
2138 return renderTextDecorationFlagsToCSSValue(style->textDecoration());
2139 case CSSPropertyTextDecorationStyle:
2140 return renderTextDecorationStyleFlagsToCSSValue(style->textDecoratio nStyle());
2141 case CSSPropertyTextDecorationColor:
2142 return currentColorOrValidColor(style.get(), style->textDecorationCo lor());
2143 case CSSPropertyTextUnderlinePosition:
2145 return cssValuePool().createValue(style->textUnderlinePosition()); 2144 return cssValuePool().createValue(style->textUnderlinePosition());
2146 #endif // CSS3_TEXT
2147 case CSSPropertyWebkitTextDecorationsInEffect: 2145 case CSSPropertyWebkitTextDecorationsInEffect:
2148 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE ffect()); 2146 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE ffect());
2149 case CSSPropertyWebkitTextFillColor: 2147 case CSSPropertyWebkitTextFillColor:
2150 return currentColorOrValidColor(style.get(), style->textFillColor()) ; 2148 return currentColorOrValidColor(style.get(), style->textFillColor()) ;
2151 case CSSPropertyWebkitTextEmphasisColor: 2149 case CSSPropertyWebkitTextEmphasisColor:
2152 return currentColorOrValidColor(style.get(), style->textEmphasisColo r()); 2150 return currentColorOrValidColor(style.get(), style->textEmphasisColo r());
2153 case CSSPropertyWebkitTextEmphasisPosition: 2151 case CSSPropertyWebkitTextEmphasisPosition:
2154 return cssValuePool().createValue(style->textEmphasisPosition()); 2152 return cssValuePool().createValue(style->textEmphasisPosition());
2155 case CSSPropertyWebkitTextEmphasisStyle: 2153 case CSSPropertyWebkitTextEmphasisStyle:
2156 switch (style->textEmphasisMark()) { 2154 switch (style->textEmphasisMark()) {
(...skipping 836 matching lines...)
2993 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 2991 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
2994 CSSPropertyB ackgroundClip }; 2992 CSSPropertyB ackgroundClip };
2995 2993
2996 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 2994 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
2997 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlashSeperat or)))); 2995 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlashSeperat or))));
2998 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSeperator )))); 2996 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSeperator ))));
2999 return list.release(); 2997 return list.release();
3000 } 2998 }
3001 2999
3002 } // namespace WebCore 3000 } // namespace WebCore
OLDNEW

Powered by Google App Engine