Jacek Caban : mshtml: Use proper compat mode in IHTMLWindow7::getComputedStyle.

Alexandre Julliard julliard at winehq.org
Tue Jun 9 15:27:48 CDT 2020


Module: wine
Branch: master
Commit: 77b24d25dbc71712ee2024301e1de090d51825ce
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=77b24d25dbc71712ee2024301e1de090d51825ce

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Jun  9 16:17:13 2020 +0200

mshtml: Use proper compat mode in IHTMLWindow7::getComputedStyle.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/htmlstyle.c           | 4 ++--
 dlls/mshtml/htmlstyle.h           | 2 +-
 dlls/mshtml/htmlwindow.c          | 4 ++--
 dlls/mshtml/tests/documentmode.js | 1 +
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index 0971b22375..6df930e19a 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -10331,14 +10331,14 @@ static dispex_static_data_t HTMLW3CComputedStyle_dispex = {
     CSSStyle_init_dispex_info
 };
 
-HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, IHTMLCSSStyleDeclaration **p)
+HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, compat_mode_t compat_mode, IHTMLCSSStyleDeclaration **p)
 {
     CSSStyle *style;
 
     if(!(style = heap_alloc_zero(sizeof(*style))))
         return E_OUTOFMEMORY;
 
-    init_css_style(style, nsstyle, NULL, &HTMLW3CComputedStyle_dispex, COMPAT_MODE_IE11);
+    init_css_style(style, nsstyle, NULL, &HTMLW3CComputedStyle_dispex, compat_mode);
     *p = &style->IHTMLCSSStyleDeclaration_iface;
     return S_OK;
 }
diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h
index f6154c9214..8746558fde 100644
--- a/dlls/mshtml/htmlstyle.h
+++ b/dlls/mshtml/htmlstyle.h
@@ -149,7 +149,7 @@ typedef enum {
 } styleid_t;
 
 HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN;
-HRESULT create_computed_style(nsIDOMCSSStyleDeclaration*,IHTMLCSSStyleDeclaration**) DECLSPEC_HIDDEN;
+HRESULT create_computed_style(nsIDOMCSSStyleDeclaration*,compat_mode_t,IHTMLCSSStyleDeclaration**) DECLSPEC_HIDDEN;
 void init_css_style(CSSStyle*,nsIDOMCSSStyleDeclaration*,style_qi_t,
                     dispex_static_data_t*,compat_mode_t) DECLSPEC_HIDDEN;
 
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index c6ec26de55..a49cd4bd59 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -2332,7 +2332,7 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM
 
     TRACE("(%p)->(%p %s %p)\n", This, node, debugstr_w(pseudo_elt), p);
 
-    if(!This->outer_window)
+    if(!This->outer_window || !This->inner_window)
         return E_UNEXPECTED;
 
     hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)&elem);
@@ -2356,7 +2356,7 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM
         return E_FAIL;
     }
 
-    hres = create_computed_style(nsstyle, p);
+    hres = create_computed_style(nsstyle, dispex_compat_mode(&This->inner_window->event_target.dispex), p);
     nsIDOMCSSStyleDeclaration_Release(nsstyle);
     return hres;
 }
diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js
index 82b163a13d..4b788c970b 100644
--- a/dlls/mshtml/tests/documentmode.js
+++ b/dlls/mshtml/tests/documentmode.js
@@ -184,6 +184,7 @@ function test_style_props() {
         test_exposed("setProperty", v >= 9);
         test_exposed("removeProperty", v >= 9);
         test_exposed("background-clip", v >= 9);
+        test_exposed("transform", v >= 10);
     }
 
     next_test();




More information about the wine-cvs mailing list