mshtml: Use variant_to_nsstr in IHTMLIFrameElement2::put_height.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-06-26 18:36:44 +02:00 committed by Alexandre Julliard
parent 84acd2f47e
commit 190762cbaa
2 changed files with 15 additions and 6 deletions

View File

@ -1240,15 +1240,14 @@ static HRESULT WINAPI HTMLIFrameElement2_put_height(IHTMLIFrameElement2 *iface,
HTMLIFrame *This = impl_from_IHTMLIFrameElement2(iface);
nsAString nsstr;
nsresult nsres;
HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
if(V_VT(&v) != VT_BSTR) {
FIXME("Unsupported %s\n", debugstr_variant(&v));
return E_NOTIMPL;
}
hres = variant_to_nsstr(&v, FALSE, &nsstr);
if(FAILED(hres))
return hres;
nsAString_InitDepend(&nsstr, V_BSTR(&v));
nsres = nsIDOMHTMLIFrameElement_SetHeight(This->framebase.nsiframe, &nsstr);
nsAString_Finish(&nsstr);
if(NS_FAILED(nsres)) {

View File

@ -8205,12 +8205,13 @@ static void _set_iframe_width(unsigned line, IHTMLElement *elem, const WCHAR *va
static void test_iframe_elem(IHTMLElement *elem)
{
IHTMLDocument2 *content_doc, *owner_doc;
IHTMLIFrameElement2 *iframe2;
IHTMLIFrameElement3 *iframe3;
IHTMLElementCollection *col;
IHTMLWindow2 *content_window;
IHTMLElement *body;
IDispatch *disp;
VARIANT errv;
VARIANT errv, v;
BSTR str;
HRESULT hres;
@ -8244,11 +8245,19 @@ static void test_iframe_elem(IHTMLElement *elem)
win_skip("IHTMLIFrameElement3 not supported\n");
}
iframe2 = get_iframe2_iface((IUnknown*)elem);
test_iframe_height(elem, NULL);
set_iframe_height(elem, L"100px");
set_iframe_height(elem, L"50%");
test_iframe_height(elem, L"50%");
V_VT(&v) = VT_I4;
V_I4(&v) = 100;
hres = IHTMLIFrameElement2_put_height(iframe2, v);
ok(hres == S_OK, "put_height failed: %08x\n", hres);
test_iframe_height(elem, L"100");
test_iframe_width(elem, NULL);
set_iframe_width(elem, L"150px");
set_iframe_width(elem, L"70%");
@ -8279,6 +8288,7 @@ static void test_iframe_elem(IHTMLElement *elem)
test_elem_attr(body, L"i4val", L"4");
test_elem_attr(body, L"r8val", L"3.14");
IHTMLElement_Release(body);
IHTMLIFrameElement2_Release(iframe2);
hres = IHTMLDocument2_close(content_doc);
ok(hres == S_OK, "close failed: %08x\n", hres);