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

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: Julien's review #2 (rebased) 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
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2174 // none | [ underline || overline || line-through || blink ] | inherit 2174 // none | [ underline || overline || line-through || blink ] | inherit
2175 return parseTextDecoration(propId, important); 2175 return parseTextDecoration(propId, important);
2176 2176
2177 case CSSPropertyTextDecorationStyle: 2177 case CSSPropertyTextDecorationStyle:
2178 // solid | double | dotted | dashed | wavy 2178 // solid | double | dotted | dashed | wavy
2179 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled() 2179 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled()
2180 && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDot ted || id == CSSValueDashed || id == CSSValueWavy)) 2180 && (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDot ted || id == CSSValueDashed || id == CSSValueWavy))
2181 validPrimitive = true; 2181 validPrimitive = true;
2182 break; 2182 break;
2183 2183
2184 #if ENABLE(CSS3_TEXT) 2184 case CSSPropertyTextUnderlinePosition:
2185 case CSSPropertyWebkitTextUnderlinePosition:
2186 // auto | alphabetic | under 2185 // auto | alphabetic | under
2187 return parseTextUnderlinePosition(important); 2186 if (RuntimeEnabledFeatures::css3TextDecorationsEnabled())
2188 #endif // CSS3_TEXT 2187 return parseTextUnderlinePosition(important);
2188 return false;
2189 2189
2190 case CSSPropertyZoom: // normal | reset | document | <number> | <pe rcentage> | inherit 2190 case CSSPropertyZoom: // normal | reset | document | <number> | <pe rcentage> | inherit
2191 if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocumen t) 2191 if (id == CSSValueNormal || id == CSSValueReset || id == CSSValueDocumen t)
2192 validPrimitive = true; 2192 validPrimitive = true;
2193 else 2193 else
2194 validPrimitive = (!id && validUnit(value, FNumber | FPercent | FNonN eg, HTMLStandardMode)); 2194 validPrimitive = (!id && validUnit(value, FNumber | FPercent | FNonN eg, HTMLStandardMode));
2195 break; 2195 break;
2196 2196
2197 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. 2197 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 if (m_inFilterRule) 2198 if (m_inFilterRule)
(...skipping 6926 matching lines...) Expand 10 before | Expand all | Expand 10 after
9125 9125
9126 // Values are either valid or in shorthand scope. 9126 // Values are either valid or in shorthand scope.
9127 if (list->length() && (isValid || inShorthand())) { 9127 if (list->length() && (isValid || inShorthand())) {
9128 addTextDecorationProperty(propId, list.release(), important); 9128 addTextDecorationProperty(propId, list.release(), important);
9129 return true; 9129 return true;
9130 } 9130 }
9131 9131
9132 return false; 9132 return false;
9133 } 9133 }
9134 9134
9135 #if ENABLE(CSS3_TEXT)
9136 bool CSSParser::parseTextUnderlinePosition(bool important) 9135 bool CSSParser::parseTextUnderlinePosition(bool important)
9137 { 9136 {
9138 // The text-underline-position property has sintax "auto | alphabetic | [ un der || [ left | right ] ]". 9137 // The text-underline-position property has sintax "auto | alphabetic | [ un der || [ left | right ] ]".
9139 // However, values 'left' and 'right' are not implemented yet, so we will pa rse sintax 9138 // However, values 'left' and 'right' are not implemented yet, so we will pa rse sintax
9140 // "auto | alphabetic | under" for now. 9139 // "auto | alphabetic | under" for now.
9141 CSSParserValue* value = m_valueList->current(); 9140 CSSParserValue* value = m_valueList->current();
9142 switch (value->id) { 9141 switch (value->id) {
9143 case CSSValueAuto: 9142 case CSSValueAuto:
9144 case CSSValueAlphabetic: 9143 case CSSValueAlphabetic:
9145 case CSSValueUnder: 9144 case CSSValueUnder:
9146 if (m_valueList->next()) 9145 if (m_valueList->next())
9147 return false; 9146 return false;
9148 9147 addProperty(CSSPropertyTextUnderlinePosition, cssValuePool().createIdent ifierValue(value->id), important);
9149 addProperty(CSSPropertyWebkitTextUnderlinePosition, cssValuePool().creat eIdentifierValue(value->id), important);
9150 return true; 9148 return true;
9149 default:
9150 return false;
9151 } 9151 }
9152 return false;
9153 } 9152 }
9154 #endif // CSS3_TEXT
9155 9153
9156 bool CSSParser::parseTextEmphasisStyle(bool important) 9154 bool CSSParser::parseTextEmphasisStyle(bool important)
9157 { 9155 {
9158 unsigned valueListSize = m_valueList->size(); 9156 unsigned valueListSize = m_valueList->size();
9159 9157
9160 RefPtr<CSSPrimitiveValue> fill; 9158 RefPtr<CSSPrimitiveValue> fill;
9161 RefPtr<CSSPrimitiveValue> shape; 9159 RefPtr<CSSPrimitiveValue> shape;
9162 9160
9163 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL ist->next()) { 9161 for (CSSParserValue* value = m_valueList->current(); value; value = m_valueL ist->next()) {
9164 if (value->unit == CSSPrimitiveValue::CSS_STRING) { 9162 if (value->unit == CSSPrimitiveValue::CSS_STRING) {
(...skipping 2790 matching lines...) Expand 10 before | Expand all | Expand 10 after
11955 { 11953 {
11956 // The tokenizer checks for the construct of an+b. 11954 // The tokenizer checks for the construct of an+b.
11957 // However, since the {ident} rule precedes the {nth} rule, some of those 11955 // However, since the {ident} rule precedes the {nth} rule, some of those
11958 // tokens are identified as string literal. Furthermore we need to accept 11956 // tokens are identified as string literal. Furthermore we need to accept
11959 // "odd" and "even" which does not match to an+b. 11957 // "odd" and "even" which does not match to an+b.
11960 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") 11958 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even")
11961 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); 11959 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n");
11962 } 11960 }
11963 11961
11964 } 11962 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSParser.h ('k') | Source/core/css/CSSPrimitiveValueMappings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698