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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSAtRuleID.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: 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 // 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/CSSAtRuleID.h" 5 #include "core/css/parser/CSSAtRuleID.h"
6 6
7 #include "core/css/parser/CSSParserString.h" 7 #include "core/css/parser/CSSParserString.h"
8 #include "core/frame/UseCounter.h" 8 #include "core/frame/UseCounter.h"
9 9
10 namespace blink { 10 namespace blink {
11 11
12 CSSAtRuleID cssAtRuleID(const CSSParserString& name) 12 CSSAtRuleID cssAtRuleID(const CSSParserString& name)
13 { 13 {
14 if (name.equalIgnoringCase("charset")) 14 if (name.equalIgnoringASCIICase("charset"))
15 return CSSAtRuleCharset; 15 return CSSAtRuleCharset;
16 if (name.equalIgnoringCase("font-face")) 16 if (name.equalIgnoringASCIICase("font-face"))
17 return CSSAtRuleFontFace; 17 return CSSAtRuleFontFace;
18 if (name.equalIgnoringCase("import")) 18 if (name.equalIgnoringASCIICase("import"))
19 return CSSAtRuleImport; 19 return CSSAtRuleImport;
20 if (name.equalIgnoringCase("keyframes")) 20 if (name.equalIgnoringASCIICase("keyframes"))
21 return CSSAtRuleKeyframes; 21 return CSSAtRuleKeyframes;
22 if (name.equalIgnoringCase("media")) 22 if (name.equalIgnoringASCIICase("media"))
23 return CSSAtRuleMedia; 23 return CSSAtRuleMedia;
24 if (name.equalIgnoringCase("namespace")) 24 if (name.equalIgnoringASCIICase("namespace"))
25 return CSSAtRuleNamespace; 25 return CSSAtRuleNamespace;
26 if (name.equalIgnoringCase("page")) 26 if (name.equalIgnoringASCIICase("page"))
27 return CSSAtRulePage; 27 return CSSAtRulePage;
28 if (name.equalIgnoringCase("supports")) 28 if (name.equalIgnoringASCIICase("supports"))
29 return CSSAtRuleSupports; 29 return CSSAtRuleSupports;
30 if (name.equalIgnoringCase("viewport")) 30 if (name.equalIgnoringASCIICase("viewport"))
31 return CSSAtRuleViewport; 31 return CSSAtRuleViewport;
32 if (name.equalIgnoringCase("-webkit-keyframes")) 32 if (name.equalIgnoringASCIICase("-webkit-keyframes"))
33 return CSSAtRuleWebkitKeyframes; 33 return CSSAtRuleWebkitKeyframes;
34 return CSSAtRuleInvalid; 34 return CSSAtRuleInvalid;
35 } 35 }
36 36
37 void countAtRule(UseCounter* useCounter, CSSAtRuleID ruleId) 37 void countAtRule(UseCounter* useCounter, CSSAtRuleID ruleId)
38 { 38 {
39 ASSERT(useCounter); 39 ASSERT(useCounter);
40 UseCounter::Feature feature; 40 UseCounter::Feature feature;
41 41
42 switch (ruleId) { 42 switch (ruleId) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 // fallthrough 76 // fallthrough
77 default: 77 default:
78 ASSERT_NOT_REACHED(); 78 ASSERT_NOT_REACHED();
79 return; 79 return;
80 } 80 }
81 useCounter->count(feature); 81 useCounter->count(feature);
82 } 82 }
83 83
84 } // namespace blink 84 } // namespace blink
85 85
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698