Commit 47d83520 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLElement::put_className implementation.

parent 0497c989
......@@ -252,8 +252,23 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA
static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v)
{
HTMLElement *This = HTMLELEM_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString classname_str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
if(!This->nselem) {
FIXME("NULL nselem\n");
return E_NOTIMPL;
}
nsAString_Init(&classname_str, v);
nsres = nsIDOMHTMLElement_SetClassName(This->nselem, &classname_str);
nsAString_Finish(&classname_str);
if(NS_FAILED(nsres))
ERR("SetClassName failed: %08x\n", nsres);
return S_OK;
}
static HRESULT WINAPI HTMLElement_get_className(IHTMLElement *iface, BSTR *p)
......
......@@ -935,6 +935,22 @@ static void _test_elem_class(unsigned line, IUnknown *unk, const char *exclass)
SysFreeString(class);
}
#define test_elem_set_class(u,c) _test_elem_set_class(__LINE__,u,c)
static void _test_elem_set_class(unsigned line, IUnknown *unk, const char *class)
{
IHTMLElement *elem = _get_elem_iface(line, unk);
BSTR tmp;
HRESULT hres;
tmp = class ? a2bstr(class) : NULL;
hres = IHTMLElement_put_className(elem, tmp);
IHTMLElement_Release(elem);
ok_(__FILE__,line) (hres == S_OK, "put_className failed: %08x\n", hres);
SysFreeString(tmp);
_test_elem_class(line, unk, class);
}
#define get_child_item(c,i) _get_child_item(__LINE__,c,i)
static IHTMLDOMNode *_get_child_item(unsigned line, IHTMLDOMChildrenCollection *col, long idx)
{
......@@ -1804,6 +1820,8 @@ static void test_elems(IHTMLDocument2 *doc)
test_elem_attr(elem, xxxW, NULL);
test_elem_attr(elem, idW, sW);
test_elem_class((IUnknown*)elem, NULL);
test_elem_set_class((IUnknown*)elem, "cl");
test_elem_set_class((IUnknown*)elem, NULL);
IHTMLElement_Release(elem);
}
......
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