summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-10-08 17:19:54 +0100
committerSteve Block <steveblock@google.com>2009-10-20 00:41:58 +0100
commit231d4e3152a9c27a73b6ac7badbe6be673aa3ddf (patch)
treea6c7e2d6cd7bfa7011cc39abbb436142d7a4a7c8 /WebCore/bindings/js/JSHTMLFormElementCustom.cpp
parente196732677050bd463301566a68a643b6d14b907 (diff)
downloadexternal_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.zip
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.gz
external_webkit-231d4e3152a9c27a73b6ac7badbe6be673aa3ddf.tar.bz2
Merge webkit.org at R49305 : Automatic merge by git.
Change-Id: I8968561bc1bfd72b8923b7118d3728579c6dbcc7
Diffstat (limited to 'WebCore/bindings/js/JSHTMLFormElementCustom.cpp')
-rw-r--r--WebCore/bindings/js/JSHTMLFormElementCustom.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/WebCore/bindings/js/JSHTMLFormElementCustom.cpp b/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
index ffa2d57..de9ec4a 100644
--- a/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
+++ b/WebCore/bindings/js/JSHTMLFormElementCustom.cpp
@@ -30,7 +30,8 @@
#include "HTMLCollection.h"
#include "HTMLFormElement.h"
#include "JSDOMWindowCustom.h"
-#include "JSNamedNodesCollection.h"
+#include "JSNodeList.h"
+#include "StaticNodeList.h"
using namespace JSC;
@@ -47,15 +48,17 @@ JSValue JSHTMLFormElement::nameGetter(ExecState* exec, const Identifier& propert
{
JSHTMLElement* jsForm = static_cast<JSHTMLFormElement*>(asObject(slot.slotBase()));
HTMLFormElement* form = static_cast<HTMLFormElement*>(jsForm->impl());
-
+
Vector<RefPtr<Node> > namedItems;
form->getNamedElements(propertyName, namedItems);
+ if (namedItems.isEmpty())
+ return jsUndefined();
if (namedItems.size() == 1)
return toJS(exec, namedItems[0].get());
- if (namedItems.size() > 1)
- return new (exec) JSNamedNodesCollection(exec, jsForm->globalObject(), namedItems);
- return jsUndefined();
+
+ // FIXME: HTML5 specifies that this should be a RadioNodeList.
+ return toJS(exec, jsForm->globalObject(), StaticNodeList::adopt(namedItems).get());
}
JSValue JSHTMLFormElement::submit(ExecState* exec, const ArgList&)