Jacek Caban : mshtml: Skip fixups in get_nsstyle_property_var in IE9+ mode.
Alexandre Julliard
julliard at winehq.org
Wed Aug 29 16:10:44 CDT 2018
Module: wine
Branch: master
Commit: 869b4477642ad85d47eabbdb1310758d97f45571
URL: https://source.winehq.org/git/wine.git/?a=commit;h=869b4477642ad85d47eabbdb1310758d97f45571
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Aug 29 14:10:33 2018 +0200
mshtml: Skip fixups in get_nsstyle_property_var in IE9+ mode.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mshtml/htmlcurstyle.c | 2 +-
dlls/mshtml/htmlstyle.c | 11 +++++------
dlls/mshtml/htmlstyle.h | 2 +-
dlls/mshtml/tests/style.c | 2 --
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c
index 007be63..2887aec 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 4ec24a3..6fc5779 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 ac0db1c..5969406 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 51b44fb..62bebc5 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);
More information about the wine-cvs
mailing list