Commit 6314becd authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLElement::put_title implementation.

parent f911e240
......@@ -594,8 +594,18 @@ static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch **
static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v)
{
HTMLElement *This = HTMLELEM_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString title_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_Init(&title_str, v);
nsres = nsIDOMHTMLElement_SetTitle(This->nselem, &title_str);
nsAString_Finish(&title_str);
if(NS_FAILED(nsres))
ERR("SetTitle failed: %08x\n", nsres);
return S_OK;
}
static HRESULT WINAPI HTMLElement_get_title(IHTMLElement *iface, BSTR *p)
......
......@@ -1108,6 +1108,21 @@ static void _test_elem_title(unsigned line, IUnknown *unk, const char *extitle)
SysFreeString(title);
}
#define test_elem_set_title(u,t) _test_elem_set_title(__LINE__,u,t)
static void _test_elem_set_title(unsigned line, IUnknown *unk, const char *title)
{
IHTMLElement *elem = _get_elem_iface(line, unk);
BSTR tmp;
HRESULT hres;
tmp = a2bstr(title);
hres = IHTMLElement_put_title(elem, tmp);
ok_(__FILE__,line) (hres == S_OK, "get_title failed: %08x\n", hres);
IHTMLElement_Release(elem);
SysFreeString(tmp);
}
#define test_node_get_value_str(u,e) _test_node_get_value_str(__LINE__,u,e)
static void _test_node_get_value_str(unsigned line, IUnknown *unk, const char *exval)
{
......@@ -2004,6 +2019,8 @@ static void test_elems(IHTMLDocument2 *doc)
test_select_elem(select);
test_elem_title((IUnknown*)select, NULL);
test_elem_set_title((IUnknown*)select, "Title");
test_elem_title((IUnknown*)select, "Title");
node = get_first_child((IUnknown*)select);
ok(node != NULL, "node == NULL\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment