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

Unified Diff: Source/core/page/PageSerializer.cpp

Issue 436603003: Make Element::attributes() less error-prone and simplify call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Keep synchronizeAllAttributes() in hasAttributes() 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/page/PageSerializer.cpp
diff --git a/Source/core/page/PageSerializer.cpp b/Source/core/page/PageSerializer.cpp
index 9ec4e243ee3dd36269945a46056344a3321b7d3f..69c66a1de0e377046e3a891ce627de8f40059050 100644
--- a/Source/core/page/PageSerializer.cpp
+++ b/Source/core/page/PageSerializer.cpp
@@ -76,13 +76,11 @@ static bool isCharsetSpecifyingNode(const Node& node)
const HTMLMetaElement& element = toHTMLMetaElement(node);
HTMLAttributeList attributeList;
- if (element.hasAttributes()) {
- AttributeCollection attributes = element.attributes();
- AttributeCollection::const_iterator end = attributes.end();
- for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
- // FIXME: We should deal appropriately with the attribute if they have a namespace.
- attributeList.append(std::make_pair(it->name().localName(), it->value().string()));
- }
+ AttributeCollection attributes = element.attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it) {
+ // FIXME: We should deal appropriately with the attribute if they have a namespace.
+ attributeList.append(std::make_pair(it->name().localName(), it->value().string()));
}
WTF::TextEncoding textEncoding = encodingFromMetaAttributes(attributeList);
return textEncoding.isValid();

Powered by Google App Engine
This is Rietveld 408576698