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

Unified Diff: Source/core/html/HTMLFormControlsCollection.cpp

Issue 15076011: Support union return type for anonymous named/indexed getter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: Created 7 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: Source/core/html/HTMLFormControlsCollection.cpp
diff --git a/Source/core/html/HTMLFormControlsCollection.cpp b/Source/core/html/HTMLFormControlsCollection.cpp
index e4d0793c56614d37296b218aabdd6aea06a85144..e2bf78aee70e1292ee3defb85a2cfd556078eb3a 100644
--- a/Source/core/html/HTMLFormControlsCollection.cpp
+++ b/Source/core/html/HTMLFormControlsCollection.cpp
@@ -161,4 +161,18 @@ void HTMLFormControlsCollection::updateNameCache() const
setHasNameCache();
}
+WTF::UnionType2<RadioNodeList, Node> HTMLFormControlsCollection::namedGetter(const AtomicString& name)
+{
+ Vector<RefPtr<Node> > namedItems;
+ this->namedItems(name, namedItems);
+
+ if (!namedItems.size())
+ return WTF::UnionType2<RadioNodeList, Node>();
+
+ if (namedItems.size() == 1)
+ return WTF::UnionType2<RadioNodeList, Node>(namedItems.at(0).release());
+
+ return WTF::UnionType2<RadioNodeList, Node>(this->ownerNode()->radioNodeList(name));
+}
+
}

Powered by Google App Engine
This is Rietveld 408576698