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

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

Issue 2086283002: Convert CSSParserToken::valueEqualsIgnoringASCIICase to equalIgnoringASCIICase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/CSSVariableParser.h" 5 #include "core/css/parser/CSSVariableParser.h"
6 6
7 #include "core/css/CSSCustomPropertyDeclaration.h" 7 #include "core/css/CSSCustomPropertyDeclaration.h"
8 #include "core/css/parser/CSSParserTokenRange.h" 8 #include "core/css/parser/CSSParserTokenRange.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 29 matching lines...) Expand all
40 if (!classifyBlock(block, hasReferences, hasAtApplyRule, false)) 40 if (!classifyBlock(block, hasReferences, hasAtApplyRule, false))
41 return false; 41 return false;
42 continue; 42 continue;
43 } 43 }
44 44
45 ASSERT(range.peek().getBlockType() != CSSParserToken::BlockEnd); 45 ASSERT(range.peek().getBlockType() != CSSParserToken::BlockEnd);
46 46
47 const CSSParserToken& token = range.consume(); 47 const CSSParserToken& token = range.consume();
48 switch (token.type()) { 48 switch (token.type()) {
49 case AtKeywordToken: { 49 case AtKeywordToken: {
50 if (token.valueEqualsIgnoringASCIICase("apply")) { 50 if (equalIgnoringASCIICase(token.value(), "apply")) {
51 range.consumeWhitespace(); 51 range.consumeWhitespace();
52 const CSSParserToken& variableName = range.consumeIncludingWhite space(); 52 const CSSParserToken& variableName = range.consumeIncludingWhite space();
53 if (!CSSVariableParser::isValidVariableName(variableName) 53 if (!CSSVariableParser::isValidVariableName(variableName)
54 || !(range.atEnd() || range.peek().type() == SemicolonToken || range.peek().type() == RightBraceToken)) 54 || !(range.atEnd() || range.peek().type() == SemicolonToken || range.peek().type() == RightBraceToken))
55 return false; 55 return false;
56 hasAtApplyRule = true; 56 hasAtApplyRule = true;
57 } 57 }
58 break; 58 break;
59 } 59 }
60 case DelimiterToken: { 60 case DelimiterToken: {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule ); 131 CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule );
132 132
133 if (type == CSSValueInvalid) 133 if (type == CSSValueInvalid)
134 return nullptr; 134 return nullptr;
135 if (type == CSSValueInternalVariableValue) 135 if (type == CSSValueInternalVariableValue)
136 return CSSCustomPropertyDeclaration::create(variableName, CSSVariableDat a::create(range, hasReferences || hasAtApplyRule)); 136 return CSSCustomPropertyDeclaration::create(variableName, CSSVariableDat a::create(range, hasReferences || hasAtApplyRule));
137 return CSSCustomPropertyDeclaration::create(variableName, type); 137 return CSSCustomPropertyDeclaration::create(variableName, type);
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698