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

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

Issue 674553002: Move parts of core/dom to C++11 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make Windows shut up when I just try following the style guide Created 6 years, 2 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/Node.h » ('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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 1185
1186 m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix); 1186 m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix);
1187 } 1187 }
1188 1188
1189 const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace ToLocate) const 1189 const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespace ToLocate) const
1190 { 1190 {
1191 if (!prefix().isNull() && namespaceURI() == namespaceToLocate) 1191 if (!prefix().isNull() && namespaceURI() == namespaceToLocate)
1192 return prefix(); 1192 return prefix();
1193 1193
1194 AttributeCollection attributes = this->attributes(); 1194 AttributeCollection attributes = this->attributes();
1195 AttributeCollection::iterator end = attributes.end(); 1195 for (const Attribute& attr : attributes) {
1196 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) { 1196 if (attr.prefix() == xmlnsAtom && attr.value() == namespaceToLocate)
1197 if (it->prefix() == xmlnsAtom && it->value() == namespaceToLocate) 1197 return attr.localName();
1198 return it->localName();
1199 } 1198 }
1200 1199
1201 if (Element* parent = parentElement()) 1200 if (Element* parent = parentElement())
1202 return parent->locateNamespacePrefix(namespaceToLocate); 1201 return parent->locateNamespacePrefix(namespaceToLocate);
1203 1202
1204 return nullAtom; 1203 return nullAtom;
1205 } 1204 }
1206 1205
1207 KURL Element::baseURI() const 1206 KURL Element::baseURI() const
1208 { 1207 {
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2920 } 2919 }
2921 ASSERT_NOT_REACHED(); 2920 ASSERT_NOT_REACHED();
2922 } 2921 }
2923 2922
2924 void Element::detachAllAttrNodesFromElement() 2923 void Element::detachAllAttrNodesFromElement()
2925 { 2924 {
2926 AttrNodeList* list = this->attrNodeList(); 2925 AttrNodeList* list = this->attrNodeList();
2927 ASSERT(list); 2926 ASSERT(list);
2928 2927
2929 AttributeCollection attributes = elementData()->attributes(); 2928 AttributeCollection attributes = elementData()->attributes();
2930 AttributeCollection::iterator end = attributes.end(); 2929 for (const Attribute& attr : attributes) {
2931 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) { 2930 if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, attr.n ame()))
2932 if (RefPtrWillBeRawPtr<Attr> attrNode = findAttrNodeInList(*list, it->na me())) 2931 attrNode->detachFromElementWithValue(attr.value());
2933 attrNode->detachFromElementWithValue(it->value());
2934 } 2932 }
2935 2933
2936 removeAttrNodeList(); 2934 removeAttrNodeList();
2937 } 2935 }
2938 2936
2939 void Element::willRecalcStyle(StyleRecalcChange) 2937 void Element::willRecalcStyle(StyleRecalcChange)
2940 { 2938 {
2941 ASSERT(hasCustomStyleCallbacks()); 2939 ASSERT(hasCustomStyleCallbacks());
2942 } 2940 }
2943 2941
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2988 && !ownerDocumentsHaveDifferentCaseSensitivity 2986 && !ownerDocumentsHaveDifferentCaseSensitivity
2989 && !other.m_elementData->presentationAttributeStyle()) 2987 && !other.m_elementData->presentationAttributeStyle())
2990 const_cast<Element&>(other).m_elementData = toUniqueElementData(other.m_ elementData)->makeShareableCopy(); 2988 const_cast<Element&>(other).m_elementData = toUniqueElementData(other.m_ elementData)->makeShareableCopy();
2991 2989
2992 if (!other.m_elementData->isUnique() && !ownerDocumentsHaveDifferentCaseSens itivity && !needsURLResolutionForInlineStyle(other, other.document(), document() )) 2990 if (!other.m_elementData->isUnique() && !ownerDocumentsHaveDifferentCaseSens itivity && !needsURLResolutionForInlineStyle(other, other.document(), document() ))
2993 m_elementData = other.m_elementData; 2991 m_elementData = other.m_elementData;
2994 else 2992 else
2995 m_elementData = other.m_elementData->makeUniqueCopy(); 2993 m_elementData = other.m_elementData->makeUniqueCopy();
2996 2994
2997 AttributeCollection attributes = m_elementData->attributes(); 2995 AttributeCollection attributes = m_elementData->attributes();
2998 AttributeCollection::iterator end = attributes.end(); 2996 for (const Attribute& attr : attributes)
2999 for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) 2997 attributeChangedFromParserOrByCloning(attr.name(), attr.value(), Modifie dByCloning);
3000 attributeChangedFromParserOrByCloning(it->name(), it->value(), ModifiedB yCloning);
3001 } 2998 }
3002 2999
3003 void Element::cloneDataFromElement(const Element& other) 3000 void Element::cloneDataFromElement(const Element& other)
3004 { 3001 {
3005 cloneAttributesFromElement(other); 3002 cloneAttributesFromElement(other);
3006 copyNonAttributePropertiesFromElement(other); 3003 copyNonAttributePropertiesFromElement(other);
3007 } 3004 }
3008 3005
3009 void Element::createUniqueElementData() 3006 void Element::createUniqueElementData()
3010 { 3007 {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
3263 return wrapper; 3260 return wrapper;
3264 3261
3265 CustomElementBinding* binding = perContextData->customElementBinding(customE lementDefinition()); 3262 CustomElementBinding* binding = perContextData->customElementBinding(customE lementDefinition());
3266 3263
3267 wrapper->SetPrototype(binding->prototype()); 3264 wrapper->SetPrototype(binding->prototype());
3268 3265
3269 return V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType , wrapper, isolate); 3266 return V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType , wrapper, isolate);
3270 } 3267 }
3271 3268
3272 } // namespace blink 3269 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698