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

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

Issue 680193003: IDL: Generate union type containers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.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: Source/core/html/HTMLOptionsCollection.cpp
diff --git a/Source/core/html/HTMLOptionsCollection.cpp b/Source/core/html/HTMLOptionsCollection.cpp
index cc465b5142b3395bc5d72f86d8bfe8f43b8b6a43..86bc30511f58b4ae01682cfe710ac7985296fe89 100644
--- a/Source/core/html/HTMLOptionsCollection.cpp
+++ b/Source/core/html/HTMLOptionsCollection.cpp
@@ -24,6 +24,7 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/UnionTypesCore.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/StaticNodeList.h"
#include "core/html/HTMLOptionElement.h"
@@ -117,7 +118,7 @@ void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception
toHTMLSelectElement(ownerNode()).setLength(length, exceptionState);
}
-void HTMLOptionsCollection::namedGetter(const AtomicString& name, RefPtrWillBeRawPtr<NodeList>& returnValue0, RefPtrWillBeRawPtr<Element>& returnValue1)
+void HTMLOptionsCollection::namedGetter(const AtomicString& name, NodeListOrElement& returnValue)
{
WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
this->namedItems(name, namedItems);
@@ -126,12 +127,12 @@ void HTMLOptionsCollection::namedGetter(const AtomicString& name, RefPtrWillBeRa
return;
if (namedItems.size() == 1) {
- returnValue1 = namedItems.at(0);
+ returnValue.setElement(namedItems.at(0));
return;
}
// FIXME: The spec and Firefox do not return a NodeList. They always return the first matching Element.
- returnValue0 = StaticElementList::adopt(namedItems);
+ returnValue.setNodeList(StaticElementList::adopt(namedItems));
}
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWillBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState)

Powered by Google App Engine
This is Rietveld 408576698