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

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

Issue 16337002: Revert "Revert "Implement CSS3TextDecorations runtime flag in favor of CSS3_TEXT"" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 6 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 CSSPropertyPageBreakInside, 164 CSSPropertyPageBreakInside,
165 CSSPropertyPointerEvents, 165 CSSPropertyPointerEvents,
166 CSSPropertyPosition, 166 CSSPropertyPosition,
167 CSSPropertyResize, 167 CSSPropertyResize,
168 CSSPropertyRight, 168 CSSPropertyRight,
169 CSSPropertySpeak, 169 CSSPropertySpeak,
170 CSSPropertyTableLayout, 170 CSSPropertyTableLayout,
171 CSSPropertyTabSize, 171 CSSPropertyTabSize,
172 CSSPropertyTextAlign, 172 CSSPropertyTextAlign,
173 CSSPropertyTextDecoration, 173 CSSPropertyTextDecoration,
174 CSSPropertyTextDecorationLine,
175 CSSPropertyTextDecorationStyle,
176 CSSPropertyTextDecorationColor,
174 #if ENABLE(CSS3_TEXT) 177 #if ENABLE(CSS3_TEXT)
175 CSSPropertyWebkitTextDecorationLine,
176 CSSPropertyWebkitTextDecorationStyle,
177 CSSPropertyWebkitTextDecorationColor,
178 CSSPropertyWebkitTextAlignLast, 178 CSSPropertyWebkitTextAlignLast,
179 CSSPropertyWebkitTextUnderlinePosition, 179 CSSPropertyWebkitTextUnderlinePosition,
180 #endif // CSS3_TEXT 180 #endif // CSS3_TEXT
181 CSSPropertyTextIndent, 181 CSSPropertyTextIndent,
182 CSSPropertyTextRendering, 182 CSSPropertyTextRendering,
183 CSSPropertyTextShadow, 183 CSSPropertyTextShadow,
184 CSSPropertyTextOverflow, 184 CSSPropertyTextOverflow,
185 CSSPropertyTextTransform, 185 CSSPropertyTextTransform,
186 CSSPropertyTop, 186 CSSPropertyTop,
187 CSSPropertyTouchAction, 187 CSSPropertyTouchAction,
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 if (textDecoration & TextDecorationOverline) 1316 if (textDecoration & TextDecorationOverline)
1317 list->append(cssValuePool().createIdentifierValue(CSSValueOverline)); 1317 list->append(cssValuePool().createIdentifierValue(CSSValueOverline));
1318 if (textDecoration & TextDecorationLineThrough) 1318 if (textDecoration & TextDecorationLineThrough)
1319 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough)); 1319 list->append(cssValuePool().createIdentifierValue(CSSValueLineThrough));
1320 1320
1321 if (!list->length()) 1321 if (!list->length())
1322 return cssValuePool().createIdentifierValue(CSSValueNone); 1322 return cssValuePool().createIdentifierValue(CSSValueNone);
1323 return list; 1323 return list;
1324 } 1324 }
1325 1325
1326 #if ENABLE(CSS3_TEXT)
1327 static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorat ionStyle textDecorationStyle) 1326 static PassRefPtr<CSSValue> renderTextDecorationStyleFlagsToCSSValue(TextDecorat ionStyle textDecorationStyle)
1328 { 1327 {
1329 switch (textDecorationStyle) { 1328 switch (textDecorationStyle) {
1330 case TextDecorationStyleSolid: 1329 case TextDecorationStyleSolid:
1331 return cssValuePool().createIdentifierValue(CSSValueSolid); 1330 return cssValuePool().createIdentifierValue(CSSValueSolid);
1332 case TextDecorationStyleDouble: 1331 case TextDecorationStyleDouble:
1333 return cssValuePool().createIdentifierValue(CSSValueDouble); 1332 return cssValuePool().createIdentifierValue(CSSValueDouble);
1334 case TextDecorationStyleDotted: 1333 case TextDecorationStyleDotted:
1335 return cssValuePool().createIdentifierValue(CSSValueDotted); 1334 return cssValuePool().createIdentifierValue(CSSValueDotted);
1336 case TextDecorationStyleDashed: 1335 case TextDecorationStyleDashed:
1337 return cssValuePool().createIdentifierValue(CSSValueDashed); 1336 return cssValuePool().createIdentifierValue(CSSValueDashed);
1338 case TextDecorationStyleWavy: 1337 case TextDecorationStyleWavy:
1339 return cssValuePool().createIdentifierValue(CSSValueWavy); 1338 return cssValuePool().createIdentifierValue(CSSValueWavy);
1340 } 1339 }
1341 1340
1342 ASSERT_NOT_REACHED(); 1341 ASSERT_NOT_REACHED();
1343 return cssValuePool().createExplicitInitialValue(); 1342 return cssValuePool().createExplicitInitialValue();
1344 } 1343 }
1345 #endif // CSS3_TEXT
1346 1344
1347 static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepea t yRepeat) 1345 static PassRefPtr<CSSValue> fillRepeatToCSSValue(EFillRepeat xRepeat, EFillRepea t yRepeat)
1348 { 1346 {
1349 // For backwards compatibility, if both values are equal, just return one of them. And 1347 // For backwards compatibility, if both values are equal, just return one of them. And
1350 // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand. 1348 // if the two values are equivalent to repeat-x or repeat-y, just return the shorthand.
1351 if (xRepeat == yRepeat) 1349 if (xRepeat == yRepeat)
1352 return cssValuePool().createValue(xRepeat); 1350 return cssValuePool().createValue(xRepeat);
1353 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill) 1351 if (xRepeat == RepeatFill && yRepeat == NoRepeatFill)
1354 return cssValuePool().createIdentifierValue(CSSValueRepeatX); 1352 return cssValuePool().createIdentifierValue(CSSValueRepeatX);
1355 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill) 1353 if (xRepeat == NoRepeatFill && yRepeat == RepeatFill)
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
2127 return cssValuePool().createValue(style->position()); 2125 return cssValuePool().createValue(style->position());
2128 case CSSPropertyRight: 2126 case CSSPropertyRight:
2129 return getPositionOffsetValue(style.get(), CSSPropertyRight, rendere r, m_node->document()->renderView()); 2127 return getPositionOffsetValue(style.get(), CSSPropertyRight, rendere r, m_node->document()->renderView());
2130 case CSSPropertyWebkitRubyPosition: 2128 case CSSPropertyWebkitRubyPosition:
2131 return cssValuePool().createValue(style->rubyPosition()); 2129 return cssValuePool().createValue(style->rubyPosition());
2132 case CSSPropertyTableLayout: 2130 case CSSPropertyTableLayout:
2133 return cssValuePool().createValue(style->tableLayout()); 2131 return cssValuePool().createValue(style->tableLayout());
2134 case CSSPropertyTextAlign: 2132 case CSSPropertyTextAlign:
2135 return cssValuePool().createValue(style->textAlign()); 2133 return cssValuePool().createValue(style->textAlign());
2136 case CSSPropertyTextDecoration: 2134 case CSSPropertyTextDecoration:
2135 case CSSPropertyTextDecorationLine:
2137 return renderTextDecorationFlagsToCSSValue(style->textDecoration()); 2136 return renderTextDecorationFlagsToCSSValue(style->textDecoration());
2137 case CSSPropertyTextDecorationStyle:
2138 return renderTextDecorationStyleFlagsToCSSValue(style->textDecoratio nStyle());
2139 case CSSPropertyTextDecorationColor:
2140 return currentColorOrValidColor(style.get(), style->textDecorationCo lor());
2138 #if ENABLE(CSS3_TEXT) 2141 #if ENABLE(CSS3_TEXT)
2139 case CSSPropertyWebkitTextDecorationLine:
2140 return renderTextDecorationFlagsToCSSValue(style->textDecoration());
2141 case CSSPropertyWebkitTextDecorationStyle:
2142 return renderTextDecorationStyleFlagsToCSSValue(style->textDecoratio nStyle());
2143 case CSSPropertyWebkitTextDecorationColor:
2144 return currentColorOrValidColor(style.get(), style->textDecorationCo lor());
2145 case CSSPropertyWebkitTextAlignLast: 2142 case CSSPropertyWebkitTextAlignLast:
2146 return cssValuePool().createValue(style->textAlignLast()); 2143 return cssValuePool().createValue(style->textAlignLast());
2147 case CSSPropertyWebkitTextUnderlinePosition: 2144 case CSSPropertyWebkitTextUnderlinePosition:
2148 return cssValuePool().createValue(style->textUnderlinePosition()); 2145 return cssValuePool().createValue(style->textUnderlinePosition());
2149 #endif // CSS3_TEXT 2146 #endif // CSS3_TEXT
2150 case CSSPropertyWebkitTextDecorationsInEffect: 2147 case CSSPropertyWebkitTextDecorationsInEffect:
2151 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE ffect()); 2148 return renderTextDecorationFlagsToCSSValue(style->textDecorationsInE ffect());
2152 case CSSPropertyWebkitTextFillColor: 2149 case CSSPropertyWebkitTextFillColor:
2153 return currentColorOrValidColor(style.get(), style->textFillColor()) ; 2150 return currentColorOrValidColor(style.get(), style->textFillColor()) ;
2154 case CSSPropertyWebkitTextEmphasisColor: 2151 case CSSPropertyWebkitTextEmphasisColor:
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
2990 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin, 2987 static const CSSPropertyID propertiesAfterSlashSeperator[3] = { CSSPropertyB ackgroundSize, CSSPropertyBackgroundOrigin,
2991 CSSPropertyB ackgroundClip }; 2988 CSSPropertyB ackgroundClip };
2992 2989
2993 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 2990 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
2994 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlashSeperat or)))); 2991 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesBeforeSlashSeperator, WTF_ARRAY_LENGTH(propertiesBeforeSlashSeperat or))));
2995 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSeperator )))); 2992 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShortha nd(propertiesAfterSlashSeperator, WTF_ARRAY_LENGTH(propertiesAfterSlashSeperator ))));
2996 return list.release(); 2993 return list.release();
2997 } 2994 }
2998 2995
2999 } // namespace WebCore 2996 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/webexposed/css-properties-as-js-properties-expected.txt ('k') | Source/core/css/CSSParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698