| OLD | NEW |
| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 size_t index = m_element->attributes().findIndex(QualifiedName(nullAtom, loc
alName, namespaceURI)); | 70 size_t index = m_element->attributes().findIndex(QualifiedName(nullAtom, loc
alName, namespaceURI)); |
| 71 if (index == kNotFound) { | 71 if (index == kNotFound) { |
| 72 exceptionState.throwDOMException(NotFoundError, "No item with name '" +
namespaceURI + "::" + localName + "' was found."); | 72 exceptionState.throwDOMException(NotFoundError, "No item with name '" +
namespaceURI + "::" + localName + "' was found."); |
| 73 return nullptr; | 73 return nullptr; |
| 74 } | 74 } |
| 75 return m_element->detachAttribute(index); | 75 return m_element->detachAttribute(index); |
| 76 } | 76 } |
| 77 | 77 |
| 78 RawPtr<Attr> NamedNodeMap::setNamedItem(Attr* attr, ExceptionState& exceptionSta
te) | 78 RawPtr<Attr> NamedNodeMap::setNamedItem(Attr* attr, ExceptionState& exceptionSta
te) |
| 79 { | 79 { |
| 80 ASSERT(attr); | 80 DCHECK(attr); |
| 81 return m_element->setAttributeNode(attr, exceptionState); | 81 return m_element->setAttributeNode(attr, exceptionState); |
| 82 } | 82 } |
| 83 | 83 |
| 84 RawPtr<Attr> NamedNodeMap::setNamedItemNS(Attr* attr, ExceptionState& exceptionS
tate) | 84 RawPtr<Attr> NamedNodeMap::setNamedItemNS(Attr* attr, ExceptionState& exceptionS
tate) |
| 85 { | 85 { |
| 86 ASSERT(attr); | 86 DCHECK(attr); |
| 87 return m_element->setAttributeNodeNS(attr, exceptionState); | 87 return m_element->setAttributeNodeNS(attr, exceptionState); |
| 88 } | 88 } |
| 89 | 89 |
| 90 RawPtr<Attr> NamedNodeMap::item(unsigned index) const | 90 RawPtr<Attr> NamedNodeMap::item(unsigned index) const |
| 91 { | 91 { |
| 92 AttributeCollection attributes = m_element->attributes(); | 92 AttributeCollection attributes = m_element->attributes(); |
| 93 if (index >= attributes.size()) | 93 if (index >= attributes.size()) |
| 94 return nullptr; | 94 return nullptr; |
| 95 return m_element->ensureAttr(attributes[index].name()); | 95 return m_element->ensureAttr(attributes[index].name()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 size_t NamedNodeMap::length() const | 98 size_t NamedNodeMap::length() const |
| 99 { | 99 { |
| 100 return m_element->attributes().size(); | 100 return m_element->attributes().size(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 DEFINE_TRACE(NamedNodeMap) | 103 DEFINE_TRACE(NamedNodeMap) |
| 104 { | 104 { |
| 105 visitor->trace(m_element); | 105 visitor->trace(m_element); |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |