From c7da163bf33bb441c545d9bf796705e82f7989a1 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 25 Feb 2011 14:12:26 +0100 Subject: [PATCH] mshtml: Reimplement IHTMLStyle::get_backgroundPositionY using background-position property. --- dlls/mshtml/htmlstyle.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index f21ff87259..dffc39e47f 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1136,8 +1136,35 @@ static HRESULT WINAPI HTMLStyle_put_backgroundPositionY(IHTMLStyle *iface, VARIA static HRESULT WINAPI HTMLStyle_get_backgroundPositionY(IHTMLStyle *iface, VARIANT *p) { HTMLStyle *This = impl_from_IHTMLStyle(iface); + nsAString pos_str; + BSTR ret; + HRESULT hres; + TRACE("(%p)->(%p)\n", This, p); - return get_nsstyle_attr_var(This->nsstyle, STYLEID_BACKGROUND_POSITION_Y, p, 0); + + nsAString_Init(&pos_str, NULL); + hres = get_nsstyle_attr_nsval(This->nsstyle, STYLEID_BACKGROUND_POSITION, &pos_str); + if(SUCCEEDED(hres)) { + const PRUnichar *pos, *posy; + + nsAString_GetData(&pos_str, &pos); + posy = strchrW(pos, ' '); + if(posy) { + ret = SysAllocString(posy+1); + if(!ret) + hres = E_OUTOFMEMORY; + }else { + ret = NULL; + } + } + nsAString_Finish(&pos_str); + if(FAILED(hres)) + return hres; + + TRACE("returning %s\n", debugstr_w(ret)); + V_VT(p) = VT_BSTR; + V_BSTR(p) = ret; + return S_OK; } static HRESULT WINAPI HTMLStyle_put_wordSpacing(IHTMLStyle *iface, VARIANT v)