Commit 5ee21f9a authored by Zhenbo Li's avatar Zhenbo Li Committed by Alexandre Julliard

mshtml: Added IHTMLImgElement::isMap property implementation.

parent 06c66876
......@@ -102,15 +102,37 @@ static HRESULT WINAPI HTMLImgElement_Invoke(IHTMLImgElement *iface, DISPID dispI
static HRESULT WINAPI HTMLImgElement_put_isMap(IHTMLImgElement *iface, VARIANT_BOOL v)
{
HTMLImgElement *This = impl_from_IHTMLImgElement(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
nsresult nsres;
TRACE("(%p)->(%x)\n", This, v);
nsres = nsIDOMHTMLImageElement_SetIsMap(This->nsimg, v != VARIANT_FALSE);
if (NS_FAILED(nsres)) {
ERR("Set IsMap failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLImgElement_get_isMap(IHTMLImgElement *iface, VARIANT_BOOL *p)
{
HTMLImgElement *This = impl_from_IHTMLImgElement(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
cpp_bool b;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
if (p == NULL)
return E_INVALIDARG;
nsres = nsIDOMHTMLImageElement_GetIsMap(This->nsimg, &b);
if (NS_FAILED(nsres)) {
ERR("Get IsMap failed: %08x\n", nsres);
return E_FAIL;
}
*p = b ? VARIANT_TRUE : VARIANT_FALSE;
return S_OK;
}
static HRESULT WINAPI HTMLImgElement_put_useMap(IHTMLImgElement *iface, BSTR v)
......
......@@ -2810,6 +2810,25 @@ static void _test_img_complete(unsigned line, IHTMLElement *elem, VARIANT_BOOL e
IHTMLImgElement_Release(img);
}
#define test_img_isMap(u, c) _test_img_isMap(__LINE__,u, c)
static void _test_img_isMap(unsigned line, IUnknown *unk, VARIANT_BOOL v)
{
IHTMLImgElement *img = _get_img_iface(line, unk);
VARIANT_BOOL b = 100;
HRESULT hres;
hres = IHTMLImgElement_put_isMap(img, v);
ok_(__FILE__,line) (hres == S_OK, "put_isMap failed: %08x\n", hres);
hres = IHTMLImgElement_get_isMap(img, &b);
ok_(__FILE__,line) (hres == S_OK, "get_isMap failed: %08x\n", hres);
ok_(__FILE__,line) (b == v, "isMap = %x, expected %x\n", b, v);
hres = IHTMLImgElement_get_isMap(img, NULL);
ok_(__FILE__,line) (hres == E_INVALIDARG, "ret = %08x, expected E_INVALIDARG\n", hres);
IHTMLImgElement_Release(img);
}
static void test_dynamic_properties(IHTMLElement *elem)
{
static const WCHAR attr1W[] = {'a','t','t','r','1',0};
......@@ -6958,6 +6977,8 @@ static void test_elems(IHTMLDocument2 *doc)
test_img_set_alt((IUnknown*)elem, "alt test");
test_img_name((IUnknown*)elem, "WineImg");
test_img_complete(elem, VARIANT_FALSE);
test_img_isMap((IUnknown*)elem, VARIANT_TRUE);
test_img_isMap((IUnknown*)elem, VARIANT_FALSE);
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