#include "config.h"
#include "core/html/HTMLOptionsCollection.h"
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
+#include "bindings/core/v8/ExceptionMessages.h"
+#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
-#include "core/dom/NamedNodesCollection.h"
+#include "core/dom/StaticNodeList.h"
#include "core/html/HTMLOptionElement.h"
#include "core/html/HTMLSelectElement.h"
-namespace WebCore {
+namespace blink {
HTMLOptionsCollection::HTMLOptionsCollection(ContainerNode& select)
: HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter)
toHTMLSelectElement(ownerNode()).remove(index);
}
-void HTMLOptionsCollection::remove(HTMLOptionElement* option)
-{
- return remove(option->index());
-}
-
int HTMLOptionsCollection::selectedIndex() const
{
return toHTMLSelectElement(ownerNode()).selectedIndex();
toHTMLSelectElement(ownerNode()).setLength(length, exceptionState);
}
-void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtrWillBeRawPtr<Element>& returnValue1)
+void HTMLOptionsCollection::namedGetter(const AtomicString& name, RefPtrWillBeRawPtr<NodeList>& returnValue0, RefPtrWillBeRawPtr<Element>& returnValue1)
{
WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
this->namedItems(name, namedItems);
return;
if (namedItems.size() == 1) {
- returnValue1Enabled = true;
returnValue1 = namedItems.at(0);
return;
}
// FIXME: The spec and Firefox do not return a NodeList. They always return the first matching Element.
- returnValue0Enabled = true;
- returnValue0 = NamedNodesCollection::create(namedItems);
+ returnValue0 = StaticElementList::adopt(namedItems);
}
bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWillBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState)