Commit d2741776 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IHTMLIFrameElement::width property implementation.

parent a741a3f9
......@@ -256,15 +256,40 @@ static HRESULT WINAPI HTMLIFrameElement2_get_height(IHTMLIFrameElement2 *iface,
static HRESULT WINAPI HTMLIFrameElement2_put_width(IHTMLIFrameElement2 *iface, VARIANT v)
{
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
if(V_VT(&v) != VT_BSTR) {
FIXME("Unsupported %s\n", debugstr_variant(&v));
return E_NOTIMPL;
}
nsAString_InitDepend(&nsstr, V_BSTR(&v));
nsres = nsIDOMHTMLIFrameElement_SetWidth(This->framebase.nsiframe, &nsstr);
nsAString_Finish(&nsstr);
if(NS_FAILED(nsres)) {
ERR("SetWidth failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLIFrameElement2_get_width(IHTMLIFrameElement2 *iface, VARIANT *p)
{
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString nsstr;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&nsstr, NULL);
nsres = nsIDOMHTMLIFrameElement_GetWidth(This->framebase.nsiframe, &nsstr);
V_VT(p) = VT_BSTR;
return return_nsstr(nsres, &nsstr, &V_BSTR(p));
}
static const IHTMLIFrameElement2Vtbl HTMLIFrameElement2Vtbl = {
......
......@@ -5283,6 +5283,39 @@ static void _set_iframe_height(unsigned line, IHTMLElement *elem, const char *va
IHTMLIFrameElement2_Release(iframe);
}
#define test_iframe_width(a,b) _test_iframe_width(__LINE__,a,b)
static void _test_iframe_width(unsigned line, IHTMLElement *elem, const char *exval)
{
IHTMLIFrameElement2 *iframe = _get_iframe2_iface(line, (IUnknown*)elem);
VARIANT v;
HRESULT hres;
hres = IHTMLIFrameElement2_get_width(iframe, &v);
ok_(__FILE__,line)(hres == S_OK, "get_width failed: %08x\n", hres);
ok_(__FILE__,line)(V_VT(&v) == VT_BSTR, "V_VT(width) = %d\n", V_VT(&v));
if(exval)
ok_(__FILE__,line)(!strcmp_wa(V_BSTR(&v), exval), "width = %s, expected %s\n", wine_dbgstr_w(V_BSTR(&v)), exval);
else
ok_(__FILE__,line)(!V_BSTR(&v), "width = %s, expected NULL\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
IHTMLIFrameElement2_Release(iframe);
}
#define set_iframe_width(a,b) _set_iframe_width(__LINE__,a,b)
static void _set_iframe_width(unsigned line, IHTMLElement *elem, const char *val)
{
IHTMLIFrameElement2 *iframe = _get_iframe2_iface(line, (IUnknown*)elem);
VARIANT v;
HRESULT hres;
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr(val);
hres = IHTMLIFrameElement2_put_width(iframe, v);
ok_(__FILE__,line)(hres == S_OK, "put_width failed: %08x\n", hres);
VariantClear(&v);
IHTMLIFrameElement2_Release(iframe);
}
static void test_iframe_elem(IHTMLElement *elem)
{
IHTMLDocument2 *content_doc, *owner_doc;
......@@ -5330,6 +5363,11 @@ static void test_iframe_elem(IHTMLElement *elem)
set_iframe_height(elem, "50%");
test_iframe_height(elem, "50%");
test_iframe_width(elem, NULL);
set_iframe_width(elem, "150px");
set_iframe_width(elem, "70%");
test_iframe_width(elem, "70%");
str = a2bstr("text/html");
V_VT(&errv) = VT_ERROR;
disp = 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