OLD | NEW |
(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 #include "config.h" |
| 6 #include "core/css/CSSLocalNameToLowerMaps.h" |
| 7 |
| 8 #include "core/SVGNames.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 namespace CSSLocalNameToLowerMaps { |
| 13 |
| 14 HashMap<AtomicString, AtomicString>* s_elementToLowerMap = nullptr; |
| 15 HashMap<AtomicString, AtomicString>* s_attributeToLowerMap = nullptr; |
| 16 |
| 17 void buildElementToLowerMap() |
| 18 { |
| 19 ASSERT(!s_elementToLowerMap); |
| 20 s_elementToLowerMap = new HashMap<AtomicString, AtomicString>; |
| 21 OwnPtr<const SVGQualifiedName*[]> svgTags = SVGNames::getSVGTags(); |
| 22 for (size_t i = 0; i < SVGNames::SVGTagsCount; ++i) { |
| 23 AtomicString localName = svgTags[i]->localName(); |
| 24 AtomicString localNameLower = localName.lower(); |
| 25 if (localName != localNameLower) |
| 26 s_elementToLowerMap->set(localName, localNameLower); |
| 27 } |
| 28 } |
| 29 |
| 30 void buildAttributeToLowerMap() |
| 31 { |
| 32 ASSERT(!s_attributeToLowerMap); |
| 33 s_attributeToLowerMap = new HashMap<AtomicString, AtomicString>; |
| 34 } |
| 35 |
| 36 } // namespace CSSElementNameMap |
| 37 |
| 38 } // namespace blink |
OLD | NEW |