Changeset 51092 in webkit


Ignore:
Timestamp:
Nov 17, 2009 3:37:48 PM (14 years ago)
Author:
jhoneycutt@apple.com
Message:

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.

Location:
trunk/WebKit/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/win/ChangeLog

    r51091 r51092  
     12009-11-12  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        DOMHTMLSelectElement is missing some implementation.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=31489
     6
     7        Reviewed by Dan Bernstein.
     8
     9        * DOMHTMLClasses.cpp:
     10        (DOMHTMLSelectElement::options):
     11        Cast m_element to an HTMLSelectElement. If it has no options, return
     12        E_FAIL. Otherwise, create a DOMHTMLOptionsCollection to wrap the
     13        options, and return it.
     14        (DOMHTMLSelectElement::activateItemAtIndex):
     15        If the index is out of bounds, return E_FAIL. Otherwise, select the
     16        item.
     17
    1182009-11-12  Jon Honeycutt  <jhoneycutt@apple.com>
    219
  • trunk/WebKit/win/DOMHTMLClasses.cpp

    r51091 r51092  
    696696   
    697697HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::options(
    698         /* [retval][out] */ IDOMHTMLOptionsCollection** /*result*/)
    699 {
    700     ASSERT_NOT_REACHED();
    701     return E_NOTIMPL;
     698        /* [retval][out] */ IDOMHTMLOptionsCollection** result)
     699{
     700    if (!result)
     701        return E_POINTER;
     702
     703    *result = 0;
     704
     705    ASSERT(m_element);
     706    ASSERT(m_element->hasTagName(selectTag));
     707    HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_element);
     708
     709    if (!selectElement->options())
     710        return E_FAIL;
     711
     712    *result = DOMHTMLOptionsCollection::createInstance(selectElement->options().get());
     713    return S_OK;
    702714}
    703715   
     
    790802
    791803HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::activateItemAtIndex(
    792     /* [in] */ int /*index*/)
    793 {
    794     ASSERT_NOT_REACHED();
    795     return E_NOTIMPL;   
     804    /* [in] */ int index)
     805{
     806    ASSERT(m_element);
     807    ASSERT(m_element->hasTagName(selectTag));
     808    HTMLSelectElement* selectElement = static_cast<HTMLSelectElement*>(m_element);
     809
     810    if (index >= selectElement->length())
     811        return E_FAIL;
     812
     813    selectElement->setSelectedIndex(index);
     814    return S_OK;
    796815}
    797816
Note: See TracChangeset for help on using the changeset viewer.