diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 007be6318aa..2887aec3c3b 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -53,7 +53,7 @@ static inline HRESULT get_current_style_property(HTMLCurrentStyle *current_style static inline HRESULT get_current_style_property_var(HTMLCurrentStyle *This, styleid_t sid, VARIANT *v) { - return get_nsstyle_property_var(This->nsstyle, sid, v); + return get_nsstyle_property_var(This->nsstyle, sid, COMPAT_MODE_QUIRKS, v); } static inline HTMLCurrentStyle *impl_from_IHTMLCurrentStyle(IHTMLCurrentStyle *iface) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 4ec24a3a5c2..6fc57790b23 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -685,22 +685,21 @@ HRESULT get_nsstyle_property(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, return hres; } -HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, VARIANT *p) +HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t sid, compat_mode_t compat_mode, VARIANT *p) { + unsigned flags = style_tbl[sid].flags; nsAString str_value; const PRUnichar *value; BOOL set = FALSE; - unsigned flags; HRESULT hres = S_OK; - flags = style_tbl[sid].flags; nsAString_Init(&str_value, NULL); get_nsstyle_attr_nsval(nsstyle, sid, &str_value); nsAString_GetData(&str_value, &value); - if(flags & ATTR_STR_TO_INT) { + if((flags & ATTR_STR_TO_INT) && (*value || compat_mode < COMPAT_MODE_IE9)) { const PRUnichar *ptr = value; BOOL neg = FALSE; INT i = 0; @@ -723,7 +722,7 @@ HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration *nsstyle, styleid_t s if(!set) { BSTR str; - hres = nsstyle_to_bstr(value, flags, &str); + hres = nsstyle_to_bstr(value, compat_mode < COMPAT_MODE_IE9 ? flags : 0, &str); if(SUCCEEDED(hres)) { V_VT(p) = VT_BSTR; V_BSTR(p) = str; @@ -743,7 +742,7 @@ static inline HRESULT get_style_property(HTMLStyle *This, styleid_t sid, BSTR *p static inline HRESULT get_style_property_var(HTMLStyle *This, styleid_t sid, VARIANT *v) { - return get_nsstyle_property_var(This->nsstyle, sid, v); + return get_nsstyle_property_var(This->nsstyle, sid, dispex_compat_mode(&This->dispex), v); } static HRESULT check_style_attr_value(HTMLStyle *This, styleid_t sid, LPCWSTR exval, VARIANT_BOOL *p) diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index ac0db1c36f0..59694065291 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -124,7 +124,7 @@ typedef enum { HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN; HRESULT get_nsstyle_property(nsIDOMCSSStyleDeclaration*,styleid_t,compat_mode_t,BSTR*) DECLSPEC_HIDDEN; -HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration*,styleid_t,VARIANT*) DECLSPEC_HIDDEN; +HRESULT get_nsstyle_property_var(nsIDOMCSSStyleDeclaration*,styleid_t,compat_mode_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT get_elem_style(HTMLElement*,styleid_t,BSTR*) DECLSPEC_HIDDEN; HRESULT set_elem_style(HTMLElement*,styleid_t,const WCHAR*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c index 51b44fb063d..62bebc5c27e 100644 --- a/dlls/mshtml/tests/style.c +++ b/dlls/mshtml/tests/style.c @@ -1715,9 +1715,7 @@ static void test_body_style(IHTMLStyle *style) ok(V_VT(&v) == VT_I4, "V_VT(v)=%d\n", V_VT(&v)); ok(!V_I4(&v), "V_I4(v) != 0\n"); }else { - todo_wine ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v)); - if(V_VT(&v) == VT_BSTR) todo_wine ok(!V_BSTR(&v), "zIndex = %s\n", wine_dbgstr_w(V_BSTR(&v))); } VariantClear(&v);