HTMLOptionsCollection.cpp [plain text]
#include "config.h"
#include "HTMLOptionsCollection.h"
#include "ExceptionCode.h"
#include "HTMLOptionElement.h"
namespace WebCore {
HTMLOptionsCollection::HTMLOptionsCollection(HTMLSelectElement& select)
: CachedHTMLCollection<HTMLOptionsCollection, CollectionTypeTraits<SelectOptions>::traversalType>(select, SelectOptions)
{
}
Ref<HTMLOptionsCollection> HTMLOptionsCollection::create(HTMLSelectElement& select, CollectionType)
{
return adoptRef(*new HTMLOptionsCollection(select));
}
void HTMLOptionsCollection::add(HTMLElement& element, HTMLElement* beforeElement, ExceptionCode& ec)
{
selectElement().add(element, beforeElement, ec);
}
void HTMLOptionsCollection::add(HTMLElement& element, int beforeIndex, ExceptionCode& ec)
{
add(element, item(beforeIndex), ec);
}
void HTMLOptionsCollection::remove(int index)
{
selectElement().removeByIndex(index);
}
void HTMLOptionsCollection::remove(HTMLOptionElement& option)
{
selectElement().remove(option);
}
int HTMLOptionsCollection::selectedIndex() const
{
return selectElement().selectedIndex();
}
void HTMLOptionsCollection::setSelectedIndex(int index)
{
selectElement().setSelectedIndex(index);
}
void HTMLOptionsCollection::setLength(unsigned length, ExceptionCode& ec)
{
selectElement().setLength(length, ec);
}
}