Commit 7afd6f3a authored by jhoneycutt@apple.com's avatar jhoneycutt@apple.com
Browse files

DOMHTMLSelectElement is missing some implementation.

https://bugs.webkit.org/show_bug.cgi?id=31489

Reviewed by Dan Bernstein.

* DOMHTMLClasses.cpp:
(DOMHTMLSelectElement::options):
Cast m_element to an HTMLSelectElement. If it has no options, return
E_FAIL. Otherwise, create a DOMHTMLOptionsCollection to wrap the
options, and return it.
(DOMHTMLSelectElement::activateItemAtIndex):
If the index is out of bounds, return E_FAIL. Otherwise, select the
item.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d057b0ae
2009-11-12 Jon Honeycutt <jhoneycutt@apple.com>
DOMHTMLSelectElement is missing some implementation.
https://bugs.webkit.org/show_bug.cgi?id=31489
Reviewed by Dan Bernstein.
* DOMHTMLClasses.cpp:
(DOMHTMLSelectElement::options):
Cast m_element to an HTMLSelectElement. If it has no options, return
E_FAIL. Otherwise, create a DOMHTMLOptionsCollection to wrap the
options, and return it.
(DOMHTMLSelectElement::activateItemAtIndex):
If the index is out of bounds, return E_FAIL. Otherwise, select the
item.
2009-11-12 Jon Honeycutt <jhoneycutt@apple.com>
DOMHTMLOptionsCollection is missing some implementation.
......
......@@ -695,10 +695,22 @@ HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::form(
}
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::options(
/* [retval][out] */ IDOMHTMLOptionsCollection** /*result*/)
/* [retval][out] */ IDOMHTMLOptionsCollection** result)
{
ASSERT_NOT_REACHED();
return E_NOTIMPL;
if (!result)
return E_POINTER;
*result = 0;
ASSERT(m_element);
ASSERT(m_element->hasTagName(selectTag));
HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_element);
if (!selectElement->options())
return E_FAIL;
*result = DOMHTMLOptionsCollection::createInstance(selectElement->options().get());
return S_OK;
}
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::disabled(
......@@ -789,10 +801,17 @@ HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::remove(
// DOMHTMLSelectElement - IFormsAutoFillTransitionSelect ----------------------
HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::activateItemAtIndex(
/* [in] */ int /*index*/)
/* [in] */ int index)
{
ASSERT_NOT_REACHED();
return E_NOTIMPL;
ASSERT(m_element);
ASSERT(m_element->hasTagName(selectTag));
HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_element);
if (index >= selectElement->length())
return E_FAIL;
selectElement->setSelectedIndex(index);
return S_OK;
}
// DOMHTMLOptionElement - IUnknown --------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment