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

Side by Side Diff: Source/core/css/CSSLocalNameToLowerMaps.h

Issue 1099963003: Support type selector for camel-cased SVG elements in HTML. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix performance regression. tagMatches() became too big to be inlined on Linux. Created 5 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CSSLocalNameToLowerMaps_h
6 #define CSSLocalNameToLowerMaps_h
7
8 #include "wtf/HashMap.h"
9 #include "wtf/text/AtomicString.h"
10 #include "wtf/text/AtomicStringHash.h"
11
12 namespace blink {
13
14 namespace CSSLocalNameToLowerMaps {
15
16 extern HashMap<AtomicString, AtomicString>* s_elementToLowerMap;
17 extern HashMap<AtomicString, AtomicString>* s_attributeToLowerMap;
18
19 void buildElementToLowerMap();
20 void buildAttributeToLowerMap();
21
22 inline const HashMap<AtomicString, AtomicString>& ensureElementToLowerMap()
23 {
24 if (!s_elementToLowerMap)
25 buildElementToLowerMap();
26 return *s_elementToLowerMap;
27 }
28
29 inline const HashMap<AtomicString, AtomicString>& ensureAttributeToLowerMap()
30 {
31 if (!s_attributeToLowerMap)
32 buildAttributeToLowerMap();
33 return *s_attributeToLowerMap;
34 }
35
36 inline AtomicString elementToLower(const AtomicString& elementName)
37 {
38 return ensureElementToLowerMap().get(elementName);
39 }
40
41 inline AtomicString attributeToLower(const AtomicString& attributeName)
42 {
43 return ensureAttributeToLowerMap().get(attributeName);
44 }
45
46 } // namespace CSSLocalNameToLowerMaps
47
48 } // namespace blink
49
50 #endif // CSSLocalNameToLowerMaps_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698