From 21d7f6a7e69a54dc9d5fd3ff9dce8fa611e62cf7 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 29 Apr 2010 18:28:57 +0200 Subject: [PATCH] mshtml: Added IHTMLSelectElement::get_options implementation. --- dlls/mshtml/htmlselect.c | 8 ++++++-- dlls/mshtml/tests/dom.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index 0fc21c496fc..20f11ee3611 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -170,8 +170,12 @@ static HRESULT WINAPI HTMLSelectElement_get_name(IHTMLSelectElement *iface, BSTR static HRESULT WINAPI HTMLSelectElement_get_options(IHTMLSelectElement *iface, IDispatch **p) { HTMLSelectElement *This = HTMLSELECT_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + *p = (IDispatch*)HTMLSELECT(This); + IDispatch_AddRef(*p); + return S_OK; } static HRESULT WINAPI HTMLSelectElement_put_onchange(IHTMLSelectElement *iface, VARIANT v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 4bcaf2a391b..58ecec2ceaf 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -508,7 +508,7 @@ static void _test_ifaces(unsigned line, IUnknown *iface, REFIID *iids) } } -#define test_get_dispid(u,id) _test_disp(__LINE__,u,id) +#define test_get_dispid(u,id) _test_get_dispid(__LINE__,u,id) static BOOL _test_get_dispid(unsigned line, IUnknown *unk, IID *iid) { IDispatchEx *dispex; @@ -2776,6 +2776,9 @@ static IHTMLElement *get_doc_elem_by_id(IHTMLDocument2 *doc, const char *id) static void test_select_elem(IHTMLSelectElement *select) { + IDispatch *disp; + HRESULT hres; + test_select_type(select, "select-one"); test_select_length(select, 2); test_select_selidx(select, 0); @@ -2787,6 +2790,13 @@ static void test_select_elem(IHTMLSelectElement *select) test_select_get_disabled(select, VARIANT_FALSE); test_select_set_disabled(select, VARIANT_TRUE); test_select_set_disabled(select, VARIANT_FALSE); + + disp = NULL; + hres = IHTMLSelectElement_get_options(select, &disp); + ok(hres == S_OK, "get_options failed: %08x\n", hres); + ok(disp != NULL, "options == NULL\n"); + ok(iface_cmp((IUnknown*)disp, (IUnknown*)select), "disp != select\n"); + IDispatch_Release(disp); } static void test_create_option_elem(IHTMLDocument2 *doc)