Commit 3172d351 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Added IDispatchEx support to HTMLStyleSheet object.

parent 4f94913e
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
struct HTMLStyleSheet { struct HTMLStyleSheet {
DispatchEx dispex;
IHTMLStyleSheet IHTMLStyleSheet_iface; IHTMLStyleSheet IHTMLStyleSheet_iface;
LONG ref; LONG ref;
...@@ -412,6 +413,8 @@ static HRESULT WINAPI HTMLStyleSheet_QueryInterface(IHTMLStyleSheet *iface, REFI ...@@ -412,6 +413,8 @@ static HRESULT WINAPI HTMLStyleSheet_QueryInterface(IHTMLStyleSheet *iface, REFI
}else if(IsEqualGUID(&IID_IHTMLStyleSheet, riid)) { }else if(IsEqualGUID(&IID_IHTMLStyleSheet, riid)) {
TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This, ppv); TRACE("(%p)->(IID_IHTMLStyleSheet %p)\n", This, ppv);
*ppv = &This->IHTMLStyleSheet_iface; *ppv = &This->IHTMLStyleSheet_iface;
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
return *ppv ? S_OK : E_NOINTERFACE;
} }
if(*ppv) { if(*ppv) {
...@@ -449,16 +452,16 @@ static ULONG WINAPI HTMLStyleSheet_Release(IHTMLStyleSheet *iface) ...@@ -449,16 +452,16 @@ static ULONG WINAPI HTMLStyleSheet_Release(IHTMLStyleSheet *iface)
static HRESULT WINAPI HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet *iface, UINT *pctinfo) static HRESULT WINAPI HTMLStyleSheet_GetTypeInfoCount(IHTMLStyleSheet *iface, UINT *pctinfo)
{ {
HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface); HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface);
FIXME("(%p)->(%p)\n", This, pctinfo); TRACE("(%p)->(%p)\n", This, pctinfo);
return E_NOTIMPL; return IDispatchEx_GetTypeInfoCount(&This->dispex.IDispatchEx_iface, pctinfo);
} }
static HRESULT WINAPI HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet *iface, UINT iTInfo, static HRESULT WINAPI HTMLStyleSheet_GetTypeInfo(IHTMLStyleSheet *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ppTInfo)
{ {
HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface); HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface);
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
return E_NOTIMPL; return IDispatchEx_GetTypeInfo(&This->dispex.IDispatchEx_iface, iTInfo, lcid, ppTInfo);
} }
static HRESULT WINAPI HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet *iface, REFIID riid, static HRESULT WINAPI HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet *iface, REFIID riid,
...@@ -466,9 +469,8 @@ static HRESULT WINAPI HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet *iface, REFII ...@@ -466,9 +469,8 @@ static HRESULT WINAPI HTMLStyleSheet_GetIDsOfNames(IHTMLStyleSheet *iface, REFII
LCID lcid, DISPID *rgDispId) LCID lcid, DISPID *rgDispId)
{ {
HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface); HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface);
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
lcid, rgDispId); return IDispatchEx_GetIDsOfNames(&This->dispex.IDispatchEx_iface, riid, rgszNames, cNames, lcid, rgDispId);
return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLStyleSheet_Invoke(IHTMLStyleSheet *iface, DISPID dispIdMember, static HRESULT WINAPI HTMLStyleSheet_Invoke(IHTMLStyleSheet *iface, DISPID dispIdMember,
...@@ -476,9 +478,10 @@ static HRESULT WINAPI HTMLStyleSheet_Invoke(IHTMLStyleSheet *iface, DISPID dispI ...@@ -476,9 +478,10 @@ static HRESULT WINAPI HTMLStyleSheet_Invoke(IHTMLStyleSheet *iface, DISPID dispI
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{ {
HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface); HTMLStyleSheet *This = impl_from_IHTMLStyleSheet(iface);
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
return E_NOTIMPL; return IDispatchEx_Invoke(&This->dispex.IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr);
} }
static HRESULT WINAPI HTMLStyleSheet_put_title(IHTMLStyleSheet *iface, BSTR v) static HRESULT WINAPI HTMLStyleSheet_put_title(IHTMLStyleSheet *iface, BSTR v)
...@@ -676,6 +679,17 @@ static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = { ...@@ -676,6 +679,17 @@ static const IHTMLStyleSheetVtbl HTMLStyleSheetVtbl = {
HTMLStyleSheet_get_rules HTMLStyleSheet_get_rules
}; };
static const tid_t HTMLStyleSheet_iface_tids[] = {
IHTMLStyleSheet_tid,
0
};
static dispex_static_data_t HTMLStyleSheet_dispex = {
NULL,
DispHTMLStyleSheet_tid,
NULL,
HTMLStyleSheet_iface_tids
};
IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet) IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet)
{ {
HTMLStyleSheet *ret = heap_alloc(sizeof(HTMLStyleSheet)); HTMLStyleSheet *ret = heap_alloc(sizeof(HTMLStyleSheet));
...@@ -685,6 +699,8 @@ IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet) ...@@ -685,6 +699,8 @@ IHTMLStyleSheet *HTMLStyleSheet_Create(nsIDOMStyleSheet *nsstylesheet)
ret->ref = 1; ret->ref = 1;
ret->nsstylesheet = NULL; ret->nsstylesheet = NULL;
init_dispex(&ret->dispex, (IUnknown*)&ret->IHTMLStyleSheet_iface, &HTMLStyleSheet_dispex);
if(nsstylesheet) { if(nsstylesheet) {
nsres = nsIDOMStyleSheet_QueryInterface(nsstylesheet, &IID_nsIDOMCSSStyleSheet, nsres = nsIDOMStyleSheet_QueryInterface(nsstylesheet, &IID_nsIDOMCSSStyleSheet,
(void**)&ret->nsstylesheet); (void**)&ret->nsstylesheet);
......
...@@ -106,6 +106,7 @@ typedef struct event_target_t event_target_t; ...@@ -106,6 +106,7 @@ typedef struct event_target_t event_target_t;
XDIID(DispHTMLSelectElement) \ XDIID(DispHTMLSelectElement) \
XDIID(DispHTMLStyle) \ XDIID(DispHTMLStyle) \
XDIID(DispHTMLStyleElement) \ XDIID(DispHTMLStyleElement) \
XDIID(DispHTMLStyleSheet) \
XDIID(DispHTMLStyleSheetsCollection) \ XDIID(DispHTMLStyleSheetsCollection) \
XDIID(DispHTMLTable) \ XDIID(DispHTMLTable) \
XDIID(DispHTMLTableCell) \ XDIID(DispHTMLTableCell) \
...@@ -178,6 +179,7 @@ typedef struct event_target_t event_target_t; ...@@ -178,6 +179,7 @@ typedef struct event_target_t event_target_t;
XIID(IHTMLStyle5) \ XIID(IHTMLStyle5) \
XIID(IHTMLStyle6) \ XIID(IHTMLStyle6) \
XIID(IHTMLStyleElement) \ XIID(IHTMLStyleElement) \
XIID(IHTMLStyleSheet) \
XIID(IHTMLStyleSheetsCollection) \ XIID(IHTMLStyleSheetsCollection) \
XIID(IHTMLTable) \ XIID(IHTMLTable) \
XIID(IHTMLTable2) \ XIID(IHTMLTable2) \
......
...@@ -5839,6 +5839,8 @@ static void test_stylesheet(IDispatch *disp) ...@@ -5839,6 +5839,8 @@ static void test_stylesheet(IDispatch *disp)
IHTMLStyleSheet *stylesheet; IHTMLStyleSheet *stylesheet;
HRESULT hres; HRESULT hres;
test_disp2((IUnknown*)disp, &DIID_DispHTMLStyleSheet, &IID_IHTMLStyleSheet, "[object]");
hres = IDispatch_QueryInterface(disp, &IID_IHTMLStyleSheet, (void**)&stylesheet); hres = IDispatch_QueryInterface(disp, &IID_IHTMLStyleSheet, (void**)&stylesheet);
ok(hres == S_OK, "Could not get IHTMLStyleSheet: %08x\n", hres); ok(hres == S_OK, "Could not get IHTMLStyleSheet: %08x\n", hres);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment