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

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

Issue 2912383002: Add support for Element.getAttributeNames() (Closed)
Patch Set: Removed redundant file Created 3 years, 7 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: 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 65a83f23f495d473434e00c38afb79a3d409491b..e5ec4443f9e0b5535712c0b257741e657c7c15c1 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2824,6 +2824,18 @@ bool Element::SupportsSpatialNavigationFocus() const {
HasEventListeners(EventTypeNames::focusout));
}
+Vector<AtomicString> Element::getAttributeNames() const {
tkent 2017/06/01 23:48:10 nit: I'd like to move this next to attributesForBi
Shanmuga Pandi 2017/06/02 05:21:51 Done.
+ 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;
+}
+
bool Element::IsFocusable() const {
// Style cannot be cleared out for non-active documents, so in that case the
// needsLayoutTreeUpdateForNode check is invalid.

Powered by Google App Engine
This is Rietveld 408576698