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

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Jacek Caban 2020-06-09 16:17:13 +02:00 committed by Alexandre Julliard
parent 276accf534
commit 77b24d25db
4 changed files with 6 additions and 5 deletions

View File

@ -10331,14 +10331,14 @@ static dispex_static_data_t HTMLW3CComputedStyle_dispex = {
CSSStyle_init_dispex_info 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; CSSStyle *style;
if(!(style = heap_alloc_zero(sizeof(*style)))) if(!(style = heap_alloc_zero(sizeof(*style))))
return E_OUTOFMEMORY; 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; *p = &style->IHTMLCSSStyleDeclaration_iface;
return S_OK; return S_OK;
} }

View File

@ -149,7 +149,7 @@ typedef enum {
} styleid_t; } styleid_t;
HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN; 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, void init_css_style(CSSStyle*,nsIDOMCSSStyleDeclaration*,style_qi_t,
dispex_static_data_t*,compat_mode_t) DECLSPEC_HIDDEN; dispex_static_data_t*,compat_mode_t) DECLSPEC_HIDDEN;

View File

@ -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); 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; return E_UNEXPECTED;
hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)&elem); hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)&elem);
@ -2356,7 +2356,7 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM
return E_FAIL; 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); nsIDOMCSSStyleDeclaration_Release(nsstyle);
return hres; return hres;
} }

View File

@ -184,6 +184,7 @@ function test_style_props() {
test_exposed("setProperty", v >= 9); test_exposed("setProperty", v >= 9);
test_exposed("removeProperty", v >= 9); test_exposed("removeProperty", v >= 9);
test_exposed("background-clip", v >= 9); test_exposed("background-clip", v >= 9);
test_exposed("transform", v >= 10);
} }
next_test(); next_test();