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

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1467143004: Remove AttributeCollection's findIndex(Attr*) by using QualifiedName (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « third_party/WebKit/Source/core/dom/AttributeCollection.h ('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) 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 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 2183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2194 { 2194 {
2195 if (attr->ownerElement() != this) { 2195 if (attr->ownerElement() != this) {
2196 exceptionState.throwDOMException(NotFoundError, "The node provided is ow ned by another element."); 2196 exceptionState.throwDOMException(NotFoundError, "The node provided is ow ned by another element.");
2197 return nullptr; 2197 return nullptr;
2198 } 2198 }
2199 2199
2200 ASSERT(document() == attr->document()); 2200 ASSERT(document() == attr->document());
2201 2201
2202 synchronizeAttribute(attr->qualifiedName()); 2202 synchronizeAttribute(attr->qualifiedName());
2203 2203
2204 size_t index = elementData()->attributes().findIndex(attr); 2204 size_t index = elementData()->attributes().findIndex(attr->qualifiedName());
2205 if (index == kNotFound) { 2205 if (index == kNotFound) {
2206 exceptionState.throwDOMException(NotFoundError, "The attribute was not f ound on this element."); 2206 exceptionState.throwDOMException(NotFoundError, "The attribute was not f ound on this element.");
2207 return nullptr; 2207 return nullptr;
2208 } 2208 }
2209 2209
2210 RefPtrWillBeRawPtr<Attr> guard(attr); 2210 RefPtrWillBeRawPtr<Attr> guard(attr);
2211 detachAttrNodeAtIndex(attr, index); 2211 detachAttrNodeAtIndex(attr, index);
2212 return guard.release(); 2212 return guard.release();
2213 } 2213 }
2214 2214
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
3567 { 3567 {
3568 #if ENABLE(OILPAN) 3568 #if ENABLE(OILPAN)
3569 if (hasRareData()) 3569 if (hasRareData())
3570 visitor->trace(elementRareData()); 3570 visitor->trace(elementRareData());
3571 visitor->trace(m_elementData); 3571 visitor->trace(m_elementData);
3572 #endif 3572 #endif
3573 ContainerNode::trace(visitor); 3573 ContainerNode::trace(visitor);
3574 } 3574 }
3575 3575
3576 } // namespace blink 3576 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/AttributeCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698