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

mshtml: Improved IHTMLStyle3::zoom stub.

parent 76f7be04
......@@ -103,26 +103,46 @@ static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
return E_NOTIMPL;
}
static const WCHAR zoomW[] = {'z','o','o','m',0};
static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
{
HTMLStyle *This = impl_from_IHTMLStyle3(iface);
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
/* zoom property is IE CSS extension that is mostly used as a hack to workaround IE bugs.
* The value is set to 1 then. We can safely ignore setting zoom to 1. */
if(V_VT(&v) == VT_I4 && V_I4(&v) == 1)
return S_OK;
if(V_VT(&v) != VT_I4 || V_I4(&v) != 1)
WARN("stub for %s\n", debugstr_variant(&v));
FIXME("stub for %s\n", debugstr_variant(&v));
return E_NOTIMPL;
hres = dispex_get_dprop_ref(&This->dispex, zoomW, TRUE, &var);
if(FAILED(hres))
return hres;
return VariantChangeType(var, &v, 0, VT_BSTR);
}
static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
{
HTMLStyle *This = impl_from_IHTMLStyle3(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
hres = dispex_get_dprop_ref(&This->dispex, zoomW, FALSE, &var);
if(hres == DISP_E_UNKNOWNNAME) {
V_VT(p) = VT_BSTR;
V_BSTR(p) = NULL;
return S_OK;
}
if(FAILED(hres))
return hres;
return VariantCopy(p, var);
}
static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
......
......@@ -453,6 +453,7 @@ static void test_style2(IHTMLStyle2 *style2)
static void test_style3(IHTMLStyle3 *style3)
{
VARIANT v;
BSTR str;
HRESULT hres;
......@@ -471,6 +472,37 @@ static void test_style3(IHTMLStyle3 *style3)
ok(hres == S_OK, "get_wordWrap failed: %08x\n", hres);
ok(!strcmp_wa(str, "break-word"), "get_wordWrap returned %s\n", wine_dbgstr_w(str));
SysFreeString(str);
V_VT(&v) = VT_ERROR;
hres = IHTMLStyle3_get_zoom(style3, &v);
ok(hres == S_OK, "get_zoom failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(zoom) = %d\n", V_VT(&v));
ok(!V_BSTR(&v), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("100%");
hres = IHTMLStyle3_put_zoom(style3, v);
ok(hres == S_OK, "put_zoom failed: %08x\n", hres);
V_VT(&v) = VT_ERROR;
hres = IHTMLStyle3_get_zoom(style3, &v);
ok(hres == S_OK, "get_zoom failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(zoom) = %d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "100%"), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_VT(&v) = VT_I4;
V_I4(&v) = 1;
hres = IHTMLStyle3_put_zoom(style3, v);
ok(hres == S_OK, "put_zoom failed: %08x\n", hres);
V_VT(&v) = VT_ERROR;
hres = IHTMLStyle3_get_zoom(style3, &v);
ok(hres == S_OK, "get_zoom failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(zoom) = %d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "1"), "V_BSTR(zoom) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
}
static void test_style4(IHTMLStyle4 *style4)
......
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