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

Unified Diff: Source/core/editing/markup.cpp

Issue 337753005: Make iterator for Element's attributes more lightweight (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Proper rebase Created 6 years, 6 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/editing/MarkupAccumulator.cpp ('k') | Source/core/html/HTMLEmbedElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/markup.cpp
diff --git a/Source/core/editing/markup.cpp b/Source/core/editing/markup.cpp
index 9236c00bd4d0044d5e09b0f7c3a6ce0e639699eb..46f385064a3f25674486fa4e5a07c5b191d3012a 100644
--- a/Source/core/editing/markup.cpp
+++ b/Source/core/editing/markup.cpp
@@ -110,10 +110,10 @@ static void completeURLs(DocumentFragment& fragment, const String& baseURL)
for (Element* element = ElementTraversal::firstWithin(fragment); element; element = ElementTraversal::next(*element, &fragment)) {
if (!element->hasAttributes())
continue;
- AttributeIteratorAccessor attributes = element->attributesIterator();
- AttributeConstIterator end = attributes.end();
- for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
- if (element->isURLAttribute(**it) && !it->value().isEmpty())
+ AttributeCollection attributes = element->attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
+ if (element->isURLAttribute(*it) && !it->value().isEmpty())
changes.append(AttributeChange(element, it->name(), KURL(parsedBaseURL, it->value()).string()));
}
}
@@ -290,13 +290,13 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element& element
const bool shouldOverrideStyleAttr = shouldAnnotateOrForceInline || shouldApplyWrappingStyle(element);
if (element.hasAttributes()) {
- AttributeIteratorAccessor attributes = element.attributesIterator();
- AttributeConstIterator end = attributes.end();
- for (AttributeConstIterator it = attributes.begin(); it != end; ++it) {
+ AttributeCollection attributes = element.attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
// We'll handle the style attribute separately, below.
if (it->name() == styleAttr && shouldOverrideStyleAttr)
continue;
- appendAttribute(out, element, **it, 0);
+ appendAttribute(out, element, *it, 0);
}
}
« no previous file with comments | « Source/core/editing/MarkupAccumulator.cpp ('k') | Source/core/html/HTMLEmbedElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698