From: Jacek Caban jacek@codeweavers.com
Based on patch by Gabriel Ivăncescu. --- dlls/mshtml/htmlcurstyle.c | 2 +- dlls/mshtml/htmlstyle.c | 14 +++++++------- dlls/mshtml/htmlstyle.h | 4 ++-- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/tests/documentmode.js | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 7d87d965469..135b1b735ee 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -1198,7 +1198,7 @@ HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p) ret->IHTMLCurrentStyle3_iface.lpVtbl = &HTMLCurrentStyle3Vtbl; ret->IHTMLCurrentStyle4_iface.lpVtbl = &HTMLCurrentStyle4Vtbl;
- init_css_style(&ret->css_style, nsstyle, &HTMLCurrentStyle_dispex, dispex_compat_mode(&elem->node.event_target.dispex)); + init_css_style(&ret->css_style, nsstyle, &HTMLCurrentStyle_dispex, &elem->node.event_target.dispex); nsIDOMCSSStyleDeclaration_Release(nsstyle);
IHTMLElement_AddRef(&elem->IHTMLElement_iface); diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index f1e30b6872d..d916aecb420 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -2940,8 +2940,8 @@ static HRESULT WINAPI HTMLStyle_removeAttribute(IHTMLStyle *iface, BSTR strAttri DISPID dispid; unsigned i;
- hres = IWineJSDispatchHost_GetDispID(&This->css_style.dispex.IWineJSDispatchHost_iface, strAttributeName, - (lFlags&1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &dispid); + hres = dispex_get_id(&This->css_style.dispex, strAttributeName, + (lFlags & 1) ? fdexNameCaseSensitive : fdexNameCaseInsensitive, &dispid); if(hres != S_OK) { *pfSuccess = VARIANT_FALSE; return S_OK; @@ -9714,14 +9714,14 @@ static HRESULT get_style_from_elem(HTMLElement *elem, nsIDOMCSSStyleDeclaration return E_NOTIMPL; }
-void init_css_style(CSSStyle *style, nsIDOMCSSStyleDeclaration *nsstyle, dispex_static_data_t *dispex_info, compat_mode_t compat_mode) +void init_css_style(CSSStyle *style, nsIDOMCSSStyleDeclaration *nsstyle, dispex_static_data_t *dispex_info, DispatchEx *owner) { style->IHTMLCSSStyleDeclaration_iface.lpVtbl = &HTMLCSSStyleDeclarationVtbl; style->IHTMLCSSStyleDeclaration2_iface.lpVtbl = &HTMLCSSStyleDeclaration2Vtbl; style->nsstyle = nsstyle; nsIDOMCSSStyleDeclaration_AddRef(nsstyle);
- init_dispatch(&style->dispex, dispex_info, NULL, compat_mode); + init_dispatch_with_owner(&style->dispex, dispex_info, owner); }
HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret) @@ -9750,7 +9750,7 @@ HRESULT HTMLStyle_Create(HTMLElement *elem, HTMLStyle **ret) style->elem = elem; IHTMLDOMNode_AddRef(&elem->node.IHTMLDOMNode_iface);
- init_css_style(&style->css_style, nsstyle, &HTMLStyle_dispex, dispex_compat_mode(&elem->node.event_target.dispex)); + init_css_style(&style->css_style, nsstyle, &HTMLStyle_dispex, &elem->node.event_target.dispex); nsIDOMCSSStyleDeclaration_Release(nsstyle);
*ret = style; @@ -9775,14 +9775,14 @@ static dispex_static_data_t HTMLW3CComputedStyle_dispex = { CSSStyle_init_dispex_info };
-HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, compat_mode_t compat_mode, IHTMLCSSStyleDeclaration **p) +HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, DispatchEx *owner, IHTMLCSSStyleDeclaration **p) { CSSStyle *style;
if(!(style = calloc(1, sizeof(*style)))) return E_OUTOFMEMORY;
- init_css_style(style, nsstyle, &HTMLW3CComputedStyle_dispex, compat_mode); + init_css_style(style, nsstyle, &HTMLW3CComputedStyle_dispex, owner); *p = &style->IHTMLCSSStyleDeclaration_iface; return S_OK; } diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index 66509147836..b37daf95fa6 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -150,8 +150,8 @@ typedef enum { } styleid_t;
HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**); -HRESULT create_computed_style(nsIDOMCSSStyleDeclaration*,compat_mode_t,IHTMLCSSStyleDeclaration**); -void init_css_style(CSSStyle*,nsIDOMCSSStyleDeclaration*,dispex_static_data_t*,compat_mode_t); +HRESULT create_computed_style(nsIDOMCSSStyleDeclaration*,DispatchEx*,IHTMLCSSStyleDeclaration**); +void init_css_style(CSSStyle*,nsIDOMCSSStyleDeclaration*,dispex_static_data_t*,DispatchEx*);
void *CSSStyle_query_interface(DispatchEx*,REFIID); void CSSStyle_traverse(DispatchEx*,nsCycleCollectionTraversalCallback*); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 445be60fba8..52201715af8 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2429,7 +2429,7 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM return S_OK; }
- hres = create_computed_style(nsstyle, dispex_compat_mode(&This->inner_window->event_target.dispex), p); + hres = create_computed_style(nsstyle, &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 5a40f39723c..95c033f46dd 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -295,7 +295,7 @@ sync_test("builtin_toString", function() { test("childNodes", document.body.childNodes, "NodeList"); if(clientRects) test("clientRect", clientRects[0], "ClientRect"); if(clientRects) test("clientRects", clientRects, "ClientRectList"); - if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties", null, true); + if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties"); if(v >= 11 /* todo_wine */) test("document", document, v < 11 ? "Document" : "HTMLDocument"); test("elements", document.getElementsByTagName("body"), "HTMLCollection"); test("history", window.history, "History"); @@ -310,7 +310,7 @@ sync_test("builtin_toString", function() { if(v >= 11 /* todo_wine */) test("plugins", window.navigator.plugins, v < 11 ? "MSPluginsCollection" : "PluginArray"); test("screen", window.screen, "Screen"); test("sessionStorage", window.sessionStorage, "Storage"); - test("style", document.body.style, "MSStyleCSSProperties", null, true); + test("style", document.body.style, "MSStyleCSSProperties"); test("styleSheet", sheet, "CSSStyleSheet"); test("styleSheetRule", sheet.rules[0], "CSSStyleRule"); test("styleSheetRules", sheet.rules, "MSCSSRuleList"); @@ -327,7 +327,7 @@ sync_test("builtin_toString", function() { test("selection", document.selection, "MSSelection"); } if(v >= 9) { - test("computedStyle", window.getComputedStyle(e), "CSSStyleDeclaration", null, true); + test("computedStyle", window.getComputedStyle(e), "CSSStyleDeclaration"); test("doctype", document.doctype, "DocumentType");
test("Event", document.createEvent("Event"), "Event");