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

Unified Diff: Source/core/dom/PresentationAttributeStyle.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/PresentationAttributeStyle.cpp
diff --git a/Source/core/dom/PresentationAttributeStyle.cpp b/Source/core/dom/PresentationAttributeStyle.cpp
index 866418dd7a8cf701acec0e6bc51ea55d7b465cdc..2818ee031dcad8a9e1038d03a274b9f7b577d543 100644
--- a/Source/core/dom/PresentationAttributeStyle.cpp
+++ b/Source/core/dom/PresentationAttributeStyle.cpp
@@ -45,7 +45,7 @@ namespace blink {
using namespace HTMLNames;
struct PresentationAttributeCacheKey {
- PresentationAttributeCacheKey() : tagName(0) { }
+ PresentationAttributeCacheKey() : tagName(nullptr) { }
StringImpl* tagName;
Vector<std::pair<StringImpl*, AtomicString>, 3> attributesAndValues;
};
@@ -66,7 +66,7 @@ public:
RefPtrWillBeMember<StylePropertySet> value;
};
-typedef WillBeHeapHashMap<unsigned, OwnPtrWillBeMember<PresentationAttributeCacheEntry>, AlreadyHashed> PresentationAttributeCache;
+using PresentationAttributeCache = WillBeHeapHashMap<unsigned, OwnPtrWillBeMember<PresentationAttributeCacheEntry>, AlreadyHashed>;
static PresentationAttributeCache& presentationAttributeCache()
{
DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<PresentationAttributeCache>, cache, (adoptPtrWillBeNoop(new PresentationAttributeCache())));
@@ -127,16 +127,15 @@ static void makePresentationAttributeCacheKey(Element& element, PresentationAttr
if (isHTMLInputElement(element))
return;
AttributeCollection attributes = element.attributesWithoutUpdate();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it) {
- if (!element.isPresentationAttribute(it->name()))
+ for (const Attribute& attr : attributes) {
+ if (!element.isPresentationAttribute(attr.name()))
continue;
- if (!it->namespaceURI().isNull())
+ if (!attr.namespaceURI().isNull())
return;
// FIXME: Background URL may depend on the base URL and can't be shared. Disallow caching.
- if (it->name() == backgroundAttr)
+ if (attr.name() == backgroundAttr)
return;
- result.attributesAndValues.append(std::make_pair(it->localName().impl(), it->value()));
+ result.attributesAndValues.append(std::make_pair(attr.localName().impl(), attr.value()));
}
if (result.attributesAndValues.isEmpty())
return;
@@ -172,7 +171,7 @@ PassRefPtrWillBeRawPtr<StylePropertySet> computePresentationAttributeStyle(Eleme
if (cacheValue->value && cacheValue->value->key != cacheKey)
cacheHash = 0;
} else {
- cacheValue = 0;
+ cacheValue = nullptr;
}
RefPtrWillBeRawPtr<StylePropertySet> style = nullptr;
@@ -182,9 +181,8 @@ PassRefPtrWillBeRawPtr<StylePropertySet> computePresentationAttributeStyle(Eleme
} else {
style = MutableStylePropertySet::create(element.isSVGElement() ? SVGAttributeMode : HTMLAttributeMode);
AttributeCollection attributes = element.attributesWithoutUpdate();
- AttributeCollection::iterator end = attributes.end();
- for (AttributeCollection::iterator it = attributes.begin(); it != end; ++it)
- element.collectStyleForPresentationAttribute(it->name(), it->value(), toMutableStylePropertySet(style));
+ for (const Attribute& attr : attributes)
+ element.collectStyleForPresentationAttribute(attr.name(), attr.value(), toMutableStylePropertySet(style));
}
if (!cacheHash || cacheValue->value)
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/Range.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698