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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2912383002: Add support for Element.getAttributeNames() (Closed)
Patch Set: rebased Created 3 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 | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 9b3b1c9265d311c50dace218d84bd43109089a82..b810a8c377361aa5d8e02fe250db4678c7657e81 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -324,6 +324,18 @@ NamedNodeMap* Element::attributesForBindings() const {
return rare_data.AttributeMap();
}
+Vector<AtomicString> Element::getAttributeNames() const {
+ Vector<AtomicString> attributesVector;
+ if (!hasAttributes())
+ return attributesVector;
+
+ AttributeCollection attributes = element_data_->Attributes();
+ attributesVector.ReserveInitialCapacity(attributes.size());
+ for (const Attribute& attr : attributes)
+ attributesVector.UncheckedAppend(attr.GetName().ToString());
+ return attributesVector;
+}
+
ElementAnimations* Element::GetElementAnimations() const {
if (HasRareData())
return GetElementRareData()->GetElementAnimations();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698