diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c
index aef0bf0fee..08a374ad8c 100644
--- a/dlls/mshtml/htmlselect.c
+++ b/dlls/mshtml/htmlselect.c
@@ -407,8 +407,14 @@ static HRESULT WINAPI HTMLSelectElement_add(IHTMLSelectElement *iface, IHTMLElem
static HRESULT WINAPI HTMLSelectElement_remove(IHTMLSelectElement *iface, LONG index)
{
HTMLSelectElement *This = impl_from_IHTMLSelectElement(iface);
- FIXME("(%p)->(%d)\n", This, index);
- return E_NOTIMPL;
+ nsresult nsres;
+ TRACE("(%p)->(%d)\n", This, index);
+ nsres = nsIDOMHTMLSelectElement_select_Remove(This->nsselect, index);
+ if(NS_FAILED(nsres)) {
+ ERR("Remove failed: %08x\n", nsres);
+ return E_FAIL;
+ }
+ return S_OK;
}
static HRESULT WINAPI HTMLSelectElement_put_length(IHTMLSelectElement *iface, LONG v)
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 02e0d00c42..4378ad3a6f 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -2559,6 +2559,24 @@ static void _test_select_get_disabled(unsigned line, IHTMLSelectElement *select,
_test_elem3_get_disabled(line, (IUnknown*)select, exb);
}
+static void test_select_remove(IHTMLSelectElement *select)
+{
+ HRESULT hres;
+
+ hres = IHTMLSelectElement_remove(select, 3);
+ ok(hres == S_OK, "remove failed: %08x, expected S_OK\n", hres);
+ test_select_length(select, 2);
+
+ hres = IHTMLSelectElement_remove(select, -1);
+ todo_wine
+ ok(hres == E_INVALIDARG, "remove failed: %08x, expected E_INVALIDARG\n", hres);
+ test_select_length(select, 2);
+
+ hres = IHTMLSelectElement_remove(select, 0);
+ ok(hres == S_OK, "remove failed:%08x\n", hres);
+ test_select_length(select, 1);
+}
+
#define test_text_length(u,l) _test_text_length(__LINE__,u,l)
static void _test_text_length(unsigned line, IUnknown *unk, LONG l)
{
@@ -4324,6 +4342,7 @@ static void test_select_elem(IHTMLSelectElement *select)
test_select_multiple(select, VARIANT_FALSE);
test_select_set_multiple(select, VARIANT_TRUE);
+ test_select_remove(select);
}
static void test_form_item(IHTMLElement *elem)