ReactOS  0.4.13-dev-79-gcd489d8
events.c File Reference
#include "precomp.h"
#include <docobj.h>
Include dependency graph for events.c:

Go to the source code of this file.

Classes

struct  xy_test_t
 

Macros

#define DEFINE_EXPECT(func)   static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)   do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define test_disp(u, id)   _test_disp(__LINE__,u,id)
 
#define get_doc3_iface(u)   _get_doc3_iface(__LINE__,u)
 
#define get_elem_iface(u)   _get_elem_iface(__LINE__,u)
 
#define get_elem2_iface(u)   _get_elem2_iface(__LINE__,u)
 
#define get_elem3_iface(u)   _get_elem3_iface(__LINE__,u)
 
#define get_iframe_iface(u)   _get_iframe_iface(__LINE__,u)
 
#define doc_get_body(d)   _doc_get_body(__LINE__,d)
 
#define get_elem_id(d, i)   _get_elem_id(__LINE__,d,i)
 
#define test_elem_tag(u, n)   _test_elem_tag(__LINE__,u,n)
 
#define get_event_obj()   _get_event_obj(__LINE__)
 
#define elem_fire_event(a, b, c)   _elem_fire_event(__LINE__,a,b,c)
 
#define test_event_args(a, b, c, d, e, f, g)   _test_event_args(__LINE__,a,b,c,d,e,f,g)
 
#define test_attached_event_args(a, b, c, d, e)   _test_attached_event_args(__LINE__,a,b,c,d,e)
 
#define get_event_src()   _get_event_src(__LINE__)
 
#define test_event_src(t)   _test_event_src(__LINE__,t)
 
#define test_event_cancelbubble(a, b)   _test_event_cancelbubble(__LINE__,a,b)
 
#define test_event_obj(t, x)   _test_event_obj(__LINE__,t,x)
 
#define elem_attach_event(a, b, c)   _elem_attach_event(__LINE__,a,b,c)
 
#define elem_detach_event(a, b, c)   _elem_detach_event(__LINE__,a,b,c)
 
#define doc_attach_event(a, b, c)   _doc_attach_event(__LINE__,a,b,c)
 
#define doc_detach_event(a, b, c)   _doc_detach_event(__LINE__,a,b,c)
 
#define EVENT_HANDLER_FUNC_OBJ(event)
 
#define CONNECTION_POINT_OBJ(cpname, diid)
 
#define test_cp_args(a, b, c, d, e, f)   _test_cp_args(__LINE__,a,b,c,d,e,f)
 
#define test_cp_eventarg(a, b, c, d, e, f)   _test_cp_eventarg(__LINE__,a,b,c,d,e,f)
 

Typedefs

typedef void(* testfunc_t) (IHTMLDocument2 *)
 

Functions

 DEFINE_EXPECT (document_onclick)
 
 DEFINE_EXPECT (body_onclick)
 
 DEFINE_EXPECT (doc_onclick_attached)
 
 DEFINE_EXPECT (div_onclick)
 
 DEFINE_EXPECT (div_onclick_attached)
 
 DEFINE_EXPECT (timeout)
 
 DEFINE_EXPECT (doccp_onclick)
 
 DEFINE_EXPECT (doccp_onclick_cancel)
 
 DEFINE_EXPECT (div_onclick_disp)
 
 DEFINE_EXPECT (invoke_onclick)
 
 DEFINE_EXPECT (iframe_onreadystatechange_loading)
 
 DEFINE_EXPECT (iframe_onreadystatechange_interactive)
 
 DEFINE_EXPECT (iframe_onreadystatechange_complete)
 
 DEFINE_EXPECT (iframedoc_onreadystatechange)
 
 DEFINE_EXPECT (img_onload)
 
 DEFINE_EXPECT (img_onerror)
 
 DEFINE_EXPECT (input_onfocus)
 
 DEFINE_EXPECT (input_onblur)
 
 DEFINE_EXPECT (form_onsubmit)
 
 DEFINE_EXPECT (form_onclick)
 
 DEFINE_EXPECT (submit_onclick)
 
 DEFINE_EXPECT (submit_onclick_cancel)
 
 DEFINE_EXPECT (submit_onclick_attached)
 
 DEFINE_EXPECT (submit_onclick_attached_check_cancel)
 
 DEFINE_EXPECT (submit_onclick_setret)
 
 DEFINE_EXPECT (elem2_cp_onclick)
 
 DEFINE_EXPECT (iframe_onload)
 
static int strcmp_wa (LPCWSTR strw, const char *stra)
 
static BSTR a2bstr (const char *str)
 
static BOOL iface_cmp (IUnknown *iface1, IUnknown *iface2)
 
static void _test_disp (unsigned line, IUnknown *unk, const IID *diid)
 
static IHTMLDocument3 * _get_doc3_iface (unsigned line, IUnknown *unk)
 
static IHTMLElement * _get_elem_iface (unsigned line, IUnknown *unk)
 
static IHTMLElement2 * _get_elem2_iface (unsigned line, IUnknown *unk)
 
static IHTMLElement3 * _get_elem3_iface (unsigned line, IUnknown *unk)
 
static IHTMLIFrameElement * _get_iframe_iface (unsigned line, IUnknown *unk)
 
static IHTMLElement * _doc_get_body (unsigned line, IHTMLDocument2 *doc)
 
static IHTMLElement * _get_elem_id (unsigned line, IHTMLDocument2 *doc, const char *id)
 
static void _test_elem_tag (unsigned line, IUnknown *unk, const char *extag)
 
static IHTMLEventObj * _get_event_obj (unsigned line)
 
static void _elem_fire_event (unsigned line, IUnknown *unk, const char *event, VARIANT *evobj)
 
static void _test_event_args (unsigned line, const IID *dispiid, DISPID id, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static void _test_attached_event_args (unsigned line, DISPID id, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei)
 
static IHTMLElement * _get_event_src (unsigned line)
 
static void _test_event_src (unsigned line, const char *src_tag)
 
static void _test_event_altkey (unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
 
static void _test_event_ctrlkey (unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
 
static void _test_event_shiftkey (unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
 
static void _test_event_cancelbubble (unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
 
static void _test_event_fromelem (unsigned line, IHTMLEventObj *event, const char *from_tag)
 
static void _test_event_toelem (unsigned line, IHTMLEventObj *event, const char *to_tag)
 
static void _test_event_keycode (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_button (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_reason (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_x (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_y (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_clientx (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_clienty (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_offsetx (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_offsety (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_screenx (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_screeny (unsigned line, IHTMLEventObj *event, LONG exl)
 
static void _test_event_type (unsigned line, IHTMLEventObj *event, const char *exstr)
 
static void _test_event_qualifier (unsigned line, IHTMLEventObj *event, const char *exstr)
 
static void _test_event_srcfilter (unsigned line, IHTMLEventObj *event)
 
static void _test_event_obj (unsigned line, const char *type, const xy_test_t *xy)
 
static void _elem_attach_event (unsigned line, IUnknown *unk, const char *namea, IDispatch *disp)
 
static void _elem_detach_event (unsigned line, IUnknown *unk, const char *namea, IDispatch *disp)
 
static void _doc_attach_event (unsigned line, IHTMLDocument2 *doc, const char *namea, IDispatch *disp)
 
static void _doc_detach_event (unsigned line, IHTMLDocument2 *doc, const char *namea, IDispatch *disp)
 
static HRESULT WINAPI DispatchEx_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI Dispatch_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DispatchEx_AddRef (IDispatchEx *iface)
 
static ULONG WINAPI DispatchEx_Release (IDispatchEx *iface)
 
static HRESULT WINAPI DispatchEx_GetTypeInfoCount (IDispatchEx *iface, UINT *pctinfo)
 
static HRESULT WINAPI DispatchEx_GetTypeInfo (IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI DispatchEx_GetIDsOfNames (IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI DispatchEx_Invoke (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI DispatchEx_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI DispatchEx_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI DispatchEx_DeleteMemberByName (IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
 
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID (IDispatchEx *iface, DISPID id)
 
static HRESULT WINAPI DispatchEx_GetMemberProperties (IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
 
static HRESULT WINAPI DispatchEx_GetMemberName (IDispatchEx *iface, DISPID id, BSTR *pbstrName)
 
static HRESULT WINAPI DispatchEx_GetNextDispID (IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
 
static HRESULT WINAPI DispatchEx_GetNameSpaceParent (IDispatchEx *iface, IUnknown **ppunk)
 
static HRESULT WINAPI document_onclick (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (document_onclick)
 
static HRESULT WINAPI div_onclick (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (div_onclick)
 
static HRESULT WINAPI div_onclick_attached (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (div_onclick_attached)
 
static HRESULT WINAPI doc_onclick_attached (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (doc_onclick_attached)
 
static HRESULT WINAPI body_onclick (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (body_onclick)
 
static HRESULT WINAPI img_onload (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (img_onload)
 
static HRESULT WINAPI img_onerror (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (img_onerror)
 
static HRESULT WINAPI input_onfocus (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (input_onfocus)
 
static HRESULT WINAPI input_onblur (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (input_onblur)
 
static HRESULT WINAPI form_onsubmit (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (form_onsubmit)
 
static HRESULT WINAPI form_onclick (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (form_onclick)
 
static HRESULT WINAPI submit_onclick (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (submit_onclick)
 
static HRESULT WINAPI iframe_onload (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (iframe_onload)
 
static HRESULT WINAPI submit_onclick_attached (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (submit_onclick_attached)
 
static HRESULT WINAPI submit_onclick_attached_check_cancel (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (submit_onclick_attached_check_cancel)
 
static HRESULT WINAPI submit_onclick_setret (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (submit_onclick_setret)
 
static HRESULT WINAPI submit_onclick_cancel (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (submit_onclick_cancel)
 
static HRESULT WINAPI iframedoc_onreadystatechange (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (iframedoc_onreadystatechange)
 
static HRESULT WINAPI iframe_onreadystatechange (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (iframe_onreadystatechange)
 
static HRESULT WINAPI nocall (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
 EVENT_HANDLER_FUNC_OBJ (nocall)
 
static void _test_cp_args (unsigned line, REFIID riid, WORD flags, DISPPARAMS *dp, VARIANT *vres, EXCEPINFO *ei, UINT *argerr)
 
static void _test_cp_eventarg (unsigned line, REFIID riid, WORD flags, DISPPARAMS *dp, VARIANT *vres, EXCEPINFO *ei, UINT *argerr)
 
static HRESULT WINAPI doccp (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
 
 CONNECTION_POINT_OBJ (doccp, DIID_HTMLDocumentEvents)
 
static HRESULT WINAPI doccp_onclick_cancel (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
 
 CONNECTION_POINT_OBJ (doccp_onclick_cancel, DIID_HTMLDocumentEvents)
 
static HRESULT WINAPI elem2_cp (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
 
 CONNECTION_POINT_OBJ (elem2_cp, DIID_HTMLElementEvents2)
 
static HRESULT WINAPI timeoutFunc_Invoke (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI div_onclick_disp_Invoke (IDispatchEx *iface, DISPID id, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, UINT *puArgErr)
 
static void pump_msgs (BOOL *b)
 
static IConnectionPointget_cp (IUnknown *unk, REFIID riid)
 
static DWORD register_cp (IUnknown *unk, REFIID riid, IUnknown *sink)
 
static void unregister_cp (IUnknown *unk, REFIID riid, DWORD cookie)
 
static HRESULT WINAPI EventDispatch_QueryInterface (IDispatch *iface, REFIID riid, void **ppv)
 
static DWORD WINAPI EventDispatch_AddRef (IDispatch *iface)
 
static DWORD WINAPI EventDispatch_Release (IDispatch *iface)
 
static HRESULT WINAPI EventDispatch_GetTypeInfoCount (IDispatch *iface, UINT *pctinfo)
 
static HRESULT WINAPI EventDispatch_GetTypeInfo (IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI EventDispatch_GetIDsOfNames (IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI EventDispatch_Invoke (IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static void test_onclick (IHTMLDocument2 *doc)
 
static void test_onreadystatechange (IHTMLDocument2 *doc)
 
static void test_imgload (IHTMLDocument2 *doc)
 
static void test_focus (IHTMLDocument2 *doc)
 
static void test_submit (IHTMLDocument2 *doc)
 
static void test_timeout (IHTMLDocument2 *doc)
 
static IHTMLElement * find_element_by_id (IHTMLDocument2 *doc, const char *id)
 
static IHTMLDocument2 * get_iframe_doc (IHTMLIFrameElement *iframe)
 
static void test_iframe_connections (IHTMLDocument2 *doc)
 
static HRESULT QueryInterface (REFIID, void **)
 
static HRESULT WINAPI InPlaceFrame_QueryInterface (IOleInPlaceFrame *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InPlaceFrame_AddRef (IOleInPlaceFrame *iface)
 
static ULONG WINAPI InPlaceFrame_Release (IOleInPlaceFrame *iface)
 
static HRESULT WINAPI InPlaceFrame_GetWindow (IOleInPlaceFrame *iface, HWND *phwnd)
 
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp (IOleInPlaceFrame *iface, BOOL fEnterMode)
 
static HRESULT WINAPI InPlaceFrame_GetBorder (IOleInPlaceFrame *iface, LPRECT lprectBorder)
 
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace (IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
 
static HRESULT WINAPI InPlaceFrame_SetBorderSpace (IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
 
static HRESULT WINAPI InPlaceUIWindow_SetActiveObject (IOleInPlaceFrame *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
 
static HRESULT WINAPI InPlaceFrame_SetActiveObject (IOleInPlaceFrame *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
 
static HRESULT WINAPI InPlaceFrame_InsertMenus (IOleInPlaceFrame *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
 
static HRESULT WINAPI InPlaceFrame_SetMenu (IOleInPlaceFrame *iface, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)
 
static HRESULT WINAPI InPlaceFrame_RemoveMenus (IOleInPlaceFrame *iface, HMENU hmenuShared)
 
static HRESULT WINAPI InPlaceFrame_SetStatusText (IOleInPlaceFrame *iface, LPCOLESTR pszStatusText)
 
static HRESULT WINAPI InPlaceFrame_EnableModeless (IOleInPlaceFrame *iface, BOOL fEnable)
 
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator (IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID)
 
static HRESULT WINAPI InPlaceSite_QueryInterface (IOleInPlaceSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InPlaceSite_AddRef (IOleInPlaceSite *iface)
 
static ULONG WINAPI InPlaceSite_Release (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_GetWindow (IOleInPlaceSite *iface, HWND *phwnd)
 
static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp (IOleInPlaceSite *iface, BOOL fEnterMode)
 
static HRESULT WINAPI InPlaceSite_CanInPlaceActivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_OnInPlaceActivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_OnUIActivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_GetWindowContext (IOleInPlaceSite *iface, IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 
static HRESULT WINAPI InPlaceSite_Scroll (IOleInPlaceSite *iface, SIZE scrollExtant)
 
static HRESULT WINAPI InPlaceSite_OnUIDeactivate (IOleInPlaceSite *iface, BOOL fUndoable)
 
static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_DiscardUndoState (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_DeactivateAndUndo (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_OnPosRectChange (IOleInPlaceSite *iface, LPCRECT lprcPosRect)
 
static HRESULT WINAPI ClientSite_QueryInterface (IOleClientSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClientSite_AddRef (IOleClientSite *iface)
 
static ULONG WINAPI ClientSite_Release (IOleClientSite *iface)
 
static HRESULT WINAPI ClientSite_SaveObject (IOleClientSite *iface)
 
static HRESULT WINAPI ClientSite_GetMoniker (IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmon)
 
static HRESULT WINAPI ClientSite_GetContainer (IOleClientSite *iface, IOleContainer **ppContainer)
 
static HRESULT WINAPI ClientSite_ShowObject (IOleClientSite *iface)
 
static HRESULT WINAPI ClientSite_OnShowWindow (IOleClientSite *iface, BOOL fShow)
 
static HRESULT WINAPI ClientSite_RequestNewObjectLayout (IOleClientSite *iface)
 
static HRESULT WINAPI DocumentSite_QueryInterface (IOleDocumentSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DocumentSite_AddRef (IOleDocumentSite *iface)
 
static ULONG WINAPI DocumentSite_Release (IOleDocumentSite *iface)
 
static HRESULT WINAPI DocumentSite_ActivateMe (IOleDocumentSite *iface, IOleDocumentView *pViewToActivate)
 
static HRESULT WINAPI PropertyNotifySink_QueryInterface (IPropertyNotifySink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PropertyNotifySink_AddRef (IPropertyNotifySink *iface)
 
static ULONG WINAPI PropertyNotifySink_Release (IPropertyNotifySink *iface)
 
static HRESULT WINAPI PropertyNotifySink_OnChanged (IPropertyNotifySink *iface, DISPID dispID)
 
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit (IPropertyNotifySink *iface, DISPID dispID)
 
static void doc_load_string (IHTMLDocument2 *doc, const char *str)
 
static void do_advise (IUnknown *unk, REFIID riid, IUnknown *unk_advise)
 
static void set_client_site (IHTMLDocument2 *doc, BOOL set)
 
static IHTMLDocument2 * create_document (void)
 
static void run_test (const char *str, testfunc_t test)
 
static LRESULT WINAPI wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static HWND create_container_window (void)
 
static void test_empty_document (void)
 
static BOOL check_ie (void)
 
 START_TEST (events)
 

Variables

static HWND container_hwnd = NULL
 
static IHTMLWindow2window
 
static IOleDocumentViewview
 
static BOOL is_ie9plus
 
static const xy_test_t no_xy = {-10,-10,-10,-10}
 
static const char empty_doc_str []
 
static const char click_doc_str []
 
static const char readystate_doc_str []
 
static const char img_doc_str []
 
static const char input_doc_str []
 
static const char iframe_doc_str []
 
static const char form_doc_str []
 
static VARIANT onclick_retval
 
static VARIANT onclick_event_retval
 
static const IDispatchExVtbl timeoutFuncVtbl
 
static IDispatchEx timeoutFunc = { &timeoutFuncVtbl }
 
static const IDispatchExVtbl div_onclick_dispVtbl
 
static IDispatchEx div_onclick_disp = { &div_onclick_dispVtbl }
 
static const IDispatchVtbl EventDispatchVtbl
 
static IDispatch EventDispatch = { &EventDispatchVtbl }
 
static const IOleInPlaceFrameVtbl InPlaceFrameVtbl
 
static IOleInPlaceFrame InPlaceFrame = { &InPlaceFrameVtbl }
 
static const IOleInPlaceFrameVtbl InPlaceUIWindowVtbl
 
static IOleInPlaceFrame InPlaceUIWindow = { &InPlaceUIWindowVtbl }
 
static const IOleInPlaceSiteVtbl InPlaceSiteVtbl
 
static IOleInPlaceSite InPlaceSite = { &InPlaceSiteVtbl }
 
static const IOleClientSiteVtbl ClientSiteVtbl
 
static IOleClientSite ClientSite = { &ClientSiteVtbl }
 
static const IOleDocumentSiteVtbl DocumentSiteVtbl
 
static IOleDocumentSite DocumentSite = { &DocumentSiteVtbl }
 
static IHTMLDocument2 * notif_doc
 
static BOOL doc_complete
 
static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
 
static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl }
 

Macro Definition Documentation

◆ CHECK_CALLED

#define CHECK_CALLED (   func)
Value:
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 42 of file events.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

Definition at line 36 of file events.c.

◆ CHECK_EXPECT2

#define CHECK_EXPECT2 (   func)
Value:
do { \
trace(#func "\n"); \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

Definition at line 29 of file events.c.

◆ CONNECTION_POINT_OBJ

#define CONNECTION_POINT_OBJ (   cpname,
  diid 
)

Definition at line 1204 of file events.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 23 of file events.c.

◆ doc_attach_event

#define doc_attach_event (   a,
  b,
  c 
)    _doc_attach_event(__LINE__,a,b,c)

Definition at line 681 of file events.c.

◆ doc_detach_event

#define doc_detach_event (   a,
  b,
  c 
)    _doc_detach_event(__LINE__,a,b,c)

Definition at line 697 of file events.c.

◆ doc_get_body

#define doc_get_body (   d)    _doc_get_body(__LINE__,d)

Definition at line 246 of file events.c.

◆ elem_attach_event

#define elem_attach_event (   a,
  b,
  c 
)    _elem_attach_event(__LINE__,a,b,c)

Definition at line 651 of file events.c.

◆ elem_detach_event

#define elem_detach_event (   a,
  b,
  c 
)    _elem_detach_event(__LINE__,a,b,c)

Definition at line 667 of file events.c.

◆ elem_fire_event

#define elem_fire_event (   a,
  b,
  c 
)    _elem_fire_event(__LINE__,a,b,c)

Definition at line 305 of file events.c.

◆ EVENT_HANDLER_FUNC_OBJ

#define EVENT_HANDLER_FUNC_OBJ (   event)
Value:
static IDispatchExVtbl event ## FuncVtbl = { \
DispatchEx_QueryInterface, \
DispatchEx_AddRef, \
DispatchEx_Release, \
DispatchEx_GetTypeInfoCount, \
DispatchEx_GetTypeInfo, \
DispatchEx_GetIDsOfNames, \
DispatchEx_Invoke, \
DispatchEx_GetDispID, \
event, \
DispatchEx_DeleteMemberByName, \
DispatchEx_DeleteMemberByDispID, \
DispatchEx_GetMemberProperties, \
DispatchEx_GetMemberName, \
DispatchEx_GetNextDispID, \
DispatchEx_GetNameSpaceParent \
}; \
static IDispatchEx event ## _obj = { &event ## FuncVtbl };

Definition at line 832 of file events.c.

◆ get_doc3_iface

#define get_doc3_iface (   u)    _get_doc3_iface(__LINE__,u)

Definition at line 186 of file events.c.

◆ get_elem2_iface

#define get_elem2_iface (   u)    _get_elem2_iface(__LINE__,u)

Definition at line 210 of file events.c.

◆ get_elem3_iface

#define get_elem3_iface (   u)    _get_elem3_iface(__LINE__,u)

Definition at line 222 of file events.c.

◆ get_elem_id

#define get_elem_id (   d,
  i 
)    _get_elem_id(__LINE__,d,i)

Definition at line 259 of file events.c.

◆ get_elem_iface

#define get_elem_iface (   u)    _get_elem_iface(__LINE__,u)

Definition at line 198 of file events.c.

◆ get_event_obj

#define get_event_obj ( )    _get_event_obj(__LINE__)

Definition at line 291 of file events.c.

◆ get_event_src

#define get_event_src ( )    _get_event_src(__LINE__)

Definition at line 365 of file events.c.

◆ get_iframe_iface

#define get_iframe_iface (   u)    _get_iframe_iface(__LINE__,u)

Definition at line 234 of file events.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)    do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)

Definition at line 26 of file events.c.

◆ test_attached_event_args

#define test_attached_event_args (   a,
  b,
  c,
  d,
  e 
)    _test_attached_event_args(__LINE__,a,b,c,d,e)

Definition at line 341 of file events.c.

◆ test_cp_args

#define test_cp_args (   a,
  b,
  c,
  d,
  e,
  f 
)    _test_cp_args(__LINE__,a,b,c,d,e,f)

Definition at line 1237 of file events.c.

◆ test_cp_eventarg

#define test_cp_eventarg (   a,
  b,
  c,
  d,
  e,
  f 
)    _test_cp_eventarg(__LINE__,a,b,c,d,e,f)

Definition at line 1253 of file events.c.

◆ test_disp

#define test_disp (   u,
  id 
)    _test_disp(__LINE__,u,id)

Definition at line 150 of file events.c.

◆ test_elem_tag

#define test_elem_tag (   u,
  n 
)    _test_elem_tag(__LINE__,u,n)

Definition at line 276 of file events.c.

◆ test_event_args

#define test_event_args (   a,
  b,
  c,
  d,
  e,
  f,
  g 
)    _test_event_args(__LINE__,a,b,c,d,e,f,g)

Definition at line 321 of file events.c.

◆ test_event_cancelbubble

#define test_event_cancelbubble (   a,
  b 
)    _test_event_cancelbubble(__LINE__,a,b)

Definition at line 423 of file events.c.

◆ test_event_obj

#define test_event_obj (   t,
  x 
)    _test_event_obj(__LINE__,t,x)

Definition at line 615 of file events.c.

◆ test_event_src

#define test_event_src (   t)    _test_event_src(__LINE__,t)

Definition at line 379 of file events.c.

Typedef Documentation

◆ testfunc_t

typedef void(* testfunc_t) (IHTMLDocument2 *)

Definition at line 2746 of file events.c.

Function Documentation

◆ _doc_attach_event()

static void _doc_attach_event ( unsigned  line,
IHTMLDocument2 *  doc,
const char namea,
IDispatch disp 
)
static

Definition at line 682 of file events.c.

683 {
684  IHTMLDocument3 *doc3 = _get_doc3_iface(line, (IUnknown*)doc);
686  BSTR name;
687  HRESULT hres;
688 
689  name = a2bstr(namea);
690  hres = IHTMLDocument3_attachEvent(doc3, name, disp, &res);
691  IHTMLDocument3_Release(doc3);
693  ok_(__FILE__,line)(hres == S_OK, "attachEvent failed: %08x\n", hres);
694  ok_(__FILE__,line)(res == VARIANT_TRUE, "attachEvent returned %x\n", res);
695 }
disp
Definition: i386-dis.c:3181
#define ok_(x1, x2)
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
static IHTMLDocument3 * _get_doc3_iface(unsigned line, IUnknown *unk)
Definition: events.c:187
short VARIANT_BOOL
Definition: compat.h:1931
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
Definition: name.c:36
GLuint res
Definition: glext.h:9613
GLuint const GLchar * name
Definition: glext.h:6031

◆ _doc_detach_event()

static void _doc_detach_event ( unsigned  line,
IHTMLDocument2 *  doc,
const char namea,
IDispatch disp 
)
static

Definition at line 698 of file events.c.

699 {
700  IHTMLDocument3 *doc3 = _get_doc3_iface(line, (IUnknown*)doc);
701  BSTR name;
702  HRESULT hres;
703 
704  name = a2bstr(namea);
705  hres = IHTMLDocument3_detachEvent(doc3, name, disp);
706  IHTMLDocument3_Release(doc3);
708  ok_(__FILE__,line)(hres == S_OK, "detachEvent failed: %08x\n", hres);
709 }
disp
Definition: i386-dis.c:3181
#define ok_(x1, x2)
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
static IHTMLDocument3 * _get_doc3_iface(unsigned line, IUnknown *unk)
Definition: events.c:187
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
Definition: name.c:36
GLuint const GLchar * name
Definition: glext.h:6031

◆ _doc_get_body()

static IHTMLElement* _doc_get_body ( unsigned  line,
IHTMLDocument2 *  doc 
)
static

Definition at line 247 of file events.c.

248 {
249  IHTMLElement *body = NULL;
250  HRESULT hres;
251 
252  hres = IHTMLDocument2_get_body(doc, &body);
253  ok_(__FILE__,line) (hres == S_OK, "get_body failed: %08x\n", hres);
254  ok_(__FILE__,line) (body != NULL, "body == NULL\n");
255 
256  return body;
257 }
#define ok_(x1, x2)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100

◆ _elem_attach_event()

static void _elem_attach_event ( unsigned  line,
IUnknown unk,
const char namea,
IDispatch disp 
)
static

Definition at line 652 of file events.c.

653 {
654  IHTMLElement2 *elem = _get_elem2_iface(line, unk);
656  BSTR name;
657  HRESULT hres;
658 
659  name = a2bstr(namea);
660  hres = IHTMLElement2_attachEvent(elem, name, disp, &res);
661  IHTMLElement2_Release(elem);
663  ok_(__FILE__,line)(hres == S_OK, "attachEvent failed: %08x\n", hres);
664  ok_(__FILE__,line)(res == VARIANT_TRUE, "attachEvent returned %x\n", res);
665 }
disp
Definition: i386-dis.c:3181
#define ok_(x1, x2)
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
short VARIANT_BOOL
Definition: compat.h:1931
static size_t elem
Definition: string.c:68
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static IHTMLElement2 * _get_elem2_iface(unsigned line, IUnknown *unk)
Definition: events.c:211
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
Definition: name.c:36
GLuint res
Definition: glext.h:9613
GLuint const GLchar * name
Definition: glext.h:6031

◆ _elem_detach_event()

static void _elem_detach_event ( unsigned  line,
IUnknown unk,
const char namea,
IDispatch disp 
)
static

Definition at line 668 of file events.c.

669 {
670  IHTMLElement2 *elem = _get_elem2_iface(line, unk);
671  BSTR name;
672  HRESULT hres;
673 
674  name = a2bstr(namea);
675  hres = IHTMLElement2_detachEvent(elem, name, disp);
676  IHTMLElement2_Release(elem);
678  ok_(__FILE__,line)(hres == S_OK, "detachEvent failed: %08x\n", hres);
679 }
disp
Definition: i386-dis.c:3181
#define ok_(x1, x2)
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
static size_t elem
Definition: string.c:68
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static IHTMLElement2 * _get_elem2_iface(unsigned line, IUnknown *unk)
Definition: events.c:211
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
Definition: name.c:36
GLuint const GLchar * name
Definition: glext.h:6031

◆ _elem_fire_event()

static void _elem_fire_event ( unsigned  line,
IUnknown unk,
const char event,
VARIANT evobj 
)
static

Definition at line 306 of file events.c.

307 {
308  IHTMLElement3 *elem3 = _get_elem3_iface(line, unk);
309  VARIANT_BOOL b;
310  BSTR str;
311  HRESULT hres;
312 
313  b = 100;
314  str = a2bstr(event);
315  hres = IHTMLElement3_fireEvent(elem3, str, evobj, &b);
317  ok_(__FILE__,line)(hres == S_OK, "fireEvent failed: %08x\n", hres);
318  ok_(__FILE__,line)(b == VARIANT_TRUE, "fireEvent returned %x\n", b);
319 }
static IHTMLElement3 * _get_elem3_iface(unsigned line, IUnknown *unk)
Definition: events.c:223
#define ok_(x1, x2)
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
short VARIANT_BOOL
Definition: compat.h:1931
const WCHAR * str
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274

◆ _get_doc3_iface()

static IHTMLDocument3* _get_doc3_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 187 of file events.c.

188 {
189  IHTMLDocument3 *doc3;
190  HRESULT hres;
191 
192  hres = IUnknown_QueryInterface(unk, &IID_IHTMLDocument3, (void**)&doc3);
193  ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLDocument3 iface: %08x\n", hres);
194 
195  return doc3;
196 }
#define ok_(x1, x2)
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

Referenced by _doc_attach_event(), _doc_detach_event(), and _get_elem_id().

◆ _get_elem2_iface()

static IHTMLElement2* _get_elem2_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 211 of file events.c.

212 {
213  IHTMLElement2 *elem2;
214  HRESULT hres;
215 
216  hres = IUnknown_QueryInterface(unk, &IID_IHTMLElement2, (void**)&elem2);
217  ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement2 iface: %08x\n", hres);
218 
219  return elem2;
220 }
#define ok_(x1, x2)
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

Referenced by _elem_attach_event(), and _elem_detach_event().

◆ _get_elem3_iface()

static IHTMLElement3* _get_elem3_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 223 of file events.c.

224 {
225  IHTMLElement3 *elem3;
226  HRESULT hres;
227 
228  hres = IUnknown_QueryInterface(unk, &IID_IHTMLElement3, (void**)&elem3);
229  ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement3 iface: %08x\n", hres);
230 
231  return elem3;
232 }
#define ok_(x1, x2)
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

Referenced by _elem_fire_event().

◆ _get_elem_id()

static IHTMLElement* _get_elem_id ( unsigned  line,
IHTMLDocument2 *  doc,
const char id 
)
static

Definition at line 260 of file events.c.

261 {
262  IHTMLDocument3 *doc3 = _get_doc3_iface(line, (IUnknown*)doc);
263  IHTMLElement *elem;
264  BSTR str;
265  HRESULT hres;
266 
267  str = a2bstr(id);
268  hres = IHTMLDocument3_getElementById(doc3, str, &elem);
270  IHTMLDocument3_Release(doc3);
271  ok_(__FILE__,line) (hres == S_OK, "getElementById failed: %08x\n", hres);
272 
273  return elem;
274 }
#define ok_(x1, x2)
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
static IHTMLDocument3 * _get_doc3_iface(unsigned line, IUnknown *unk)
Definition: events.c:187
static size_t elem
Definition: string.c:68
const WCHAR * str
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274

◆ _get_elem_iface()

static IHTMLElement* _get_elem_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 199 of file events.c.

200 {
201  IHTMLElement *elem;
202  HRESULT hres;
203 
204  hres = IUnknown_QueryInterface(unk, &IID_IHTMLElement, (void**)&elem);
205  ok_(__FILE__,line) (hres == S_OK, "Could not get IHTMLElement iface: %08x\n", hres);
206 
207  return elem;
208 }
#define ok_(x1, x2)
static size_t elem
Definition: string.c:68
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

Referenced by _test_elem_tag().

◆ _get_event_obj()

static IHTMLEventObj* _get_event_obj ( unsigned  line)
static

Definition at line 292 of file events.c.

293 {
294  IHTMLEventObj *event = NULL;
295  HRESULT hres;
296 
297  hres = IHTMLWindow2_get_event(window, &event);
298  ok_(__FILE__,line) (hres == S_OK, "get_event failed: %08x\n", hres);
299  ok_(__FILE__,line) (event != NULL, "event = NULL\n");
300  _test_disp(line, (IUnknown*)event, &DIID_DispCEventObj);
301 
302  return event;
303 }
#define ok_(x1, x2)
static void _test_disp(unsigned line, IUnknown *unk, const IID *diid)
Definition: events.c:151
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static IHTMLWindow2 * window
Definition: events.c:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _get_event_src(), _test_attached_event_args(), _test_cp_eventarg(), and _test_event_obj().

◆ _get_event_src()

static IHTMLElement* _get_event_src ( unsigned  line)
static

Definition at line 366 of file events.c.

367 {
368  IHTMLEventObj *event = _get_event_obj(line);
369  IHTMLElement *src_elem = NULL;
370  HRESULT hres;
371 
372  hres = IHTMLEventObj_get_srcElement(event, &src_elem);
373  IHTMLEventObj_Release(event);
374  ok_(__FILE__,line) (hres == S_OK, "get_srcElement failed: %08x\n", hres);
375 
376  return src_elem;
377 }
#define ok_(x1, x2)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
static IHTMLEventObj * _get_event_obj(unsigned line)
Definition: events.c:292
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_src().

◆ _get_iframe_iface()

static IHTMLIFrameElement* _get_iframe_iface ( unsigned  line,
IUnknown unk 
)
static

Definition at line 235 of file events.c.

236 {
237  IHTMLIFrameElement *iframe;
238  HRESULT hres;
239 
240  hres = IUnknown_QueryInterface(unk, &IID_IHTMLIFrameElement, (void**)&iframe);
241  ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IHTMLIFrameElement) failed: %08x\n", hres);
242 
243  return iframe;
244 }
#define ok_(x1, x2)
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

◆ _test_attached_event_args()

static void _test_attached_event_args ( unsigned  line,
DISPID  id,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei 
)
static

Definition at line 342 of file events.c.

344 {
345  IHTMLEventObj *event;
346 
347  ok(id == DISPID_VALUE, "id = %d\n", id);
348  ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
349  ok(pdp != NULL, "pDispParams == NULL\n");
350  ok(pdp->cArgs == 1, "pdp->cArgs = %d\n", pdp->cArgs);
351  ok(!pdp->cNamedArgs, "pdp->cNamedArgs = %d\n", pdp->cNamedArgs);
352  ok(!pdp->rgdispidNamedArgs, "pdp->rgdispidNamedArgs = %p\n", pdp->rgdispidNamedArgs);
353  ok(pdp->rgvarg != NULL, "rgvarg = NULL\n");
354  ok(pvarRes != NULL, "pvarRes = NULL\n");
355  ok(pei != NULL, "pei = NULL\n");
356  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pVarRes) = %d\n", V_VT(pvarRes));
357  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
358  ok(V_DISPATCH(pdp->rgvarg) != NULL, "V_DISPATCH(pdp->rgvarg) = %p\n", V_DISPATCH(pdp->rgvarg));
359 
360  event = _get_event_obj(line);
361  ok(iface_cmp((IUnknown*)event, (IUnknown*)V_DISPATCH(pdp->rgvarg)), "event != arg0\n");
362  IHTMLEventObj_Release(event);
363 }
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
Definition: events.c:135
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define V_VT(A)
Definition: oleauto.h:211
struct _cl_event * event
Definition: glext.h:7739
static IHTMLEventObj * _get_event_obj(unsigned line)
Definition: events.c:292
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519

◆ _test_cp_args()

static void _test_cp_args ( unsigned  line,
REFIID  riid,
WORD  flags,
DISPPARAMS *  dp,
VARIANT vres,
EXCEPINFO *  ei,
UINT argerr 
)
static

Definition at line 1238 of file events.c.

1239 {
1240  ok_(__FILE__,line)(IsEqualGUID(&IID_NULL, riid), "riid = %s\n", wine_dbgstr_guid(riid));
1241  ok_(__FILE__,line)(flags == DISPATCH_METHOD, "flags = %x\n", flags);
1242  ok_(__FILE__,line)(dp != NULL, "dp == NULL\n");
1243  ok_(__FILE__,line)(!dp->cArgs, "dp->cArgs = %d\n", dp->cArgs);
1244  ok_(__FILE__,line)(!dp->rgvarg, "dp->rgvarg = %p\n", dp->rgvarg);
1245  ok_(__FILE__,line)(!dp->cNamedArgs, "dp->cNamedArgs = %d\n", dp->cNamedArgs);
1246  ok_(__FILE__,line)(!dp->rgdispidNamedArgs, "dp->rgdispidNamedArgs = %p\n", dp->rgdispidNamedArgs);
1247  ok_(__FILE__,line)(vres != NULL, "vres == NULL\n");
1248  ok_(__FILE__,line)(V_VT(vres) == VT_EMPTY, "V_VT(vres) = %d\n", V_VT(vres));
1249  ok_(__FILE__,line)(ei != NULL, "ei == NULL\n");
1250  ok_(__FILE__,line)(argerr != NULL, "argerr == NULL\n");
1251 }
#define ok_(x1, x2)
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
GLbitfield flags
Definition: glext.h:7161
#define IID_NULL
Definition: guiddef.h:93
#define V_VT(A)
Definition: oleauto.h:211
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ _test_cp_eventarg()

static void _test_cp_eventarg ( unsigned  line,
REFIID  riid,
WORD  flags,
DISPPARAMS *  dp,
VARIANT vres,
EXCEPINFO *  ei,
UINT argerr 
)
static

Definition at line 1254 of file events.c.

1255 {
1256  IHTMLEventObj *event;
1257 
1258  ok_(__FILE__,line)(IsEqualGUID(&IID_NULL, riid), "riid = %s\n", wine_dbgstr_guid(riid));
1259  ok_(__FILE__,line)(flags == DISPATCH_METHOD, "flags = %x\n", flags);
1260  ok_(__FILE__,line)(dp != NULL, "dp == NULL\n");
1261  ok_(__FILE__,line)(dp->cArgs == 1, "dp->cArgs = %d\n", dp->cArgs);
1262  ok_(__FILE__,line)(dp->rgvarg != NULL, "dp->rgvarg = %p\n", dp->rgvarg);
1263  ok_(__FILE__,line)(!dp->cNamedArgs, "dp->cNamedArgs = %d\n", dp->cNamedArgs);
1264  ok_(__FILE__,line)(!dp->rgdispidNamedArgs, "dp->rgdispidNamedArgs = %p\n", dp->rgdispidNamedArgs);
1265  ok_(__FILE__,line)(vres != NULL, "vres == NULL\n");
1266  ok_(__FILE__,line)(V_VT(vres) == VT_EMPTY, "V_VT(vres) = %d\n", V_VT(vres));
1267  ok_(__FILE__,line)(ei != NULL, "ei == NULL\n");
1268  ok_(__FILE__,line)(argerr != NULL, "argerr == NULL\n");
1269 
1270  ok(V_VT(dp->rgvarg) == VT_DISPATCH, "V_VT(dp->rgvarg) = %d\n", V_VT(dp->rgvarg));
1271  ok(V_DISPATCH(dp->rgvarg) != NULL, "V_DISPATCH(dp->rgvarg) = %p\n", V_DISPATCH(dp->rgvarg));
1272 
1273  event = _get_event_obj(line);
1274  ok(iface_cmp((IUnknown*)event, (IUnknown*)V_DISPATCH(dp->rgvarg)), "event != arg0\n");
1275  IHTMLEventObj_Release(event);
1276 }
#define ok_(x1, x2)
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
static BOOL iface_cmp(IUnknown *iface1, IUnknown *iface2)
Definition: events.c:135
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
GLbitfield flags
Definition: glext.h:7161
#define IID_NULL
Definition: guiddef.h:93
#define V_VT(A)
Definition: oleauto.h:211
struct _cl_event * event
Definition: glext.h:7739
static IHTMLEventObj * _get_event_obj(unsigned line)
Definition: events.c:292
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ _test_disp()

static void _test_disp ( unsigned  line,
IUnknown unk,
const IID diid 
)
static

Definition at line 151 of file events.c.

152 {
153  IDispatchEx *dispex;
155  UINT ticnt;
156  HRESULT hres;
157 
158  hres = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (void**)&dispex);
159  ok_(__FILE__,line) (hres == S_OK, "Could not get IDispatch: %08x\n", hres);
160  if(FAILED(hres))
161  return;
162 
163  ticnt = 0xdeadbeef;
164  hres = IDispatchEx_GetTypeInfoCount(dispex, &ticnt);
165  ok_(__FILE__,line) (hres == S_OK, "GetTypeInfoCount failed: %08x\n", hres);
166  ok_(__FILE__,line) (ticnt == 1, "ticnt=%u\n", ticnt);
167 
168  hres = IDispatchEx_GetTypeInfo(dispex, 0, 0, &typeinfo);
169  ok_(__FILE__,line) (hres == S_OK, "GetTypeInfo failed: %08x\n", hres);
170 
171  if(SUCCEEDED(hres)) {
172  TYPEATTR *type_attr;
173 
174  hres = ITypeInfo_GetTypeAttr(typeinfo, &type_attr);
175  ok_(__FILE__,line) (hres == S_OK, "GetTypeAttr failed: %08x\n", hres);
176  ok_(__FILE__,line) (IsEqualGUID(&type_attr->guid, diid), "unexpected guid %s\n",
177  wine_dbgstr_guid(&type_attr->guid));
178 
179  ITypeInfo_ReleaseTypeAttr(typeinfo, type_attr);
180  ITypeInfo_Release(typeinfo);
181  }
182 
183  IDispatchEx_Release(dispex);
184 }
#define ok_(x1, x2)
const char * wine_dbgstr_guid(const GUID *guid)
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:106
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by _get_event_obj(), and _test_event_args().

◆ _test_elem_tag()

static void _test_elem_tag ( unsigned  line,
IUnknown unk,
const char extag 
)
static

Definition at line 277 of file events.c.

278 {
279  IHTMLElement *elem = _get_elem_iface(line, unk);
280  BSTR tag;
281  HRESULT hres;
282 
283  hres = IHTMLElement_get_tagName(elem, &tag);
284  IHTMLElement_Release(elem);
285  ok_(__FILE__, line) (hres == S_OK, "get_tagName failed: %08x\n", hres);
286  ok_(__FILE__, line) (!strcmp_wa(tag, extag), "got tag: %s, expected %s\n", wine_dbgstr_w(tag), extag);
287 
289 }
#define ok_(x1, x2)
#define wine_dbgstr_w
Definition: kernel32.h:34
Definition: ecma_167.h:138
OLECHAR * BSTR
Definition: compat.h:1934
static size_t elem
Definition: string.c:68
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static IHTMLElement * _get_elem_iface(unsigned line, IUnknown *unk)
Definition: events.c:199
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: events.c:116
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
char * tag
Definition: main.c:59

Referenced by _test_event_fromelem(), _test_event_src(), and _test_event_toelem().

◆ _test_event_altkey()

static void _test_event_altkey ( unsigned  line,
IHTMLEventObj *  event,
VARIANT_BOOL  exval 
)
static

Definition at line 393 of file events.c.

394 {
395  VARIANT_BOOL b;
396  HRESULT hres;
397 
398  hres = IHTMLEventObj_get_altKey(event, &b);
399  ok_(__FILE__,line)(hres == S_OK, "get_altKey failed: %08x\n", hres);
400  ok_(__FILE__,line)(b == exval, "altKey = %x, expected %x\n", b, exval);
401 }
#define ok_(x1, x2)
short VARIANT_BOOL
Definition: compat.h:1931
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_args()

static void _test_event_args ( unsigned  line,
const IID dispiid,
DISPID  id,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 322 of file events.c.

324 {
325  ok_(__FILE__,line) (id == DISPID_VALUE, "id = %d\n", id);
326  ok_(__FILE__,line) (wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
327  ok_(__FILE__,line) (pdp != NULL, "pdp == NULL\n");
328  ok_(__FILE__,line) (pdp->cArgs == 1, "pdp->cArgs = %d\n", pdp->cArgs);
329  ok_(__FILE__,line) (pdp->cNamedArgs == 1, "pdp->cNamedArgs = %d\n", pdp->cNamedArgs);
330  ok_(__FILE__,line) (pdp->rgdispidNamedArgs[0] == DISPID_THIS, "pdp->rgdispidNamedArgs[0] = %d\n",
331  pdp->rgdispidNamedArgs[0]);
332  ok_(__FILE__,line) (V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(rgvarg) = %d\n", V_VT(pdp->rgvarg));
333  ok_(__FILE__,line) (pvarRes != NULL, "pvarRes == NULL\n");
334  ok_(__FILE__,line) (pei != NULL, "pei == NULL");
335  ok_(__FILE__,line) (!pspCaller, "pspCaller != NULL\n");
336 
337  if(dispiid)
338  _test_disp(line, (IUnknown*)V_DISPATCH(pdp->rgvarg), dispiid);
339 }
#define ok_(x1, x2)
static void _test_disp(unsigned line, IUnknown *unk, const IID *diid)
Definition: events.c:151
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define DISPID_THIS
Definition: olectl.h:395
GLenum GLuint id
Definition: glext.h:5579

◆ _test_event_button()

static void _test_event_button ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 474 of file events.c.

475 {
476  LONG l;
477  HRESULT hres;
478 
479  hres = IHTMLEventObj_get_button(event, &l);
480  ok_(__FILE__,line)(hres == S_OK, "get_button failed: %08x\n", hres);
481  ok_(__FILE__,line)(l == exl, "button = %x, expected %x\n", l, exl);
482 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_cancelbubble()

static void _test_event_cancelbubble ( unsigned  line,
IHTMLEventObj *  event,
VARIANT_BOOL  exval 
)
static

Definition at line 424 of file events.c.

425 {
426  VARIANT_BOOL b;
427  HRESULT hres;
428 
429  hres = IHTMLEventObj_get_cancelBubble(event, &b);
430  ok_(__FILE__,line)(hres == S_OK, "get_cancelBubble failed: %08x\n", hres);
431  ok_(__FILE__,line)(b == exval, "cancelBubble = %x, expected %x\n", b, exval);
432 }
#define ok_(x1, x2)
short VARIANT_BOOL
Definition: compat.h:1931
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_clientx()

static void _test_event_clientx ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 516 of file events.c.

517 {
518  LONG l;
519  HRESULT hres;
520 
521  hres = IHTMLEventObj_get_clientX(event, &l);
522  ok_(__FILE__,line)(hres == S_OK, "get_clientX failed: %08x\n", hres);
523  if(exl != -10) /* don't test the exact value */
524  ok_(__FILE__,line)(l == exl, "clientX = %d, expected %d\n", l, exl);
525 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_clienty()

static void _test_event_clienty ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 527 of file events.c.

528 {
529  LONG l;
530  HRESULT hres;
531 
532  hres = IHTMLEventObj_get_clientY(event, &l);
533  ok_(__FILE__,line)(hres == S_OK, "get_clientY failed: %08x\n", hres);
534  if(exl != -10) /* don't test the exact value */
535  ok_(__FILE__,line)(l == exl, "clientY = %d, expected %d\n", l, exl);
536 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_ctrlkey()

static void _test_event_ctrlkey ( unsigned  line,
IHTMLEventObj *  event,
VARIANT_BOOL  exval 
)
static

Definition at line 403 of file events.c.

404 {
405  VARIANT_BOOL b;
406  HRESULT hres;
407 
408  hres = IHTMLEventObj_get_ctrlKey(event, &b);
409  ok_(__FILE__,line)(hres == S_OK, "get_ctrlKey failed: %08x\n", hres);
410  ok_(__FILE__,line)(b == exval, "ctrlKey = %x, expected %x\n", b, exval);
411 }
#define ok_(x1, x2)
short VARIANT_BOOL
Definition: compat.h:1931
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_fromelem()

static void _test_event_fromelem ( unsigned  line,
IHTMLEventObj *  event,
const char from_tag 
)
static

Definition at line 434 of file events.c.

435 {
436  IHTMLElement *elem;
437  HRESULT hres;
438 
439  hres = IHTMLEventObj_get_fromElement(event, &elem);
440  ok_(__FILE__,line)(hres == S_OK, "get_fromElement failed: %08x\n", hres);
441  if(from_tag)
442  _test_elem_tag(line, (IUnknown*)elem, from_tag);
443  else
444  ok_(__FILE__,line)(elem == NULL, "fromElement != NULL\n");
445  if(elem)
446  IHTMLElement_Release(elem);
447 }
static void _test_elem_tag(unsigned line, IUnknown *unk, const char *extag)
Definition: events.c:277
#define ok_(x1, x2)
static size_t elem
Definition: string.c:68
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_keycode()

static void _test_event_keycode ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 464 of file events.c.

465 {
466  LONG l;
467  HRESULT hres;
468 
469  hres = IHTMLEventObj_get_keyCode(event, &l);
470  ok_(__FILE__,line)(hres == S_OK, "get_keyCode failed: %08x\n", hres);
471  ok_(__FILE__,line)(l == exl, "keyCode = %x, expected %x\n", l, exl);
472 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_obj()

static void _test_event_obj ( unsigned  line,
const char type,
const xy_test_t xy 
)
static

Definition at line 616 of file events.c.

617 {
618  IHTMLEventObj *event = _get_event_obj(line);
619  VARIANT v;
620  HRESULT hres;
621 
622  _test_event_altkey(line, event, VARIANT_FALSE);
623  _test_event_ctrlkey(line, event, VARIANT_FALSE);
624  _test_event_shiftkey(line, event, VARIANT_FALSE);
625  _test_event_cancelbubble(line, event, VARIANT_FALSE);
634  _test_event_x(line, event, xy->x);
635  _test_event_y(line, event, xy->y);
642 
643  V_VT(&v) = VT_NULL;
644  hres = IHTMLEventObj_get_returnValue(event, &v);
645  ok_(__FILE__,line)(hres == S_OK, "get_returnValue failed: %08x\n", hres);
646  ok_(__FILE__,line)(V_VT(&v) == VT_EMPTY, "V_VT(returnValue) = %d\n", V_VT(&v));
647 
648  IHTMLEventObj_Release(event);
649 }
static void _test_event_srcfilter(unsigned line, IHTMLEventObj *event)
Definition: events.c:605
static void _test_event_clientx(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:516
#define ok_(x1, x2)
static void _test_event_clienty(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:527
static void _test_event_reason(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:484
static void _test_event_ctrlkey(unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
Definition: events.c:403
static void _test_event_fromelem(unsigned line, IHTMLEventObj *event, const char *from_tag)
Definition: events.c:434
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void _test_event_screenx(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:560
static void _test_event_y(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:505
static void _test_event_offsety(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:549
static void _test_event_offsetx(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:538
static void _test_event_keycode(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:464
static void _test_event_qualifier(unsigned line, IHTMLEventObj *event, const char *exstr)
Definition: events.c:592
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
static void _test_event_type(unsigned line, IHTMLEventObj *event, const char *exstr)
Definition: events.c:582
static void _test_event_shiftkey(unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
Definition: events.c:413
static void _test_event_toelem(unsigned line, IHTMLEventObj *event, const char *to_tag)
Definition: events.c:449
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static void _test_event_button(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:474
static void _test_event_altkey(unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
Definition: events.c:393
static void _test_event_screeny(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:571
#define V_VT(A)
Definition: oleauto.h:211
struct _cl_event * event
Definition: glext.h:7739
static IHTMLEventObj * _get_event_obj(unsigned line)
Definition: events.c:292
static void _test_event_x(unsigned line, IHTMLEventObj *event, LONG exl)
Definition: events.c:494
#define S_OK
Definition: intsafe.h:59
LONG y
Definition: events.c:83
const GLdouble * v
Definition: gl.h:2040
LONG x
Definition: events.c:82
LONG offset_y
Definition: events.c:85
static void _test_event_cancelbubble(unsigned line, IHTMLEventObj *event, VARIANT_BOOL exval)
Definition: events.c:424
LONG offset_x
Definition: events.c:84

◆ _test_event_offsetx()

static void _test_event_offsetx ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 538 of file events.c.

539 {
540  LONG l;
541  HRESULT hres;
542 
543  hres = IHTMLEventObj_get_offsetX(event, &l);
544  ok_(__FILE__,line)(hres == S_OK, "get_offsetX failed: %08x\n", hres);
545  if(exl != -10) /* don't test the exact value */
546  ok_(__FILE__,line)(l == exl, "offsetX = %d, expected %d\n", l, exl);
547 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_offsety()

static void _test_event_offsety ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 549 of file events.c.

550 {
551  LONG l;
552  HRESULT hres;
553 
554  hres = IHTMLEventObj_get_offsetY(event, &l);
555  ok_(__FILE__,line)(hres == S_OK, "get_offsetY failed: %08x\n", hres);
556  if(exl != -10) /* don't test the exact value */
557  ok_(__FILE__,line)(l == exl, "offsetY = %d, expected %d\n", l, exl);
558 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_qualifier()

static void _test_event_qualifier ( unsigned  line,
IHTMLEventObj *  event,
const char exstr 
)
static

Definition at line 592 of file events.c.

593 {
594  BSTR str;
595  HRESULT hres;
596 
597  hres = IHTMLEventObj_get_qualifier(event, &str);
598  ok_(__FILE__,line)(hres == S_OK, "get_qualifier failed: %08x\n", hres);
599  if(exstr)
600  ok_(__FILE__,line)(!strcmp_wa(str, exstr), "qualifier = %s, expected %s\n", wine_dbgstr_w(str), exstr);
601  else
602  ok_(__FILE__,line)(!str, "qualifier != NULL\n");
603 }
#define ok_(x1, x2)
#define wine_dbgstr_w
Definition: kernel32.h:34
OLECHAR * BSTR
Definition: compat.h:1934
const WCHAR * str
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: events.c:116

Referenced by _test_event_obj().

◆ _test_event_reason()

static void _test_event_reason ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 484 of file events.c.

485 {
486  LONG l;
487  HRESULT hres;
488 
489  hres = IHTMLEventObj_get_reason(event, &l);
490  ok_(__FILE__,line)(hres == S_OK, "get_reason failed: %08x\n", hres);
491  ok_(__FILE__,line)(l == exl, "reason = %x, expected %x\n", l, exl);
492 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_screenx()

static void _test_event_screenx ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 560 of file events.c.

561 {
562  LONG l;
563  HRESULT hres;
564 
565  hres = IHTMLEventObj_get_screenX(event, &l);
566  ok_(__FILE__,line)(hres == S_OK, "get_screenX failed: %08x\n", hres);
567  if(exl != -10) /* don't test the exact value */
568  ok_(__FILE__,line)(l == exl, "screenX = %d, expected %d\n", l, exl);
569 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_screeny()

static void _test_event_screeny ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 571 of file events.c.

572 {
573  LONG l;
574  HRESULT hres;
575 
576  hres = IHTMLEventObj_get_screenY(event, &l);
577  ok_(__FILE__,line)(hres == S_OK, "get_screenY failed: %08x\n", hres);
578  if(exl != -10) /* don't test the exact value for -10 */
579  ok_(__FILE__,line)(l == exl, "screenY = %d, expected %d\n", l, exl);
580 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_shiftkey()

static void _test_event_shiftkey ( unsigned  line,
IHTMLEventObj *  event,
VARIANT_BOOL  exval 
)
static

Definition at line 413 of file events.c.

414 {
415  VARIANT_BOOL b;
416  HRESULT hres;
417 
418  hres = IHTMLEventObj_get_shiftKey(event, &b);
419  ok_(__FILE__,line)(hres == S_OK, "get_shiftKey failed: %08x\n", hres);
420  ok_(__FILE__,line)(b == exval, "shiftKey = %x, expected %x\n", b, exval);
421 }
#define ok_(x1, x2)
short VARIANT_BOOL
Definition: compat.h:1931
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_src()

static void _test_event_src ( unsigned  line,
const char src_tag 
)
static

Definition at line 380 of file events.c.

381 {
382  IHTMLElement *src_elem = _get_event_src(line);
383 
384  if(src_tag) {
385  ok_(__FILE__,line) (src_elem != NULL, "src_elem = NULL\n");
386  _test_elem_tag(line, (IUnknown*)src_elem, src_tag);
387  IHTMLElement_Release(src_elem);
388  }else {
389  ok_(__FILE__,line) (!src_elem, "src_elem != NULL\n");
390  }
391 }
static void _test_elem_tag(unsigned line, IUnknown *unk, const char *extag)
Definition: events.c:277
#define ok_(x1, x2)
static IHTMLElement * _get_event_src(unsigned line)
Definition: events.c:366
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48

◆ _test_event_srcfilter()

static void _test_event_srcfilter ( unsigned  line,
IHTMLEventObj *  event 
)
static

Definition at line 605 of file events.c.

606 {
607  IDispatch *disp;
608  HRESULT hres;
609 
610  hres = IHTMLEventObj_get_srcFilter(event, &disp);
611  ok_(__FILE__,line)(hres == S_OK, "get_srcFilter failed: %08x\n", hres);
612  ok_(__FILE__,line)(!disp, "srcFilter != NULL\n");
613 }
disp
Definition: i386-dis.c:3181
#define ok_(x1, x2)
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_toelem()

static void _test_event_toelem ( unsigned  line,
IHTMLEventObj *  event,
const char to_tag 
)
static

Definition at line 449 of file events.c.

450 {
451  IHTMLElement *elem;
452  HRESULT hres;
453 
454  hres = IHTMLEventObj_get_toElement(event, &elem);
455  ok_(__FILE__,line)(hres == S_OK, "get_toElement failed: %08x\n", hres);
456  if(to_tag)
457  _test_elem_tag(line, (IUnknown*)elem, to_tag);
458  else
459  ok_(__FILE__,line)(elem == NULL, "toElement != NULL\n");
460  if(elem)
461  IHTMLElement_Release(elem);
462 }
static void _test_elem_tag(unsigned line, IUnknown *unk, const char *extag)
Definition: events.c:277
#define ok_(x1, x2)
static size_t elem
Definition: string.c:68
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_type()

static void _test_event_type ( unsigned  line,
IHTMLEventObj *  event,
const char exstr 
)
static

Definition at line 582 of file events.c.

583 {
584  BSTR str;
585  HRESULT hres;
586 
587  hres = IHTMLEventObj_get_type(event, &str);
588  ok_(__FILE__,line)(hres == S_OK, "get_type failed: %08x\n", hres);
589  ok_(__FILE__,line)(!strcmp_wa(str, exstr), "type = %s, expected %s\n", wine_dbgstr_w(str), exstr);
590 }
#define ok_(x1, x2)
#define wine_dbgstr_w
Definition: kernel32.h:34
OLECHAR * BSTR
Definition: compat.h:1934
const WCHAR * str
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: events.c:116

Referenced by _test_event_obj().

◆ _test_event_x()

static void _test_event_x ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 494 of file events.c.

495 {
496  LONG l;
497  HRESULT hres;
498 
499  hres = IHTMLEventObj_get_x(event, &l);
500  ok_(__FILE__,line)(hres == S_OK, "get_x failed: %08x\n", hres);
501  if(exl != -10) /* don't test the exact value */
502  ok_(__FILE__,line)(l == exl, "x = %d, expected %d\n", l, exl);
503 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ _test_event_y()

static void _test_event_y ( unsigned  line,
IHTMLEventObj *  event,
LONG  exl 
)
static

Definition at line 505 of file events.c.

506 {
507  LONG l;
508  HRESULT hres;
509 
510  hres = IHTMLEventObj_get_y(event, &l);
511  ok_(__FILE__,line)(hres == S_OK, "get_y failed: %08x\n", hres);
512  if(exl != -10) /* don't test the exact value */
513  ok_(__FILE__,line)(l == exl, "y = %d, expected %d\n", l, exl);
514 }
#define ok_(x1, x2)
long LONG
Definition: pedump.c:60
Definition: parser.c:48
r l[0]
Definition: byte_order.h:167
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59

Referenced by _test_event_obj().

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 123 of file events.c.

124 {
125  BSTR ret;
126  int len;
127 
128  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
130  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
131 
132  return ret;
133 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define CP_ACP
Definition: compat.h:99
OLECHAR * BSTR
Definition: compat.h:1934
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by _doc_attach_event(), _doc_detach_event(), _elem_attach_event(), _elem_detach_event(), _elem_fire_event(), _get_elem_id(), find_element_by_id(), test_iframe_connections(), test_imgload(), test_onclick(), and test_onreadystatechange().

◆ body_onclick()

static HRESULT WINAPI body_onclick ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 902 of file events.c.

904 {
906  test_event_args(&DIID_DispHTMLBody, id, wFlags, pdp, pvarRes, pei, pspCaller);
907  test_event_src("DIV");
908  return S_OK;
909 }
#define CHECK_EXPECT(func)
Definition: events.c:36
#define test_event_src(t)
Definition: events.c:379
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static HRESULT WINAPI body_onclick(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:902
#define S_OK
Definition: intsafe.h:59
#define test_event_args(a, b, c, d, e, f, g)
Definition: events.c:321

Referenced by test_onclick().

◆ check_ie()

static BOOL check_ie ( void  )
static

Definition at line 2842 of file events.c.

2843 {
2844  IHTMLDocument2 *doc;
2845  IHTMLDocument5 *doc5;
2846  IHTMLDocument7 *doc7;
2847  HRESULT hres;
2848 
2849  doc = create_document();
2850  if(!doc)
2851  return FALSE;
2852 
2853  hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument7, (void**)&doc7);
2854  if(SUCCEEDED(hres)) {
2855  is_ie9plus = TRUE;
2856  IHTMLDocument7_Release(doc7);
2857  }
2858 
2859  trace("is_ie9plus %x\n", is_ie9plus);
2860 
2861  hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
2862  if(SUCCEEDED(hres))
2863  IHTMLDocument5_Release(doc5);
2864 
2865  IHTMLDocument2_Release(doc);
2866  return SUCCEEDED(hres);
2867 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
static IHTMLDocument2 * create_document(void)
Definition: events.c:2734
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static BOOL is_ie9plus
Definition: events.c:79
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ ClientSite_AddRef()

static ULONG WINAPI ClientSite_AddRef ( IOleClientSite iface)
static

Definition at line 2475 of file events.c.

2476 {
2477  return 2;
2478 }

◆ ClientSite_GetContainer()

static HRESULT WINAPI ClientSite_GetContainer ( IOleClientSite iface,
IOleContainer **  ppContainer 
)
static

Definition at line 2498 of file events.c.

2499 {
2500  return E_NOTIMPL;
2501 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClientSite_GetMoniker()

static HRESULT WINAPI ClientSite_GetMoniker ( IOleClientSite iface,
DWORD  dwAssign,
DWORD  dwWhichMoniker,
IMoniker **  ppmon 
)
static

Definition at line 2491 of file events.c.

2493 {
2494  ok(0, "unexpected call\n");
2495  return E_NOTIMPL;
2496 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClientSite_OnShowWindow()

static HRESULT WINAPI ClientSite_OnShowWindow ( IOleClientSite iface,
BOOL  fShow 
)
static

Definition at line 2509 of file events.c.

2510 {
2511  ok(0, "unexpected call\n");
2512  return E_NOTIMPL;
2513 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClientSite_QueryInterface()

static HRESULT WINAPI ClientSite_QueryInterface ( IOleClientSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2470 of file events.c.

2471 {
2472  return QueryInterface(riid, ppv);
2473 }
REFIID riid
Definition: precomp.h:44
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ ClientSite_Release()

static ULONG WINAPI ClientSite_Release ( IOleClientSite iface)
static

Definition at line 2480 of file events.c.

2481 {
2482  return 1;
2483 }

◆ ClientSite_RequestNewObjectLayout()

static HRESULT WINAPI ClientSite_RequestNewObjectLayout ( IOleClientSite iface)
static

Definition at line 2515 of file events.c.

2516 {
2517  ok(0, "unexpected call\n");
2518  return E_NOTIMPL;
2519 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClientSite_SaveObject()

static HRESULT WINAPI ClientSite_SaveObject ( IOleClientSite iface)
static

Definition at line 2485 of file events.c.

2486 {
2487  ok(0, "unexpected call\n");
2488  return E_NOTIMPL;
2489 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClientSite_ShowObject()

static HRESULT WINAPI ClientSite_ShowObject ( IOleClientSite iface)
static

Definition at line 2503 of file events.c.

2504 {
2505  ok(0, "unexpected call\n");
2506  return E_NOTIMPL;
2507 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ CONNECTION_POINT_OBJ() [1/3]

CONNECTION_POINT_OBJ ( doccp  ,
DIID_HTMLDocumentEvents   
)

◆ CONNECTION_POINT_OBJ() [2/3]

CONNECTION_POINT_OBJ ( doccp_onclick_cancel  ,
DIID_HTMLDocumentEvents   
)

◆ CONNECTION_POINT_OBJ() [3/3]

CONNECTION_POINT_OBJ ( elem2_cp  ,
DIID_HTMLElementEvents2   
)

◆ create_container_window()

static HWND create_container_window ( void  )
static

Definition at line 2794 of file events.c.

2795 {
2796  static const CHAR szHTMLDocumentTest[] = "HTMLDocumentTest";
2797  static WNDCLASSEXA wndclass = {
2798  sizeof(WNDCLASSEXA),
2799  0,
2800  wnd_proc,
2801  0, 0, NULL, NULL, NULL, NULL, NULL,
2802  szHTMLDocumentTest,
2803  NULL
2804  };
2805 
2806  RegisterClassExA(&wndclass);
2807  return CreateWindowA(szHTMLDocumentTest, szHTMLDocumentTest,
2809  300, 300, NULL, NULL, NULL, NULL);
2810 }
struct _WNDCLASSEXA WNDCLASSEXA
char CHAR
Definition: xmlstorage.h:175
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: events.c:2789
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637

Referenced by START_TEST().

◆ create_document()

static IHTMLDocument2* create_document ( void  )
static

Definition at line 2734 of file events.c.

2735 {
2736  IHTMLDocument2 *doc;
2737  HRESULT hres;
2738 
2739  hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
2740  &IID_IHTMLDocument2, (void**)&doc);
2741  ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
2742  return SUCCEEDED(hres) ? doc : NULL;
2743 }
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by check_ie(), run_test(), and test_empty_document().

◆ DEFINE_EXPECT() [1/27]

DEFINE_EXPECT ( document_onclick  )

◆ DEFINE_EXPECT() [2/27]

DEFINE_EXPECT ( body_onclick  )

◆ DEFINE_EXPECT() [3/27]

DEFINE_EXPECT ( doc_onclick_attached  )

◆ DEFINE_EXPECT() [4/27]

DEFINE_EXPECT ( div_onclick  )

◆ DEFINE_EXPECT() [5/27]

DEFINE_EXPECT ( div_onclick_attached  )

◆ DEFINE_EXPECT() [6/27]

DEFINE_EXPECT ( timeout  )

◆ DEFINE_EXPECT() [7/27]

DEFINE_EXPECT ( doccp_onclick  )

◆ DEFINE_EXPECT() [8/27]

DEFINE_EXPECT ( doccp_onclick_cancel  )

◆ DEFINE_EXPECT() [9/27]

DEFINE_EXPECT ( div_onclick_disp  )

◆ DEFINE_EXPECT() [10/27]

DEFINE_EXPECT ( invoke_onclick  )

◆ DEFINE_EXPECT() [11/27]

DEFINE_EXPECT ( iframe_onreadystatechange_loading  )

◆ DEFINE_EXPECT() [12/27]

DEFINE_EXPECT ( iframe_onreadystatechange_interactive  )

◆ DEFINE_EXPECT() [13/27]

DEFINE_EXPECT ( iframe_onreadystatechange_complete  )

◆ DEFINE_EXPECT() [14/27]

DEFINE_EXPECT ( iframedoc_onreadystatechange  )

◆ DEFINE_EXPECT() [15/27]

DEFINE_EXPECT ( img_onload  )

◆ DEFINE_EXPECT() [16/27]

DEFINE_EXPECT ( img_onerror  )

◆ DEFINE_EXPECT() [17/27]

DEFINE_EXPECT ( input_onfocus  )

◆ DEFINE_EXPECT() [18/27]

DEFINE_EXPECT ( input_onblur  )

◆ DEFINE_EXPECT() [19/27]

DEFINE_EXPECT ( form_onsubmit  )

◆ DEFINE_EXPECT() [20/27]

DEFINE_EXPECT ( form_onclick  )

◆ DEFINE_EXPECT() [21/27]

DEFINE_EXPECT ( submit_onclick  )

◆ DEFINE_EXPECT() [22/27]

DEFINE_EXPECT ( submit_onclick_cancel  )

◆ DEFINE_EXPECT() [23/27]

DEFINE_EXPECT ( submit_onclick_attached  )

◆ DEFINE_EXPECT() [24/27]

◆ DEFINE_EXPECT() [25/27]

DEFINE_EXPECT ( submit_onclick_setret  )

◆ DEFINE_EXPECT() [26/27]

DEFINE_EXPECT ( elem2_cp_onclick  )

◆ DEFINE_EXPECT() [27/27]

DEFINE_EXPECT ( iframe_onload  )

◆ Dispatch_QueryInterface()

static HRESULT WINAPI Dispatch_QueryInterface ( IDispatchEx *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 727 of file events.c.

728 {
729  *ppv = NULL;
730 
733  *ppv = iface;
734  }else if(IsEqualGUID(riid, &IID_IDispatchEx)) {
735  return E_NOINTERFACE;
736  }else {
737  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
738  return E_NOINTERFACE;
739  }
740 
741  return S_OK;
742 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ DispatchEx_AddRef()

static ULONG WINAPI DispatchEx_AddRef ( IDispatchEx *  iface)
static

Definition at line 744 of file events.c.

745 {
746  return 2;
747 }

◆ DispatchEx_DeleteMemberByDispID()

static HRESULT WINAPI DispatchEx_DeleteMemberByDispID ( IDispatchEx *  iface,
DISPID  id 
)
static

Definition at line 802 of file events.c.

803 {
804  ok(0, "unexpected call\n");
805  return E_NOTIMPL;
806 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_DeleteMemberByName()

static HRESULT WINAPI DispatchEx_DeleteMemberByName ( IDispatchEx *  iface,
BSTR  bstrName,
DWORD  grfdex 
)
static

Definition at line 796 of file events.c.

797 {
798  ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
799  return E_NOTIMPL;
800 }
#define wine_dbgstr_w
Definition: kernel32.h:34
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetDispID()

static HRESULT WINAPI DispatchEx_GetDispID ( IDispatchEx *  iface,
BSTR  bstrName,
DWORD  grfdex,
DISPID pid 
)
static

Definition at line 783 of file events.c.

784 {
785  ok(0, "unexpected call\n");
786  return E_NOTIMPL;
787 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetIDsOfNames()

static HRESULT WINAPI DispatchEx_GetIDsOfNames ( IDispatchEx *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 767 of file events.c.

770 {
771  ok(0, "unexpected call\n");
772  return E_NOTIMPL;
773 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetMemberName()

static HRESULT WINAPI DispatchEx_GetMemberName ( IDispatchEx *  iface,
DISPID  id,
BSTR pbstrName 
)
static

Definition at line 814 of file events.c.

815 {
816  ok(0, "unexpected call\n");
817  return E_NOTIMPL;
818 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetMemberProperties()

static HRESULT WINAPI DispatchEx_GetMemberProperties ( IDispatchEx *  iface,
DISPID  id,
DWORD  grfdexFetch,
DWORD pgrfdex 
)
static

Definition at line 808 of file events.c.

809 {
810  ok(0, "unexpected call\n");
811  return E_NOTIMPL;
812 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetNameSpaceParent()

static HRESULT WINAPI DispatchEx_GetNameSpaceParent ( IDispatchEx *  iface,
IUnknown **  ppunk 
)
static

Definition at line 826 of file events.c.

827 {
828  ok(0, "unexpected call\n");
829  return E_NOTIMPL;
830 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetNextDispID()

static HRESULT WINAPI DispatchEx_GetNextDispID ( IDispatchEx *  iface,
DWORD  grfdex,
DISPID  id,
DISPID pid 
)
static

Definition at line 820 of file events.c.

821 {
822  ok(0, "unexpected call\n");
823  return E_NOTIMPL;
824 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetTypeInfo()

static HRESULT WINAPI DispatchEx_GetTypeInfo ( IDispatchEx *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 760 of file events.c.

762 {
763  ok(0, "unexpected call\n");
764  return E_NOTIMPL;
765 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetTypeInfoCount()

static HRESULT WINAPI DispatchEx_GetTypeInfoCount ( IDispatchEx *  iface,
UINT pctinfo 
)
static

Definition at line 754 of file events.c.

755 {
756  ok(0, "unexpected call\n");
757  return E_NOTIMPL;
758 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_Invoke()

static HRESULT WINAPI DispatchEx_Invoke ( IDispatchEx *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 775 of file events.c.

778 {
779  ok(0, "unexpected call\n");
780  return E_NOTIMPL;
781 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_InvokeEx()

static HRESULT WINAPI DispatchEx_InvokeEx ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 789 of file events.c.

791 {
792  ok(0, "unexpected call\n");
793  return E_NOTIMPL;
794 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_QueryInterface()

static HRESULT WINAPI DispatchEx_QueryInterface ( IDispatchEx *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 711 of file events.c.

712 {
713  *ppv = NULL;
714 
717  || IsEqualGUID(riid, &IID_IDispatchEx))
718  *ppv = iface;
719  else {
720  ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
721  return E_NOINTERFACE;
722  }
723 
724  return S_OK;
725 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ DispatchEx_Release()

static ULONG WINAPI DispatchEx_Release ( IDispatchEx *  iface)
static

Definition at line 749 of file events.c.

750 {
751  return 1;
752 }

◆ div_onclick()

static HRESULT WINAPI div_onclick ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 867 of file events.c.

869 {
871  test_event_args(NULL, id, wFlags, pdp, pvarRes, pei, pspCaller);
872  test_event_src("DIV");
873  return S_OK;
874 }
#define CHECK_EXPECT(func)
Definition: events.c:36
static HRESULT WINAPI div_onclick(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:867
smooth NULL
Definition: ftsmooth.c:416
#define test_event_src(t)
Definition: events.c:379
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define test_event_args(a, b, c, d, e, f, g)
Definition: events.c:321

Referenced by test_onclick().

◆ div_onclick_attached()

static HRESULT WINAPI div_onclick_attached ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 878 of file events.c.

880 {
882 
883  test_attached_event_args(id, wFlags, pdp, pvarRes, pei);
884  test_event_src("DIV");
885  return S_OK;
886 }
#define CHECK_EXPECT(func)
Definition: events.c:36
static HRESULT WINAPI div_onclick_attached(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:878
#define test_event_src(t)
Definition: events.c:379
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define test_attached_event_args(a, b, c, d, e)
Definition: events.c:341

Referenced by test_onclick().

◆ div_onclick_disp_Invoke()

static HRESULT WINAPI div_onclick_disp_Invoke ( IDispatchEx *  iface,
DISPID  id,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
UINT puArgErr 
)
static

Definition at line 1378 of file events.c.

1381 {
1383 
1384  test_attached_event_args(id, wFlags, pdp, pvarRes, pei);
1385 
1386  ok(IsEqualGUID(&IID_NULL, riid), "riid = %s\n", wine_dbgstr_guid(riid));
1387  ok(!puArgErr, "puArgErr = %p\n", puArgErr);
1388 
1389  return S_OK;
1390 }
static IDispatchEx div_onclick_disp
Definition: events.c:1402
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define CHECK_EXPECT(func)
Definition: events.c:36
#define ok(value,...)
#define IID_NULL
Definition: guiddef.h:93
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define test_attached_event_args(a, b, c, d, e)
Definition: events.c:341

◆ do_advise()

static void do_advise ( IUnknown unk,
REFIID  riid,
IUnknown unk_advise 
)
static

Definition at line 2682 of file events.c.

2683 {
2686  DWORD cookie;
2687  HRESULT hres;
2688 
2689  hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
2690  ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
2691 
2692  hres = IConnectionPointContainer_FindConnectionPoint(container, riid, &cp);
2693  IConnectionPointContainer_Release(container);
2694  ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
2695 
2696  hres = IConnectionPoint_Advise(cp, unk_advise, &cookie);
2697  IConnectionPoint_Release(cp);
2698  ok(hres == S_OK, "Advise failed: %08x\n", hres);
2699 }
REFIID riid
Definition: precomp.h:44
const GUID IID_IConnectionPointContainer
struct container container
#define ok(value,...)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
POINT cp
Definition: magnifier.c:60

Referenced by run_test().

◆ doc_load_string()

static void doc_load_string ( IHTMLDocument2 *  doc,
const char str 
)
static

Definition at line 2660 of file events.c.

2661 {
2663  IStream *stream;
2664  HGLOBAL mem;
2665  SIZE_T len;
2666 
2667  notif_doc = doc;
2668 
2669  doc_complete = FALSE;
2670  len = strlen(str);
2671  mem = GlobalAlloc(0, len);
2672  memcpy(mem, str, len);
2674 
2675  IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init);
2676 
2677  IPersistStreamInit_Load(init, stream);
2678  IPersistStreamInit_Release(init);
2679  IStream_Release(stream);
2680 }
static BOOL doc_complete
Definition: events.c:2602
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static int init
Definition: wintirpc.c:33
const WCHAR * str
static IHTMLDocument2 * notif_doc
Definition: events.c:2601
Definition: parse.h:22
const GUID IID_IPersistStreamInit
GLuint GLuint stream
Definition: glext.h:7522
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
ULONG_PTR SIZE_T
Definition: typedefs.h:78
Definition: mem.c:156

Referenced by run_test().

◆ doc_onclick_attached()

static HRESULT WINAPI doc_onclick_attached ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 890 of file events.c.

892 {
894 
895  test_attached_event_args(id, wFlags, pdp, pvarRes, pei);
896  test_event_src("DIV");
897  return S_OK;
898 }
#define CHECK_EXPECT(func)
Definition: events.c:36
static HRESULT WINAPI doc_onclick_attached(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:890
#define test_event_src(t)
Definition: events.c:379
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define test_attached_event_args(a, b, c, d, e)
Definition: events.c:341

Referenced by test_onclick().

◆ doccp()

static HRESULT WINAPI doccp ( IDispatchEx *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pVarResult,
EXCEPINFO *  pei,
UINT puArgErr 
)
static

Definition at line 1278 of file events.c.

1281 {
1282  switch(dispIdMember) {
1284  CHECK_EXPECT(doccp_onclick);
1285  test_cp_args(riid, wFlags, pdp, pVarResult, pei, puArgErr);
1286  break;
1287  default:
1288  ok(0, "unexpected call %d\n", dispIdMember);
1289  return E_NOTIMPL;
1290  }
1291 
1292  return S_OK;
1293 }
REFIID riid
Definition: precomp.h:44
#define CHECK_EXPECT(func)
Definition: events.c:36
#define ok(value,...)
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define test_cp_args(a, b, c, d, e, f)
Definition: events.c:1237
#define DISPID_HTMLDOCUMENTEVENTS_ONCLICK
Definition: mshtmdid.h:860

◆ doccp_onclick_cancel()

static HRESULT WINAPI doccp_onclick_cancel ( IDispatchEx *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pVarResult,
EXCEPINFO *  pei,
UINT puArgErr 
)
static

Definition at line 1297 of file events.c.

1299 {
1300  switch(dispIdMember) {
1303  test_cp_args(riid, wFlags, pdp, pVarResult, pei, puArgErr);
1304  V_VT(pVarResult) = VT_BOOL;
1305  V_BOOL(pVarResult) = VARIANT_FALSE;
1306  break;
1307  default:
1308  ok(0, "unexpected call %d\n", dispIdMember);
1309  return E_NOTIMPL;
1310  }
1311 
1312  return S_OK;
1313 }
REFIID riid
Definition: precomp.h:44
#define CHECK_EXPECT(func)
Definition: events.c:36
#define ok(value,...)
#define V_BOOL(A)
Definition: oleauto.h:224
static HRESULT WINAPI doccp_onclick_cancel(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pei, UINT *puArgErr)
Definition: events.c:1297
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define test_cp_args(a, b, c, d, e, f)
Definition: events.c:1237
#define DISPID_HTMLDOCUMENTEVENTS_ONCLICK
Definition: mshtmdid.h:860

Referenced by test_submit().

◆ document_onclick()

static HRESULT WINAPI document_onclick ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 852 of file events.c.

854 {
855  IHTMLDocument3 *doc3;
857  test_event_args(NULL, id, wFlags, pdp, pvarRes, pei, pspCaller);
858  doc3 = get_doc3_iface((IUnknown*)V_DISPATCH(pdp->rgvarg));
859  IHTMLDocument3_Release(doc3);
860  test_event_src("DIV");
861  test_event_obj("click", &no_xy);
862  return S_OK;
863 }
static const xy_test_t no_xy
Definition: events.c:88
#define test_event_obj(t, x)
Definition: events.c:615
#define CHECK_EXPECT(func)
Definition: events.c:36
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define get_doc3_iface(u)
Definition: events.c:186
smooth NULL
Definition: ftsmooth.c:416
#define test_event_src(t)
Definition: events.c:379
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define test_event_args(a, b, c, d, e, f, g)
Definition: events.c:321
static HRESULT WINAPI document_onclick(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:852

Referenced by test_onclick().

◆ DocumentSite_ActivateMe()

static HRESULT WINAPI DocumentSite_ActivateMe ( IOleDocumentSite iface,
IOleDocumentView pViewToActivate 
)
static

Definition at line 2550 of file events.c.

2551 {
2552  RECT rect = {0,0,300,300};
2553  IOleDocument *document;
2554  HRESULT hres;
2555 
2556  hres = IOleDocumentView_QueryInterface(pViewToActivate, &IID_IOleDocument, (void**)&document);
2557  ok(hres == S_OK, "could not get IOleDocument: %08x\n", hres);
2558 
2559  hres = IOleDocument_CreateView(document, &InPlaceSite, NULL, 0, &view);
2560  IOleDocument_Release(document);
2561  ok(hres == S_OK, "CreateView failed: %08x\n", hres);
2562 
2563  hres = IOleDocumentView_SetInPlaceSite(view, &InPlaceSite);
2564  ok(hres == S_OK, "SetInPlaceSite failed: %08x\n", hres);
2565 
2566  hres = IOleDocumentView_UIActivate(view, TRUE);
2567  ok(hres == S_OK, "UIActivate failed: %08x\n", hres);
2568 
2569  hres = IOleDocumentView_SetRect(view, &rect);
2570  ok(hres == S_OK, "SetRect failed: %08x\n", hres);
2571 
2572  hres = IOleDocumentView_Show(view, TRUE);
2573  ok(hres == S_OK, "Show failed: %08x\n", hres);
2574 
2575  return S_OK;
2576 }
#define TRUE
Definition: types.h:120
& rect
Definition: startmenu.cpp:1413
static IOleInPlaceSite InPlaceSite
Definition: events.c:2468
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

◆ DocumentSite_AddRef()

static ULONG WINAPI DocumentSite_AddRef ( IOleDocumentSite iface)
static

Definition at line 2540 of file events.c.

2541 {
2542  return 2;
2543 }

◆ DocumentSite_QueryInterface()

static HRESULT WINAPI DocumentSite_QueryInterface ( IOleDocumentSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2535 of file events.c.

2536 {
2537  return QueryInterface(riid, ppv);
2538 }
REFIID riid
Definition: precomp.h:44
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ DocumentSite_Release()

static ULONG WINAPI DocumentSite_Release ( IOleDocumentSite iface)
static

Definition at line 2545 of file events.c.

2546 {
2547  return 1;
2548 }

◆ elem2_cp()

static HRESULT WINAPI elem2_cp ( IDispatchEx *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pVarResult,
EXCEPINFO *  pei,
UINT puArgErr 
)
static

Definition at line 1317 of file events.c.

1319 {
1320  switch(dispIdMember) {
1322  CHECK_EXPECT(elem2_cp_onclick);
1323  test_cp_eventarg(riid, wFlags, pdp, pVarResult, pei, puArgErr);
1324  break;
1325  default:
1326  ok(0, "unexpected call %d\n", dispIdMember);
1327  return E_NOTIMPL;
1328  }
1329 
1330  return S_OK;
1331 }
REFIID riid
Definition: precomp.h:44
#define CHECK_EXPECT(func)
Definition: events.c:36
#define ok(value,...)
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define test_cp_eventarg(a, b, c, d, e, f)
Definition: events.c:1253
#define DISPID_HTMLDOCUMENTEVENTS_ONCLICK
Definition: mshtmdid.h:860

◆ EVENT_HANDLER_FUNC_OBJ() [1/20]

EVENT_HANDLER_FUNC_OBJ ( document_onclick  )

◆ EVENT_HANDLER_FUNC_OBJ() [2/20]

EVENT_HANDLER_FUNC_OBJ ( div_onclick  )

◆ EVENT_HANDLER_FUNC_OBJ() [3/20]

EVENT_HANDLER_FUNC_OBJ ( div_onclick_attached  )

◆ EVENT_HANDLER_FUNC_OBJ() [4/20]

EVENT_HANDLER_FUNC_OBJ ( doc_onclick_attached  )

◆ EVENT_HANDLER_FUNC_OBJ() [5/20]

EVENT_HANDLER_FUNC_OBJ ( body_onclick  )

◆ EVENT_HANDLER_FUNC_OBJ() [6/20]

EVENT_HANDLER_FUNC_OBJ ( img_onload  )

◆ EVENT_HANDLER_FUNC_OBJ() [7/20]

EVENT_HANDLER_FUNC_OBJ ( img_onerror  )

◆ EVENT_HANDLER_FUNC_OBJ() [8/20]

EVENT_HANDLER_FUNC_OBJ ( input_onfocus  )

◆ EVENT_HANDLER_FUNC_OBJ() [9/20]

EVENT_HANDLER_FUNC_OBJ ( input_onblur  )

◆ EVENT_HANDLER_FUNC_OBJ() [10/20]

EVENT_HANDLER_FUNC_OBJ ( form_onsubmit  )

◆ EVENT_HANDLER_FUNC_OBJ() [11/20]

EVENT_HANDLER_FUNC_OBJ ( form_onclick  )

◆ EVENT_HANDLER_FUNC_OBJ() [12/20]

EVENT_HANDLER_FUNC_OBJ ( submit_onclick  )

◆ EVENT_HANDLER_FUNC_OBJ() [13/20]

EVENT_HANDLER_FUNC_OBJ ( iframe_onload  )

◆ EVENT_HANDLER_FUNC_OBJ() [14/20]

EVENT_HANDLER_FUNC_OBJ ( submit_onclick_attached  )

◆ EVENT_HANDLER_FUNC_OBJ() [15/20]

EVENT_HANDLER_FUNC_OBJ ( submit_onclick_attached_check_cancel  )

◆ EVENT_HANDLER_FUNC_OBJ() [16/20]

EVENT_HANDLER_FUNC_OBJ ( submit_onclick_setret  )

◆ EVENT_HANDLER_FUNC_OBJ() [17/20]

EVENT_HANDLER_FUNC_OBJ ( submit_onclick_cancel  )

◆ EVENT_HANDLER_FUNC_OBJ() [18/20]

EVENT_HANDLER_FUNC_OBJ ( iframedoc_onreadystatechange  )

◆ EVENT_HANDLER_FUNC_OBJ() [19/20]

EVENT_HANDLER_FUNC_OBJ ( iframe_onreadystatechange  )

◆ EVENT_HANDLER_FUNC_OBJ() [20/20]

EVENT_HANDLER_FUNC_OBJ ( nocall  )

◆ EventDispatch_AddRef()

static DWORD WINAPI EventDispatch_AddRef ( IDispatch iface)
static

Definition at line 1473 of file events.c.

1474 {
1475  return 2;
1476 }

◆ EventDispatch_GetIDsOfNames()

static HRESULT WINAPI EventDispatch_GetIDsOfNames ( IDispatch iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1495 of file events.c.

1497 {
1498  ok(0, "Unexpected call\n");
1499  return E_NOTIMPL;
1500 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EventDispatch_GetTypeInfo()

static HRESULT WINAPI EventDispatch_GetTypeInfo ( IDispatch iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1489 of file events.c.

1490 {
1491  ok(0, "Unexpected call\n");
1492  return E_NOTIMPL;
1493 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EventDispatch_GetTypeInfoCount()

static HRESULT WINAPI EventDispatch_GetTypeInfoCount ( IDispatch iface,
UINT pctinfo 
)
static

Definition at line 1483 of file events.c.

1484 {
1485  ok(0, "Unexpected call\n");
1486  return E_NOTIMPL;
1487 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ EventDispatch_Invoke()

static HRESULT WINAPI EventDispatch_Invoke ( IDispatch iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1502 of file events.c.

1505 {
1506  ok(IsEqualGUID(&IID_NULL, riid), "riid = %s\n", wine_dbgstr_guid(riid));
1507  ok(pDispParams != NULL, "pDispParams == NULL\n");
1508  ok(pExcepInfo != NULL, "pExcepInfo == NULL\n");
1509  ok(puArgErr != NULL, "puArgErr == NULL\n");
1510  ok(V_VT(pVarResult) == 0, "V_VT(pVarResult) = %d\n", V_VT(pVarResult));
1511  ok(wFlags == DISPATCH_METHOD, "wFlags = %d\n", wFlags);
1512 
1513  switch(dispIdMember) {
1515  CHECK_EXPECT2(invoke_onclick);
1516  break;
1519  case 1027:
1520  case 1034:
1521  case 1037:
1522  case 1044:
1523  case 1045:
1524  case 1047:
1525  case 1048:
1526  case 1049:
1527  break; /* TODO */
1528  default:
1529  ok(0, "Unexpected call: %d\n", dispIdMember);
1530  }
1531 
1532  return S_OK;
1533 }
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define DISPID_HTMLDOCUMENTEVENTS2_ONREADYSTATECHANGE
Definition: mshtmdid.h:910
#define DISPID_HTMLDOCUMENTEVENTS2_ONPROPERTYCHANGE
Definition: mshtmdid.h:923
#define IID_NULL
Definition: guiddef.h:93
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define CHECK_EXPECT2(func)
Definition: events.c:29
#define DISPID_HTMLDOCUMENTEVENTS_ONCLICK
Definition: mshtmdid.h:860

◆ EventDispatch_QueryInterface()

static HRESULT WINAPI EventDispatch_QueryInterface ( IDispatch iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1462 of file events.c.

1463 {
1465  *ppv = iface;
1466  return S_OK;
1467  }
1468 
1469  ok(0, "Unexpected call\n");
1470  return E_NOINTERFACE;
1471 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define ok(value,...)
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ EventDispatch_Release()

static DWORD WINAPI EventDispatch_Release ( IDispatch iface)
static

Definition at line 1478 of file events.c.

1479 {
1480  return 1;
1481 }

◆ find_element_by_id()

static IHTMLElement* find_element_by_id ( IHTMLDocument2 *  doc,
const char id 
)
static

Definition at line 2122 of file events.c.

2123 {
2124  HRESULT hres;
2125  IHTMLDocument3 *doc3;
2126  IHTMLElement *result;
2127  BSTR idW = a2bstr(id);
2128 
2129  hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument3, (void**)&doc3);
2130  ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument3) failed: %08x\n", hres);
2131 
2132  hres = IHTMLDocument3_getElementById(doc3, idW, &result);
2133  ok(hres == S_OK, "getElementById failed: %08x\n", hres);
2134  ok(result != NULL, "result == NULL\n");
2135  SysFreeString(idW);
2136 
2137  IHTMLDocument3_Release(doc3);
2138  return result;
2139 }
OLECHAR * BSTR
Definition: compat.h:1934
static BSTR a2bstr(const char *str)
Definition: events.c:123
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
GLuint64EXT * result
Definition: glext.h:11304

Referenced by test_iframe_connections().

◆ form_onclick()

static HRESULT WINAPI form_onclick ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 971 of file events.c.

973 {
975  test_event_args(NULL, id, wFlags, pdp, pvarRes, pei, pspCaller);
976 
977  return S_OK;
978 }
#define CHECK_EXPECT(func)
Definition: events.c:36
smooth NULL
Definition: ftsmooth.c:416
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define test_event_args(a, b, c, d, e, f, g)
Definition: events.c:321
static HRESULT WINAPI form_onclick(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:971

Referenced by test_submit().

◆ form_onsubmit()

static HRESULT WINAPI form_onsubmit ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 957 of file events.c.

959 {
961  test_event_args(NULL, id, wFlags, pdp, pvarRes, pei, pspCaller);
962  test_event_src("FORM");
963 
964  V_VT(pvarRes) = VT_BOOL;
965  V_BOOL(pvarRes) = VARIANT_FALSE;
966  return S_OK;
967 }
#define CHECK_EXPECT(func)
Definition: events.c:36
smooth NULL
Definition: ftsmooth.c:416
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
#define test_event_src(t)
Definition: events.c:379
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define test_event_args(a, b, c, d, e, f, g)
Definition: events.c:321
static HRESULT WINAPI form_onsubmit(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: events.c:957

Referenced by test_submit().

◆ get_cp()

static IConnectionPoint* get_cp ( IUnknown unk,
REFIID  riid 
)
static

Definition at line 1421 of file events.c.

1422 {
1423  IConnectionPointContainer *cp_container;
1425  HRESULT hres;
1426 
1427  hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&cp_container);
1428  ok(hres == S_OK, "Could not get IConnectionPointContainer: %08x\n", hres);
1429 
1430  hres = IConnectionPointContainer_FindConnectionPoint(cp_container, riid, &cp);
1431  IConnectionPointContainer_Release(cp_container);
1432  ok(hres == S_OK, "FindConnectionPoint failed: %08x\n",