Commit 11ec75c1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLImgElement::width property implementation.

parent 23306623
......@@ -460,15 +460,35 @@ static HRESULT WINAPI HTMLImgElement_get_name(IHTMLImgElement *iface, BSTR *p)
static HRESULT WINAPI HTMLImgElement_put_width(IHTMLImgElement *iface, LONG v)
{
HTMLImgElement *This = HTMLIMG_THIS(iface);
FIXME("(%p)->(%d)\n", This, v);
return E_NOTIMPL;
nsresult nsres;
TRACE("(%p)->(%d)\n", This, v);
nsres = nsIDOMHTMLImageElement_SetWidth(This->nsimg, v);
if(NS_FAILED(nsres)) {
ERR("SetWidth failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLImgElement_get_width(IHTMLImgElement *iface, LONG *p)
{
HTMLImgElement *This = HTMLIMG_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
PRInt32 width;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsres = nsIDOMHTMLImageElement_GetWidth(This->nsimg, &width);
if(NS_FAILED(nsres)) {
ERR("GetWidth failed: %08x\n", nsres);
return E_FAIL;
}
*p = width;
return S_OK;
}
static HRESULT WINAPI HTMLImgElement_put_height(IHTMLImgElement *iface, LONG v)
......
......@@ -1145,8 +1145,8 @@ static void _test_img_width(unsigned line, IHTMLImgElement *img, const long exp)
HRESULT hres;
hres = IHTMLImgElement_get_width(img, &found);
todo_wine ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
todo_wine ok_(__FILE__,line) (found == exp, "width=%d\n", found);
ok_(__FILE__,line) (hres == S_OK, "get_width failed: %08x\n", hres);
ok_(__FILE__,line) (found == exp, "width=%d\n", found);
}
#define test_img_put_width(o,w) _test_img_put_width(__LINE__,o,w)
......@@ -1155,7 +1155,7 @@ static void _test_img_put_width(unsigned line, IHTMLImgElement *img, const long
HRESULT hres;
hres = IHTMLImgElement_put_width(img, width);
todo_wine ok(hres == S_OK, "put_width failed: %08x\n", hres);
ok(hres == S_OK, "put_width failed: %08x\n", hres);
_test_img_width(line, img, width);
}
......
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