Commit 6079c561 authored by Zhenbo Li's avatar Zhenbo Li Committed by Alexandre Julliard

mshtml: Added IHTMLImgElement::align property implementation.

parent e12cb546
......@@ -412,15 +412,35 @@ static HRESULT WINAPI HTMLImgElement_get_loop(IHTMLImgElement *iface, VARIANT *p
static HRESULT WINAPI HTMLImgElement_put_align(IHTMLImgElement *iface, BSTR v)
{
HTMLImgElement *This = impl_from_IHTMLImgElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&str, v);
nsres = nsIDOMHTMLImageElement_SetAlign(This->nsimg, &str);
nsAString_Finish(&str);
if (NS_FAILED(nsres)){
ERR("Set Align(%s) failed: %08x\n", debugstr_w(v), nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLImgElement_get_align(IHTMLImgElement *iface, BSTR *p)
{
HTMLImgElement *This = impl_from_IHTMLImgElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString str;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&str, NULL);
nsres = nsIDOMHTMLImageElement_GetAlign(This->nsimg, &str);
return return_nsstr(nsres, &str, p);
}
static HRESULT WINAPI HTMLImgElement_put_onload(IHTMLImgElement *iface, VARIANT v)
......
......@@ -2783,6 +2783,24 @@ static void _test_img_set_alt(unsigned line, IUnknown *unk, const char *alt)
_test_img_alt(line, unk, alt);
}
#define test_img_align(u,a) _test_img_align(__LINE__,u,a)
static void _test_img_align(unsigned line, IUnknown *unk, const char *align)
{
IHTMLImgElement *img = _get_img_iface(line, unk);
BSTR tmp;
HRESULT hres;
tmp = a2bstr(align);
hres = IHTMLImgElement_put_align(img, tmp);
ok_(__FILE__,line) (hres == S_OK, "put_align failed: %08x\n", hres);
SysFreeString(tmp);
hres = IHTMLImgElement_get_align(img, &tmp);
ok_(__FILE__,line) (hres == S_OK, "put_align failed: %08x\n", hres);
ok_(__FILE__,line) (!strcmp_wa(tmp, align), "Expect %s, got %s\n", align, wine_dbgstr_w(tmp));
SysFreeString(tmp);
}
#define test_img_name(u, c) _test_img_name(__LINE__,u, c)
static void _test_img_name(unsigned line, IUnknown *unk, const char *pValue)
{
......@@ -7000,6 +7018,8 @@ static void test_elems(IHTMLDocument2 *doc)
elem = get_elem_by_id(doc, "imgid", TRUE);
if(elem) {
test_img_align((IUnknown*)elem, "left");
test_img_name((IUnknown*)elem, "WineImg");
test_img_src((IUnknown*)elem, "", NULL);
test_img_set_src((IUnknown*)elem, "about:blank");
test_img_src((IUnknown*)elem, "about:blank", NULL);
......
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