Commit 15db389d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Move style zoom property implementation to IHTMLCSSStyleDeclaration.

parent 153f666b
...@@ -4193,46 +4193,22 @@ static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p) ...@@ -4193,46 +4193,22 @@ static HRESULT WINAPI HTMLStyle3_get_layoutFlow(IHTMLStyle3 *iface, BSTR *p)
return E_NOTIMPL; return E_NOTIMPL;
} }
static const WCHAR zoomW[] = {'z','o','o','m',0};
static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v) static HRESULT WINAPI HTMLStyle3_put_zoom(IHTMLStyle3 *iface, VARIANT v)
{ {
HTMLStyle *This = impl_from_IHTMLStyle3(iface); HTMLStyle *This = impl_from_IHTMLStyle3(iface);
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); 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. return IHTMLCSSStyleDeclaration_put_zoom(&This->IHTMLCSSStyleDeclaration_iface, v);
* 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)
WARN("stub for %s\n", debugstr_variant(&v));
hres = dispex_get_dprop_ref(&This->css_style.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) static HRESULT WINAPI HTMLStyle3_get_zoom(IHTMLStyle3 *iface, VARIANT *p)
{ {
HTMLStyle *This = impl_from_IHTMLStyle3(iface); HTMLStyle *This = impl_from_IHTMLStyle3(iface);
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
hres = dispex_get_dprop_ref(&This->css_style.dispex, zoomW, FALSE, &var); return IHTMLCSSStyleDeclaration_get_zoom(&This->IHTMLCSSStyleDeclaration_iface, p);
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) static HRESULT WINAPI HTMLStyle3_put_wordWrap(IHTMLStyle3 *iface, BSTR v)
...@@ -6674,18 +6650,46 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_layoutFlow(IHTMLCSSStyleDeclar ...@@ -6674,18 +6650,46 @@ static HRESULT WINAPI HTMLCSSStyleDeclaration_get_layoutFlow(IHTMLCSSStyleDeclar
return E_NOTIMPL; return E_NOTIMPL;
} }
static const WCHAR zoomW[] = {'z','o','o','m',0};
static HRESULT WINAPI HTMLCSSStyleDeclaration_put_zoom(IHTMLCSSStyleDeclaration *iface, VARIANT v) static HRESULT WINAPI HTMLCSSStyleDeclaration_put_zoom(IHTMLCSSStyleDeclaration *iface, VARIANT v)
{ {
HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
return IHTMLStyle3_put_zoom(&This->IHTMLStyle3_iface, 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)
WARN("stub for %s\n", debugstr_variant(&v));
hres = dispex_get_dprop_ref(&This->css_style.dispex, zoomW, TRUE, &var);
if(FAILED(hres))
return hres;
return VariantChangeType(var, &v, 0, VT_BSTR);
} }
static HRESULT WINAPI HTMLCSSStyleDeclaration_get_zoom(IHTMLCSSStyleDeclaration *iface, VARIANT *p) static HRESULT WINAPI HTMLCSSStyleDeclaration_get_zoom(IHTMLCSSStyleDeclaration *iface, VARIANT *p)
{ {
HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface); HTMLStyle *This = impl_from_IHTMLCSSStyleDeclaration(iface);
VARIANT *var;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p); TRACE("(%p)->(%p)\n", This, p);
return IHTMLStyle3_get_zoom(&This->IHTMLStyle3_iface, p);
hres = dispex_get_dprop_ref(&This->css_style.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 HTMLCSSStyleDeclaration_put_wordWrap(IHTMLCSSStyleDeclaration *iface, BSTR v) static HRESULT WINAPI HTMLCSSStyleDeclaration_put_wordWrap(IHTMLCSSStyleDeclaration *iface, BSTR v)
......
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