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

Side by Side Diff: Source/core/dom/NamedNodeMap.cpp

Issue 23464095: WTF::notFound looks too much like a local variable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « Source/core/dom/EventSender.h ('k') | Source/core/dom/Node.cpp » ('j') | 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
7 * (C) 2007 Eric Seidel (eric@webkit.org) 7 * (C) 2007 Eric Seidel (eric@webkit.org)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return m_element->getAttributeNode(name); 55 return m_element->getAttributeNode(name);
56 } 56 }
57 57
58 PassRefPtr<Node> NamedNodeMap::getNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName) const 58 PassRefPtr<Node> NamedNodeMap::getNamedItemNS(const AtomicString& namespaceURI, const AtomicString& localName) const
59 { 59 {
60 return m_element->getAttributeNodeNS(namespaceURI, localName); 60 return m_element->getAttributeNodeNS(namespaceURI, localName);
61 } 61 }
62 62
63 PassRefPtr<Node> NamedNodeMap::removeNamedItem(const AtomicString& name, Excepti onState& es) 63 PassRefPtr<Node> NamedNodeMap::removeNamedItem(const AtomicString& name, Excepti onState& es)
64 { 64 {
65 size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex (name, shouldIgnoreAttributeCase(m_element)) : notFound; 65 size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex (name, shouldIgnoreAttributeCase(m_element)) : kNotFound;
66 if (index == notFound) { 66 if (index == kNotFound) {
67 es.throwDOMException(NotFoundError); 67 es.throwDOMException(NotFoundError);
68 return 0; 68 return 0;
69 } 69 }
70 return m_element->detachAttribute(index); 70 return m_element->detachAttribute(index);
71 } 71 }
72 72
73 PassRefPtr<Node> NamedNodeMap::removeNamedItemNS(const AtomicString& namespaceUR I, const AtomicString& localName, ExceptionState& es) 73 PassRefPtr<Node> NamedNodeMap::removeNamedItemNS(const AtomicString& namespaceUR I, const AtomicString& localName, ExceptionState& es)
74 { 74 {
75 size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex (QualifiedName(nullAtom, localName, namespaceURI)) : notFound; 75 size_t index = m_element->hasAttributes() ? m_element->getAttributeItemIndex (QualifiedName(nullAtom, localName, namespaceURI)) : kNotFound;
76 if (index == notFound) { 76 if (index == kNotFound) {
77 es.throwDOMException(NotFoundError); 77 es.throwDOMException(NotFoundError);
78 return 0; 78 return 0;
79 } 79 }
80 return m_element->detachAttribute(index); 80 return m_element->detachAttribute(index);
81 } 81 }
82 82
83 PassRefPtr<Node> NamedNodeMap::setNamedItem(Node* node, ExceptionState& es) 83 PassRefPtr<Node> NamedNodeMap::setNamedItem(Node* node, ExceptionState& es)
84 { 84 {
85 if (!node) { 85 if (!node) {
86 es.throwDOMException(NotFoundError); 86 es.throwDOMException(NotFoundError);
(...skipping 22 matching lines...) Expand all
109 } 109 }
110 110
111 size_t NamedNodeMap::length() const 111 size_t NamedNodeMap::length() const
112 { 112 {
113 if (!m_element->hasAttributes()) 113 if (!m_element->hasAttributes())
114 return 0; 114 return 0;
115 return m_element->attributeCount(); 115 return m_element->attributeCount();
116 } 116 }
117 117
118 } // namespace WebCore 118 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/EventSender.h ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698