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

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

Issue 448043003: Drop const_iterator for AttributeCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/dom/ElementData.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 * (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 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1180 1180
1181 m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix); 1181 m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix);
1182 } 1182 }
1183 1183
1184 const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace ToLocate) const 1184 const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace ToLocate) const
1185 { 1185 {
1186 if (!prefix().isNull() && namespaceURI() == namespaceToLocate) 1186 if (!prefix().isNull() && namespaceURI() == namespaceToLocate)
1187 return prefix(); 1187 return prefix();
1188 1188
1189 AttributeCollection attributes = this->attributes(); 1189 AttributeCollection attributes = this->attributes();
1190 AttributeCollection::const_iterator end = attributes.end(); 1190 AttributeCollection::iterator end = attributes.end();
1191 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) { 1191 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
1192 if (it->prefix() == xmlnsAtom && it->value() == namespaceToLocate) 1192 if (it->prefix() == xmlnsAtom && it->value() == namespaceToLocate)
1193 return it->localName(); 1193 return it->localName();
1194 } 1194 }
1195 1195
1196 if (Element* parent = parentElement()) 1196 if (Element* parent = parentElement())
1197 return parent->locateNamespacePrefix(namespaceToLocate); 1197 return parent->locateNamespacePrefix(namespaceToLocate);
1198 1198
1199 return nullAtom; 1199 return nullAtom;
1200 } 1200 }
1201 1201
(...skipping 1753 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 } 2955 }
2956 ASSERT_NOT_REACHED(); 2956 ASSERT_NOT_REACHED();
2957 } 2957 }
2958 2958
2959 void Element::detachAllAttrNodesFromElement() 2959 void Element::detachAllAttrNodesFromElement()
2960 { 2960 {
2961 AttrNodeList* list = this->attrNodeList(); 2961 AttrNodeList* list = this->attrNodeList();
2962 ASSERT(list); 2962 ASSERT(list);
2963 2963
2964 AttributeCollection attributes = elementData()->attributes(); 2964 AttributeCollection attributes = elementData()->attributes();
2965 AttributeCollection::const_iterator end = attributes.end(); 2965 AttributeCollection::iterator end = attributes.end();
2966 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) { 2966 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
2967 if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, it->na me())) 2967 if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, it->na me()))
2968 attrNode->detachFromElementWithValue(it->value()); 2968 attrNode->detachFromElementWithValue(it->value());
2969 } 2969 }
2970 2970
2971 removeAttrNodeList(); 2971 removeAttrNodeList();
2972 } 2972 }
2973 2973
2974 void Element::willRecalcStyle(StyleRecalcChange) 2974 void Element::willRecalcStyle(StyleRecalcChange)
2975 { 2975 {
2976 ASSERT(hasCustomStyleCallbacks()); 2976 ASSERT(hasCustomStyleCallbacks());
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3023 && !ownerDocumentsHaveDifferentCaseSensitivity 3023 && !ownerDocumentsHaveDifferentCaseSensitivity
3024 && !other.m_elementData->presentationAttributeStyle()) 3024 && !other.m_elementData->presentationAttributeStyle())
3025 const_cast<Element&>(other).m_elementData = toUniqueElementData(other.m_ elementData)->makeShareableCopy(); 3025 const_cast<Element&>(other).m_elementData = toUniqueElementData(other.m_ elementData)->makeShareableCopy();
3026 3026
3027 if (!other.m_elementData->isUnique() && !ownerDocumentsHaveDifferentCaseSens itivity && !needsURLResolutionForInlineStyle(other, other.document(), document() )) 3027 if (!other.m_elementData->isUnique() && !ownerDocumentsHaveDifferentCaseSens itivity && !needsURLResolutionForInlineStyle(other, other.document(), document() ))
3028 m_elementData = other.m_elementData; 3028 m_elementData = other.m_elementData;
3029 else 3029 else
3030 m_elementData = other.m_elementData->makeUniqueCopy(); 3030 m_elementData = other.m_elementData->makeUniqueCopy();
3031 3031
3032 AttributeCollection attributes = m_elementData->attributes(); 3032 AttributeCollection attributes = m_elementData->attributes();
3033 AttributeCollection::const_iterator end = attributes.end(); 3033 AttributeCollection::iterator end = attributes.end();
3034 for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) 3034 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it)
3035 attributeChangedFromParserOrByCloning(it->name(), it->value(), ModifiedB yCloning); 3035 attributeChangedFromParserOrByCloning(it->name(), it->value(), ModifiedB yCloning);
3036 } 3036 }
3037 3037
3038 void Element::cloneDataFromElement(const Element& other) 3038 void Element::cloneDataFromElement(const Element& other)
3039 { 3039 {
3040 cloneAttributesFromElement(other); 3040 cloneAttributesFromElement(other);
3041 copyNonAttributePropertiesFromElement(other); 3041 copyNonAttributePropertiesFromElement(other);
3042 } 3042 }
3043 3043
3044 void Element::createUniqueElementData() 3044 void Element::createUniqueElementData()
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
3260 { 3260 {
3261 #if ENABLE(OILPAN) 3261 #if ENABLE(OILPAN)
3262 if (hasRareData()) 3262 if (hasRareData())
3263 visitor->trace(elementRareData()); 3263 visitor->trace(elementRareData());
3264 visitor->trace(m_elementData); 3264 visitor->trace(m_elementData);
3265 #endif 3265 #endif
3266 ContainerNode::trace(visitor); 3266 ContainerNode::trace(visitor);
3267 } 3267 }
3268 3268
3269 } // namespace blink 3269 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/dom/ElementData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698