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

Side by Side Diff: Source/core/css/CSSParser-in.cpp

Issue 40733004: Replace compile flag with runtime check for text-underline-position (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed a typo in static function compileUnderlineOffset signature / Rebase Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. 9 * Copyright (C) 2012 Intel Corporation. All rights reserved.
10 * 10 *
(...skipping 2164 matching lines...) Expand 10 before | Expand all | Expand 10 after
2175 // none | [ underline || overline || line-through || blink ] | inherit 2175 // none | [ underline || overline || line-through || blink ] | inherit
2176 return parseTextDecoration(propId, important); 2176 return parseTextDecoration(propId, important);
2177 2177
2178 case CSSPropertyTextDecorationStyle: 2178 case CSSPropertyTextDecorationStyle:
2179 // solid | double | dotted | dashed | wavy 2179 // solid | double | dotted | dashed | wavy
2180 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled() 2180 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()
2181 && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDot ted || id == CSSValueDashed || id == CSSValueWavy)) 2181 && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDot ted || id == CSSValueDashed || id == CSSValueWavy))
2182 validPrimitive = true; 2182 validPrimitive = true;
2183 break; 2183 break;
2184 2184
2185 #if ENABLE(CSS3_TEXT) 2185 case CSSPropertyTextUnderlinePosition:
2186 case CSSPropertyWebkitTextUnderlinePosition:
2187 // auto | alphabetic | under 2186 // auto | alphabetic | under
2188 return parseTextUnderlinePosition(important); 2187 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled())
2189 #endif // CSS3_TEXT 2188 return parseTextUnderlinePosition(important);
2189 return false;
2190 2190
2191 case CSSPropertyZoom: // normal | reset | document | <number> | <pe rcentage> | inherit 2191 case CSSPropertyZoom: // normal | reset | document | <number> | <pe rcentage> | inherit
2192 if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocumen t) 2192 if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocumen t)
2193 validPrimitive = true; 2193 validPrimitive = true;
2194 else 2194 else
2195 validPrimitive = (!id && validUnit(value, FNumber | FPercent | FNonN eg, HTMLStandardMode)); 2195 validPrimitive = (!id && validUnit(value, FNumber | FPercent | FNonN eg, HTMLStandardMode));
2196 break; 2196 break;
2197 2197
2198 case CSSPropertySrc: // Only used within @font-face and @-webkit-filter, so cannot use inherit | initial or be !important. This is a list of urls or local r eferences. 2198 case CSSPropertySrc: // Only used within @font-face and @-webkit-filter, so cannot use inherit | initial or be !important. This is a list of urls or local r eferences.
2199 if (m_inFilterRule) 2199 if (m_inFilterRule)
(...skipping 6930 matching lines...) Expand 10 before | Expand all | Expand 10 after
9130 9130
9131 // Values are either valid or in shorthand scope. 9131 // Values are either valid or in shorthand scope.
9132 if (list->length() && (isValid || inShorthand())) { 9132 if (list->length() && (isValid || inShorthand())) {
9133 addTextDecorationProperty(propId, list.release(), important); 9133 addTextDecorationProperty(propId, list.release(), important);
9134 return true; 9134 return true;
9135 } 9135 }
9136 9136
9137 return false; 9137 return false;
9138 } 9138 }
9139 9139
9140 #if ENABLE(CSS3_TEXT)
9141 bool CSSParser::parseTextUnderlinePosition(bool important) 9140 bool CSSParser::parseTextUnderlinePosition(bool important)
9142 { 9141 {
9143 // The text-underline-position property has sintax "auto | alphabetic | [ un der || [ left | right ] ]". 9142 // The text-underline-position property has sintax "auto | alphabetic | [ un der || [ left | right ] ]".
9144 // However, values 'left' and 'right' are not implemented yet, so we will pa rse sintax 9143 // However, values 'left' and 'right' are not implemented yet, so we will pa rse sintax
9145 // "auto | alphabetic | under" for now. 9144 // "auto | alphabetic | under" for now.
9146 CSSParserValue* value = m_valueList->current(); 9145 CSSParserValue* value = m_valueList->current();
9147 switch (value->id) { 9146 switch (value->id) {
9148 case CSSValueAuto: 9147 case CSSValueAuto:
9149 case CSSValueAlphabetic: 9148 case CSSValueAlphabetic:
9150 case CSSValueUnder: 9149 case CSSValueUnder:
9151 if (m_valueList->next()) 9150 if (m_valueList->next())
9152 return false; 9151 return false;
9153 9152
9154 addProperty(CSSPropertyWebkitTextUnderlinePosition, cssValuePool().creat eIdentifierValue(value->id), important); 9153 addProperty(CSSPropertyTextUnderlinePosition, cssValuePool().createIdent ifierValue(value->id), important);
9155 return true; 9154 return true;
9155 default:
9156 return false;
9156 } 9157 }
9158
9157 return false; 9159 return false;
Julien - ping for review 2013/10/31 22:54:07 Do we need this line if we implement a default cas
abinader 2013/11/01 12:16:42 Sounds redundant, indeed. I've put an ASSERT_NOT_R
9158 } 9160 }
9159 #endif // CSS3_TEXT
9160 9161
9161 bool CSSParser::parseTextEmphasisStyle(bool important) 9162 bool CSSParser::parseTextEmphasisStyle(bool important)
9162 { 9163 {
9163 unsigned valueListSize = m_valueList->size(); 9164 unsigned valueListSize = m_valueList->size();
9164 9165
9165 RefPtr<CSSPrimitiveValue> fill; 9166 RefPtr<CSSPrimitiveValue> fill;
9166 RefPtr<CSSPrimitiveValue> shape; 9167 RefPtr<CSSPrimitiveValue> shape;
9167 9168
9168 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL ist->next()) { 9169 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL ist->next()) {
9169 if (value->unit == CSSPrimitiveValue::CSS_STRING) { 9170 if (value->unit == CSSPrimitiveValue::CSS_STRING) {
(...skipping 2857 matching lines...) Expand 10 before | Expand all | Expand 10 after
12027 { 12028 {
12028 // The tokenizer checks for the construct of an+b. 12029 // The tokenizer checks for the construct of an+b.
12029 // However, since the {ident} rule precedes the {nth} rule, some of those 12030 // However, since the {ident} rule precedes the {nth} rule, some of those
12030 // tokens are identified as string literal. Furthermore we need to accept 12031 // tokens are identified as string literal. Furthermore we need to accept
12031 // "odd" and "even" which does not match to an+b. 12032 // "odd" and "even" which does not match to an+b.
12032 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 12033 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
12033 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 12034 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
12034 } 12035 }
12035 12036
12036 } 12037 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698