diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 13319cc1576..9e68461e704 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -58,6 +58,7 @@ static REFIID tid_ids[] = { &DIID_DispHTMLElementCollection, &DIID_DispHTMLInputElement, &DIID_DispHTMLOptionElement, + &DIID_DispHTMLStyle, &DIID_DispHTMLUnknownElement, &DIID_DispHTMLWindow2, &IID_IHTMLCommentElement, @@ -74,6 +75,7 @@ static REFIID tid_ids[] = { &IID_IHTMLElementCollection, &IID_IHTMLInputElement, &IID_IHTMLOptionElement, + &IID_IHTMLStyle, &IID_IHTMLWindow2, &IID_IHTMLWindow3, &IID_IOmNavigator diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index a955a56e3ae..01aa391d147 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); typedef struct { + DispatchEx dispex; const IHTMLStyleVtbl *lpHTMLStyleVtbl; LONG ref; @@ -40,7 +41,7 @@ typedef struct { nsIDOMCSSStyleDeclaration *nsstyle; } HTMLStyle; -#define HTMLSTYLE(x) ((IHTMLStyle*) &(x)->lpHTMLStyleVtbl); +#define HTMLSTYLE(x) ((IHTMLStyle*) &(x)->lpHTMLStyleVtbl) static const WCHAR attrBackgroundColor[] = {'b','a','c','k','g','r','o','u','n','d','-','c','o','l','o','r',0}; @@ -213,6 +214,9 @@ static HRESULT WINAPI HTMLStyle_QueryInterface(IHTMLStyle *iface, REFIID riid, v }else if(IsEqualGUID(&IID_IDispatch, riid)) { TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); *ppv = HTMLSTYLE(This); + }else if(IsEqualGUID(&IID_IDispatchEx, riid)) { + TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv); + *ppv = DISPATCHEX(&This->dispex); }else if(IsEqualGUID(&IID_IHTMLStyle, riid)) { TRACE("(%p)->(IID_IHTMLStyle %p)\n", This, ppv); *ppv = HTMLSTYLE(This); @@ -1841,6 +1845,16 @@ static const IHTMLStyleVtbl HTMLStyleVtbl = { HTMLStyle_toString }; +static dispex_static_data_t HTMLStyle_dispex = { + NULL, + DispHTMLStyle_tid, + NULL, + { + IHTMLStyle_tid, + 0 + } +}; + IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle) { HTMLStyle *ret = heap_alloc(sizeof(HTMLStyle)); @@ -1851,5 +1865,7 @@ IHTMLStyle *HTMLStyle_Create(nsIDOMCSSStyleDeclaration *nsstyle) nsIDOMCSSStyleDeclaration_AddRef(nsstyle); + init_dispex(&ret->dispex, (IUnknown*)HTMLSTYLE(ret), &HTMLStyle_dispex); + return HTMLSTYLE(ret); } diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 78f7e054646..8ec04972320 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -68,6 +68,7 @@ typedef enum { DispHTMLElementCollection_tid, DispHTMLInputElement_tid, DispHTMLOptionElement_tid, + DispHTMLStyle_tid, DispHTMLUnknownElement_tid, DispHTMLWindow2_tid, IHTMLCommentElement_tid, @@ -84,6 +85,7 @@ typedef enum { IHTMLElementCollection_tid, IHTMLInputElement_tid, IHTMLOptionElement_tid, + IHTMLStyle_tid, IHTMLWindow2_tid, IHTMLWindow3_tid, IOmNavigator_tid, diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index f1c2548fc37..1039ab5ad03 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1290,6 +1290,8 @@ static void test_default_style(IHTMLStyle *style) BSTR str; HRESULT hres; + test_disp((IUnknown*)style, &DIID_DispHTMLStyle); + str = (void*)0xdeadbeef; hres = IHTMLStyle_get_fontFamily(style, &str); ok(hres == S_OK, "get_fontFamily failed: %08x\n", hres);