mshtml: Added IHTMLElement::put_className implementation.
This commit is contained in:
parent
0497c98961
commit
47d8352067
|
@ -252,8 +252,23 @@ static HRESULT WINAPI HTMLElement_removeAttribute(IHTMLElement *iface, BSTR strA
|
||||||
static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v)
|
static HRESULT WINAPI HTMLElement_put_className(IHTMLElement *iface, BSTR v)
|
||||||
{
|
{
|
||||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
nsAString classname_str;
|
||||||
|
nsresult nsres;
|
||||||
|
|
||||||
|
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||||
|
|
||||||
|
if(!This->nselem) {
|
||||||
|
FIXME("NULL nselem\n");
|
||||||
return E_NOTIMPL;
|
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)
|
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);
|
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)
|
#define get_child_item(c,i) _get_child_item(__LINE__,c,i)
|
||||||
static IHTMLDOMNode *_get_child_item(unsigned line, IHTMLDOMChildrenCollection *col, long idx)
|
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, xxxW, NULL);
|
||||||
test_elem_attr(elem, idW, sW);
|
test_elem_attr(elem, idW, sW);
|
||||||
test_elem_class((IUnknown*)elem, NULL);
|
test_elem_class((IUnknown*)elem, NULL);
|
||||||
|
test_elem_set_class((IUnknown*)elem, "cl");
|
||||||
|
test_elem_set_class((IUnknown*)elem, NULL);
|
||||||
IHTMLElement_Release(elem);
|
IHTMLElement_Release(elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue