mshtml: Added IHTMLElement::put_title implementation.
This commit is contained in:
parent
f911e240d0
commit
6314becd8c
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue