Commit 90029d34 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

mshtml: Add DispatchEx support to HTMLImageElementFactory.

parent 9c53e8d9
......@@ -128,6 +128,7 @@ static REFIID tid_ids[] = {
&IID_IHTMLFrameBase,
&IID_IHTMLFrameBase2,
&IID_IHTMLGenericElement,
&IID_IHTMLImageElementFactory,
&IID_IHTMLImgElement,
&IID_IHTMLInputElement,
&IID_IHTMLLocation,
......
......@@ -624,13 +624,11 @@ static HRESULT WINAPI HTMLImageElementFactory_QueryInterface(IHTMLImageElementFa
if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_Unknown %p)\n", This, ppv);
*ppv = HTMLIMGFACTORY(This);
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = HTMLIMGFACTORY(This);
}else if(IsEqualGUID(&IID_IHTMLImageElementFactory, riid)) {
TRACE("(%p)->(IID_IHTMLImageElementFactory %p)\n", This, ppv);
*ppv = HTMLIMGFACTORY(This);
}
}else if(dispex_query_interface(&This->dispex, riid, ppv))
return *ppv ? S_OK : E_NOINTERFACE;
if(*ppv) {
IUnknown_AddRef((IUnknown*)*ppv);
......@@ -758,6 +756,18 @@ static const IHTMLImageElementFactoryVtbl HTMLImageElementFactoryVtbl = {
HTMLImageElementFactory_create
};
static const tid_t HTMLImageElementFactory_iface_tids[] = {
IHTMLImageElementFactory_tid,
0
};
static dispex_static_data_t HTMLImageElementFactory_dispex = {
NULL,
IHTMLImageElementFactory_tid,
NULL,
HTMLImageElementFactory_iface_tids
};
HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
{
HTMLImageElementFactory *ret;
......@@ -768,5 +778,7 @@ HTMLImageElementFactory *HTMLImageElementFactory_Create(HTMLWindow *window)
ret->ref = 1;
ret->window = window;
init_dispex(&ret->dispex, (IUnknown*)HTMLIMGFACTORY(ret), &HTMLImageElementFactory_dispex);
return ret;
}
......@@ -104,6 +104,7 @@ typedef enum {
IHTMLFrameBase_tid,
IHTMLFrameBase2_tid,
IHTMLGenericElement_tid,
IHTMLImageElementFactory_tid,
IHTMLImgElement_tid,
IHTMLInputElement_tid,
IHTMLLocation_tid,
......@@ -182,6 +183,7 @@ typedef struct {
} HTMLOptionElementFactory;
typedef struct {
DispatchEx dispex;
const IHTMLImageElementFactoryVtbl *lpHTMLImageElementFactoryVtbl;
LONG ref;
......
......@@ -342,6 +342,14 @@ static const IID * const cstyle_iids[] = {
NULL
};
static const IID * const img_factory_iids[] = {
&IID_IUnknown,
&IID_IDispatch,
&IID_IDispatchEx,
&IID_IHTMLImageElementFactory,
NULL
};
typedef struct {
const char *tag;
REFIID *iids;
......@@ -1118,6 +1126,9 @@ static IHTMLImgElement *_create_img_elem(unsigned line, IHTMLDocument2 *doc,
IHTMLWindow2_Release(window);
ok_(__FILE__,line) (hres == S_OK, "get_Image failed: %08x\n", hres);
test_ifaces((IUnknown*)factory, img_factory_iids);
test_disp((IUnknown*)factory, &IID_IHTMLImageElementFactory, "[object]");
if(wdth >= 0){
snprintf(buf, 16, "%d", wdth);
V_VT(&width) = VT_BSTR;
......
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