| Index: Source/core/css/CSSLocalNameToLowerMaps.h
|
| diff --git a/Source/core/css/CSSLocalNameToLowerMaps.h b/Source/core/css/CSSLocalNameToLowerMaps.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7684549a01954d21fad85ebf66b48ca02e95c3c4
|
| --- /dev/null
|
| +++ b/Source/core/css/CSSLocalNameToLowerMaps.h
|
| @@ -0,0 +1,50 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CSSLocalNameToLowerMaps_h
|
| +#define CSSLocalNameToLowerMaps_h
|
| +
|
| +#include "wtf/HashMap.h"
|
| +#include "wtf/text/AtomicString.h"
|
| +#include "wtf/text/AtomicStringHash.h"
|
| +
|
| +namespace blink {
|
| +
|
| +namespace CSSLocalNameToLowerMaps {
|
| +
|
| +extern HashMap<AtomicString, AtomicString>* s_elementToLowerMap;
|
| +extern HashMap<AtomicString, AtomicString>* s_attributeToLowerMap;
|
| +
|
| +void buildElementToLowerMap();
|
| +void buildAttributeToLowerMap();
|
| +
|
| +inline const HashMap<AtomicString, AtomicString>& ensureElementToLowerMap()
|
| +{
|
| + if (!s_elementToLowerMap)
|
| + buildElementToLowerMap();
|
| + return *s_elementToLowerMap;
|
| +}
|
| +
|
| +inline const HashMap<AtomicString, AtomicString>& ensureAttributeToLowerMap()
|
| +{
|
| + if (!s_attributeToLowerMap)
|
| + buildAttributeToLowerMap();
|
| + return *s_attributeToLowerMap;
|
| +}
|
| +
|
| +inline AtomicString elementToLower(const AtomicString& elementName)
|
| +{
|
| + return ensureElementToLowerMap().get(elementName);
|
| +}
|
| +
|
| +inline AtomicString attributeToLower(const AtomicString& attributeName)
|
| +{
|
| + return ensureAttributeToLowerMap().get(attributeName);
|
| +}
|
| +
|
| +} // namespace CSSLocalNameToLowerMaps
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // CSSLocalNameToLowerMaps_h
|
|
|