Jacek Caban : mshtml: Added IHTMLButtonElement::get_type implementation.
Module: wine Branch: master Commit: 5f7a55f85ee243fbdc6ae973c46c25668a48e690 URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f7a55f85ee243fbdc6ae973c4... Author: Jacek Caban <jacek(a)codeweavers.com> Date: Thu Jun 16 19:32:34 2016 +0200 mshtml: Added IHTMLButtonElement::get_type implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlinput.c | 10 ++++++++-- dlls/mshtml/tests/dom.c | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index e83cbc1..0b6eb33 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1621,8 +1621,14 @@ static HRESULT WINAPI HTMLButtonElement_Invoke(IHTMLButtonElement *iface, DISPID static HRESULT WINAPI HTMLButtonElement_get_type(IHTMLButtonElement *iface, BSTR *p) { HTMLButtonElement *This = impl_from_IHTMLButtonElement(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString type_str; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&type_str, NULL); + nsres = nsIDOMHTMLButtonElement_GetType(This->nsbutton, &type_str); + return return_nsstr(nsres, &type_str, p); } static HRESULT WINAPI HTMLButtonElement_put_value(IHTMLButtonElement *iface, BSTR v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 52227d3..9788e56 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -54,7 +54,7 @@ static const char elem_test_str[] = "<a id=\"a\" href=\"http://test\" name=\"x\">link</a>" "<label for=\"in\" id=\"labelid\">Label:</label>" "<input id=\"in\" class=\"testclass\" tabIndex=\"2\" title=\"test title\" />" - "<button id=\"btnid\"></button>" + "<button id=\"btnid\" type=\"submit\"></button>" "<select id=\"s\"><option id=\"x\" value=\"val1\">opt1</option><option id=\"y\">opt2</option></select>" "<textarea id=\"X\">text text</textarea>" "<table id=\"tbl\"><tbody><tr></tr><tr id=\"row2\"><td id=\"td1\">td1 text</td><td id=\"td2\">td2 text</td></tr></tbody></table>" @@ -6929,10 +6929,26 @@ static void _test_button_set_disabled(unsigned line, IHTMLElement *elem, VARIANT _test_button_get_disabled(line, elem, b); } +#define test_button_type(a,b) _test_button_type(__LINE__,a,b) +static void _test_button_type(unsigned line, IHTMLElement *elem, const char *extype) +{ + IHTMLButtonElement *button = _get_button_iface(line, (IUnknown*)elem); + BSTR str; + HRESULT hres; + + hres = IHTMLButtonElement_get_type(button, &str); + ok_(__FILE__,line)(hres == S_OK, "get_type failed: %08x\n", hres); + ok_(__FILE__,line)(!strcmp_wa(str, extype), "type = %s, expected %s\n", wine_dbgstr_w(str), extype); + SysFreeString(str); + + IHTMLButtonElement_Release(button); +} + static void test_button_elem(IHTMLElement *elem) { test_button_name(elem, NULL); set_button_name(elem, "button name"); + test_button_type(elem, "submit"); test_elem_istextedit(elem, VARIANT_TRUE); }
participants (1)
-
Alexandre Julliard