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

Side by Side Diff: Source/core/dom/QualifiedName.h

Issue 22803008: setAttributeNode() does not properly normalize case. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: submitting patch with small name changes. Created 7 years, 4 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
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #endif 75 #endif
76 76
77 QualifiedName(const QualifiedName& other) : m_impl(other.m_impl) { ref(); } 77 QualifiedName(const QualifiedName& other) : m_impl(other.m_impl) { ref(); }
78 const QualifiedName& operator=(const QualifiedName& other) { other.ref(); de ref(); m_impl = other.m_impl; return *this; } 78 const QualifiedName& operator=(const QualifiedName& other) { other.ref(); de ref(); m_impl = other.m_impl; return *this; }
79 79
80 bool operator==(const QualifiedName& other) const { return m_impl == other.m _impl; } 80 bool operator==(const QualifiedName& other) const { return m_impl == other.m _impl; }
81 bool operator!=(const QualifiedName& other) const { return !(*this == other) ; } 81 bool operator!=(const QualifiedName& other) const { return !(*this == other) ; }
82 82
83 bool matches(const QualifiedName& other) const { return m_impl == other.m_im pl || (localName() == other.localName() && namespaceURI() == other.namespaceURI( )); } 83 bool matches(const QualifiedName& other) const { return m_impl == other.m_im pl || (localName() == other.localName() && namespaceURI() == other.namespaceURI( )); }
84 84
85 bool matchesPossiblyIgnoringCase(const QualifiedName& other, bool shouldIgno reCase) const { return m_impl == other.m_impl || (equalPossiblyIgnoringCase(loca lName(), other.localName(), shouldIgnoreCase) && namespaceURI() == other.namespa ceURI()); }
86
85 bool hasPrefix() const { return m_impl->m_prefix != nullAtom; } 87 bool hasPrefix() const { return m_impl->m_prefix != nullAtom; }
86 void setPrefix(const AtomicString& prefix) { *this = QualifiedName(prefix, l ocalName(), namespaceURI()); } 88 void setPrefix(const AtomicString& prefix) { *this = QualifiedName(prefix, l ocalName(), namespaceURI()); }
87 89
88 const AtomicString& prefix() const { return m_impl->m_prefix; } 90 const AtomicString& prefix() const { return m_impl->m_prefix; }
89 const AtomicString& localName() const { return m_impl->m_localName; } 91 const AtomicString& localName() const { return m_impl->m_localName; }
90 const AtomicString& namespaceURI() const { return m_impl->m_namespace; } 92 const AtomicString& namespaceURI() const { return m_impl->m_namespace; }
91 93
92 // Uppercased localName, cached for efficiency 94 // Uppercased localName, cached for efficiency
93 const AtomicString& localNameUpper() const; 95 const AtomicString& localNameUpper() const;
94 96
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 typedef WebCore::QualifiedNameHash Hash; 156 typedef WebCore::QualifiedNameHash Hash;
155 }; 157 };
156 158
157 template<> struct HashTraits<WebCore::QualifiedName> : SimpleClassHashTraits <WebCore::QualifiedName> { 159 template<> struct HashTraits<WebCore::QualifiedName> : SimpleClassHashTraits <WebCore::QualifiedName> {
158 static const bool emptyValueIsZero = false; 160 static const bool emptyValueIsZero = false;
159 static WebCore::QualifiedName emptyValue() { return WebCore::nullQName() ; } 161 static WebCore::QualifiedName emptyValue() { return WebCore::nullQName() ; }
160 }; 162 };
161 } 163 }
162 164
163 #endif 165 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698