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

Unified Diff: Source/core/editing/MarkupAccumulator.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/editing/MarkupAccumulator.cpp
diff --git a/Source/core/editing/MarkupAccumulator.cpp b/Source/core/editing/MarkupAccumulator.cpp
index ee12e50793c8ae2eeafab5f96e49e20ab5904795..6e73abca81069dd1505c50571a2b6f1418470808 100644
--- a/Source/core/editing/MarkupAccumulator.cpp
+++ b/Source/core/editing/MarkupAccumulator.cpp
@@ -385,12 +385,10 @@ void MarkupAccumulator::appendElement(StringBuilder& result, Element& element, N
{
appendOpenTag(result, element, namespaces);
- if (element.hasAttributes()) {
- AttributeCollection attributes = element.attributes();
- AttributeCollection::const_iterator end = attributes.end();
- for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it)
- appendAttribute(result, element, *it, namespaces);
- }
+ AttributeCollection attributes = element.attributes();
+ AttributeCollection::const_iterator end = attributes.end();
+ for (AttributeCollection::const_iterator it = attributes.begin(); it != end; ++it)
+ appendAttribute(result, element, *it, namespaces);
// Give an opportunity to subclasses to add their own attributes.
appendCustomAttributes(result, element, namespaces);

Powered by Google App Engine
This is Rietveld 408576698