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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/SizesCalcParser.cpp

Issue 1636453002: Use ASCII case-insensitive matching for ident-likes in the CSS parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Consistent indentation in test. Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/parser/SizesCalcParser.h" 5 #include "core/css/parser/SizesCalcParser.h"
6 6
7 #include "core/css/MediaValues.h" 7 #include "core/css/MediaValues.h"
8 #include "core/css/parser/CSSParserToken.h" 8 #include "core/css/parser/CSSParserToken.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 break; 98 break;
99 case DimensionToken: 99 case DimensionToken:
100 if (!CSSPrimitiveValue::isLength(token.unitType()) || !appendLength( token)) 100 if (!CSSPrimitiveValue::isLength(token.unitType()) || !appendLength( token))
101 return false; 101 return false;
102 break; 102 break;
103 case DelimiterToken: 103 case DelimiterToken:
104 if (!handleOperator(stack, token)) 104 if (!handleOperator(stack, token))
105 return false; 105 return false;
106 break; 106 break;
107 case FunctionToken: 107 case FunctionToken:
108 if (!token.valueEqualsIgnoringCase("calc")) 108 if (!token.valueEqualsIgnoringASCIICase("calc"))
109 return false; 109 return false;
110 // "calc(" is the same as "(" 110 // "calc(" is the same as "("
111 case LeftParenthesisToken: 111 case LeftParenthesisToken:
112 // If the token is a left parenthesis, then push it onto the stack. 112 // If the token is a left parenthesis, then push it onto the stack.
113 stack.append(token); 113 stack.append(token);
114 break; 114 break;
115 case RightParenthesisToken: 115 case RightParenthesisToken:
116 // If the token is a right parenthesis: 116 // If the token is a right parenthesis:
117 // Until the token at the top of the stack is a left parenthesis, po p operators off the stack onto the output queue. 117 // Until the token at the top of the stack is a left parenthesis, po p operators off the stack onto the output queue.
118 while (!stack.isEmpty() && stack.last().type() != LeftParenthesisTok en && stack.last().type() != FunctionToken) { 118 while (!stack.isEmpty() && stack.last().type() != LeftParenthesisTok en && stack.last().type() != FunctionToken) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 } 224 }
225 if (stack.size() == 1 && stack.last().isLength) { 225 if (stack.size() == 1 && stack.last().isLength) {
226 m_result = std::max(clampTo<float>(stack.last().value), (float)0.0); 226 m_result = std::max(clampTo<float>(stack.last().value), (float)0.0);
227 return true; 227 return true;
228 } 228 }
229 return false; 229 return false;
230 } 230 }
231 231
232 } // namespace blink 232 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/MediaQueryParser.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698