| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #include "config.h" | 20 #include "config.h" |
| 21 | 21 |
| 22 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC | 22 #ifdef SKIP_STATIC_CONSTRUCTORS_ON_GCC |
| 23 #define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1 | 23 #define WEBCORE_QUALIFIEDNAME_HIDE_GLOBALS 1 |
| 24 #else | |
| 25 #define QNAME_DEFAULT_CONSTRUCTOR | |
| 26 #endif | 24 #endif |
| 27 | 25 |
| 28 #include "HTMLNames.h" | 26 #include "HTMLNames.h" |
| 29 #include "SVGNames.h" | 27 #include "SVGNames.h" |
| 30 #include "XLinkNames.h" | 28 #include "XLinkNames.h" |
| 31 #include "XMLNSNames.h" | 29 #include "XMLNSNames.h" |
| 32 #include "XMLNames.h" | 30 #include "XMLNames.h" |
| 33 #include "core/dom/QualifiedName.h" | 31 #include "core/dom/QualifiedName.h" |
| 34 #include "wtf/Assertions.h" | 32 #include "wtf/Assertions.h" |
| 35 #include "wtf/HashSet.h" | 33 #include "wtf/HashSet.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 105 } |
| 108 | 106 |
| 109 const QualifiedName& nullQName() | 107 const QualifiedName& nullQName() |
| 110 { | 108 { |
| 111 DEFINE_STATIC_LOCAL(QualifiedName, nullName, (nullAtom, nullAtom, nullAtom))
; | 109 DEFINE_STATIC_LOCAL(QualifiedName, nullName, (nullAtom, nullAtom, nullAtom))
; |
| 112 return nullName; | 110 return nullName; |
| 113 } | 111 } |
| 114 | 112 |
| 115 const AtomicString& QualifiedName::localNameUpper() const | 113 const AtomicString& QualifiedName::localNameUpper() const |
| 116 { | 114 { |
| 115 if (!m_impl) |
| 116 return nullAtom; |
| 117 if (!m_impl->m_localNameUpper) | 117 if (!m_impl->m_localNameUpper) |
| 118 m_impl->m_localNameUpper = m_impl->m_localName.upper(); | 118 m_impl->m_localNameUpper = m_impl->m_localName.upper(); |
| 119 return m_impl->m_localNameUpper; | 119 return m_impl->m_localNameUpper; |
| 120 } | 120 } |
| 121 | 121 |
| 122 unsigned QualifiedName::QualifiedNameImpl::computeHash() const | 122 unsigned QualifiedName::QualifiedNameImpl::computeHash() const |
| 123 { | 123 { |
| 124 QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(),
m_namespace.impl() }; | 124 QualifiedNameComponents components = { m_prefix.impl(), m_localName.impl(),
m_namespace.impl() }; |
| 125 return hashComponents(components); | 125 return hashComponents(components); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void createQualifiedName(void* targetAddress, StringImpl* name, const AtomicStri
ng& nameNamespace) | 128 void createQualifiedName(void* targetAddress, StringImpl* name, const AtomicStri
ng& nameNamespace) |
| 129 { | 129 { |
| 130 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e); | 130 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nameNamespac
e); |
| 131 } | 131 } |
| 132 | 132 |
| 133 void createQualifiedName(void* targetAddress, StringImpl* name) | 133 void createQualifiedName(void* targetAddress, StringImpl* name) |
| 134 { | 134 { |
| 135 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom); | 135 new (targetAddress) QualifiedName(nullAtom, AtomicString(name), nullAtom); |
| 136 } | 136 } |
| 137 | 137 |
| 138 } | 138 } |
| OLD | NEW |