mshtml: Added IHTMLFormElement::get_length implementation.

This commit is contained in:
Jacek Caban 2010-05-07 15:19:48 +02:00 committed by Alexandre Julliard
parent b7d321769c
commit 95ded555e0
2 changed files with 45 additions and 2 deletions

View File

@ -238,8 +238,19 @@ static HRESULT WINAPI HTMLFormElement_put_length(IHTMLFormElement *iface, LONG v
static HRESULT WINAPI HTMLFormElement_get_length(IHTMLFormElement *iface, LONG *p)
{
HTMLFormElement *This = HTMLFORM_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
PRInt32 length;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMHTMLFormElement_GetLength(This->nsform, &length);
if(NS_FAILED(nsres)) {
ERR("GetLength failed: %08x\n", nsres);
return E_FAIL;
}
*p = length;
return S_OK;
}
static HRESULT WINAPI HTMLFormElement__newEnum(IHTMLFormElement *iface, IUnknown **p)

View File

@ -684,6 +684,17 @@ static IHTMLSelectElement *_get_select_iface(unsigned line, IUnknown *unk)
return select;
}
#define get_form_iface(u) _get_form_iface(__LINE__,u)
static IHTMLFormElement *_get_form_iface(unsigned line, IUnknown *unk)
{
IHTMLFormElement *form;
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IHTMLFormElement, (void**)&form);
ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLFormElement: %08x\n", hres);
return form;
}
#define get_text_iface(u) _get_text_iface(__LINE__,u)
static IHTMLDOMTextNode *_get_text_iface(unsigned line, IUnknown *unk)
{
@ -2389,6 +2400,20 @@ static void _test_elem_client_rect(unsigned line, IUnknown *unk)
IHTMLElement2_Release(elem);
}
#define test_form_length(e,l) _test_form_length(__LINE__,e,l)
static void _test_form_length(unsigned line, IUnknown *unk, LONG exlen)
{
IHTMLFormElement *form = _get_form_iface(line, unk);
LONG len = 0xdeadbeef;
HRESULT hres;
hres = IHTMLFormElement_get_length(form, &len);
ok_(__FILE__,line)(hres == S_OK, "get_length failed: %08x\n", hres);
ok_(__FILE__,line)(len == exlen, "length=%d, expected %d\n", len, exlen);
IHTMLFormElement_Release(form);
}
#define get_elem_doc(e) _get_elem_doc(__LINE__,e)
static IHTMLDocument2 *_get_elem_doc(unsigned line, IUnknown *unk)
{
@ -5818,6 +5843,13 @@ static void test_elems(IHTMLDocument2 *doc)
IHTMLElement_Release(elem);
elem = get_doc_elem_by_id(doc, "frm");
ok(elem != NULL, "elem == NULL\n");
if(elem) {
test_form_length((IUnknown*)elem, 0);
IHTMLElement_Release(elem);
}
test_stylesheets(doc);
test_create_option_elem(doc);
test_create_img_elem(doc);