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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSParserValues.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 28 matching lines...) Expand all
39 bracketCounts.append(0); 39 bracketCounts.append(0);
40 while (!range.atEnd()) { 40 while (!range.atEnd()) {
41 ASSERT(stack.size() == bracketCounts.size()); 41 ASSERT(stack.size() == bracketCounts.size());
42 ASSERT(!stack.isEmpty()); 42 ASSERT(!stack.isEmpty());
43 const CSSParserToken& token = range.peek(); 43 const CSSParserToken& token = range.peek();
44 if (token.type() != FunctionToken) 44 if (token.type() != FunctionToken)
45 range.consume(); 45 range.consume();
46 CSSParserValue value; 46 CSSParserValue value;
47 switch (token.type()) { 47 switch (token.type()) {
48 case FunctionToken: { 48 case FunctionToken: {
49 if (token.valueEqualsIgnoringCase("url")) { 49 if (token.valueEqualsIgnoringASCIICase("url")) {
50 range.consume(); 50 range.consume();
51 const CSSParserToken& next = range.consumeIncludingWhitespace(); 51 const CSSParserToken& next = range.consumeIncludingWhitespace();
52 if (next.type() == BadStringToken || range.consume().type() != R ightParenthesisToken) { 52 if (next.type() == BadStringToken || range.consume().type() != R ightParenthesisToken) {
53 destroyAndClear(); 53 destroyAndClear();
54 return; 54 return;
55 } 55 }
56 ASSERT(next.type() == StringToken); 56 ASSERT(next.type() == StringToken);
57 value.id = CSSValueInvalid; 57 value.id = CSSValueInvalid;
58 value.isInt = false; 58 value.isInt = false;
59 value.m_unit = CSSParserValue::URI; 59 value.m_unit = CSSParserValue::URI;
60 value.string = next.value(); 60 value.string = next.value();
61 break; 61 break;
62 } else if (token.valueEqualsIgnoringCase("var")) { 62 }
63 if (token.valueEqualsIgnoringASCIICase("var")) {
63 destroyAndClear(); 64 destroyAndClear();
64 return; 65 return;
65 } 66 }
66 67
67 value.id = CSSValueInvalid; 68 value.id = CSSValueInvalid;
68 value.isInt = false; 69 value.isInt = false;
69 70
70 CSSValueID id = token.functionId(); 71 CSSValueID id = token.functionId();
71 if (id == CSSValueCalc || id == CSSValueWebkitCalc) { 72 if (id == CSSValueCalc || id == CSSValueWebkitCalc) {
72 value.m_unit = CSSParserValue::CalcFunction; 73 value.m_unit = CSSParserValue::CalcFunction;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 { 245 {
245 destroy(m_values); 246 destroy(m_values);
246 } 247 }
247 248
248 void CSSParserValueList::addValue(const CSSParserValue& v) 249 void CSSParserValueList::addValue(const CSSParserValue& v)
249 { 250 {
250 m_values.append(v); 251 m_values.append(v);
251 } 252 }
252 253
253 } // namespace blink 254 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698