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

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 691893002: Add support for Element#getAttributes (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index c450e8eecb5fd9e929a8b70b635fda3dcff43feb..731cb21387ff0f8ad43eed193cbafb8c826d3488 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -1326,6 +1326,17 @@ void Element::removeAttribute(const AtomicString& localName)
removeAttributeInternal(index, NotInSynchronizationOfLazyAttribute);
}
+Vector<RefPtr<Attr>> Element::getAttributes()
+{
+ if (!elementData())
+ return Vector<RefPtr<Attr>>();
+ synchronizeAllAttributes();
+ Vector<RefPtr<Attr>> attributes;
+ for (const Attribute& attribute : elementData()->attributes())
+ attributes.append(ensureAttr(attribute.name()));
+ return attributes;
+}
+
PassRefPtr<Attr> Element::getAttributeNode(const AtomicString& localName)
{
if (!elementData())

Powered by Google App Engine
This is Rietveld 408576698