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

Unified Diff: Source/core/dom/PresentationAttributeStyle.cpp

Issue 180723006: Have ElementData::attributeItem() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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/editing/MarkupAccumulator.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 ce45b4be90b0300ddb4f1a8ab1dee48e850b4222..45ecc9a58b16fe40991f34a46dab7f2e03895192 100644
--- a/Source/core/dom/PresentationAttributeStyle.cpp
+++ b/Source/core/dom/PresentationAttributeStyle.cpp
@@ -125,15 +125,15 @@ static void makePresentationAttributeCacheKey(Element& element, PresentationAttr
return;
unsigned size = element.attributeCount();
for (unsigned i = 0; i < size; ++i) {
- const Attribute* attribute = element.attributeItem(i);
- if (!element.isPresentationAttribute(attribute->name()))
+ const Attribute& attribute = element.attributeItem(i);
+ if (!element.isPresentationAttribute(attribute.name()))
continue;
- if (!attribute->namespaceURI().isNull())
+ if (!attribute.namespaceURI().isNull())
return;
// FIXME: Background URL may depend on the base URL and can't be shared. Disallow caching.
- if (attribute->name() == backgroundAttr)
+ if (attribute.name() == backgroundAttr)
return;
- result.attributesAndValues.append(std::make_pair(attribute->localName().impl(), attribute->value()));
+ result.attributesAndValues.append(std::make_pair(attribute.localName().impl(), attribute.value()));
}
if (result.attributesAndValues.isEmpty())
return;
@@ -180,8 +180,8 @@ PassRefPtr<StylePropertySet> computePresentationAttributeStyle(Element& element)
style = MutableStylePropertySet::create(element.isSVGElement() ? SVGAttributeMode : HTMLAttributeMode);
unsigned size = element.attributeCount();
for (unsigned i = 0; i < size; ++i) {
- const Attribute* attribute = element.attributeItem(i);
- element.collectStyleForPresentationAttribute(attribute->name(), attribute->value(), toMutableStylePropertySet(style));
+ const Attribute& attribute = element.attributeItem(i);
+ element.collectStyleForPresentationAttribute(attribute.name(), attribute.value(), toMutableStylePropertySet(style));
}
}
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/editing/MarkupAccumulator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698