mshtml: Moved getting event target data pointer to DispatchEx vtbl.

This commit is contained in:
Jacek Caban 2015-05-14 13:24:34 +02:00 committed by Alexandre Julliard
parent f908f03cd9
commit a1d837c341
4 changed files with 19 additions and 6 deletions

View File

@ -824,13 +824,13 @@ static void HTMLBodyElement_unlink(HTMLDOMNode *iface)
}
}
static event_target_t **HTMLBodyElement_get_event_target(HTMLDOMNode *iface)
static event_target_t **HTMLBodyElement_get_event_target_ptr(HTMLDOMNode *iface)
{
HTMLBodyElement *This = impl_from_HTMLDOMNode(iface);
return This->textcont.element.node.doc
? &This->textcont.element.node.doc->body_event_target
: &This->textcont.element.node.event_target;
: &This->textcont.element.node.event_target.ptr;
}
static BOOL HTMLBodyElement_is_text_edit(HTMLDOMNode *iface)
@ -852,7 +852,7 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = {
HTMLElement_clone,
HTMLElement_handle_event,
HTMLElement_get_attr_col,
HTMLBodyElement_get_event_target,
HTMLBodyElement_get_event_target_ptr,
NULL,
NULL,
NULL,

View File

@ -3988,6 +3988,14 @@ static HRESULT HTMLElement_populate_props(DispatchEx *dispex)
return S_OK;
}
static event_target_t **HTMLElement_get_event_target_ptr(DispatchEx *dispex)
{
HTMLElement *This = impl_from_DispatchEx(dispex);
return This->node.vtbl->get_event_target_ptr
? This->node.vtbl->get_event_target_ptr(&This->node)
: &This->node.event_target.ptr;
}
static const tid_t HTMLElement_iface_tids[] = {
HTMLELEMENT_TIDS,
0
@ -3997,7 +4005,8 @@ static dispex_static_data_vtbl_t HTMLElement_dispex_vtbl = {
NULL,
HTMLElement_get_dispid,
HTMLElement_invoke,
HTMLElement_populate_props
HTMLElement_populate_props,
HTMLElement_get_event_target_ptr
};
static dispex_static_data_t HTMLElement_dispex = {

View File

@ -73,7 +73,9 @@ void detach_nsevent(HTMLDocumentNode*,const WCHAR*) DECLSPEC_HIDDEN;
static inline event_target_t **get_node_event_target(HTMLDOMNode *node)
{
return node->vtbl->get_event_target ? node->vtbl->get_event_target(node) : &node->event_target.ptr;
return node->event_target.dispex.data->vtbl->get_event_target_ptr
? node->event_target.dispex.data->vtbl->get_event_target_ptr(&node->event_target.dispex)
: &node->event_target.ptr;
}
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)

View File

@ -230,6 +230,8 @@ typedef struct {
HRESULT (*get_dispid)(DispatchEx*,BSTR,DWORD,DISPID*);
HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*);
HRESULT (*populate_props)(DispatchEx*);
/* We abuse this vtbl for EventTarget functions to avoid separated vtbl. */
event_target_t **(*get_event_target_ptr)(DispatchEx*);
} dispex_static_data_vtbl_t;
typedef struct {
@ -642,7 +644,7 @@ typedef struct {
HRESULT (*clone)(HTMLDOMNode*,nsIDOMNode*,HTMLDOMNode**);
HRESULT (*handle_event)(HTMLDOMNode*,DWORD,nsIDOMEvent*,BOOL*);
HRESULT (*get_attr_col)(HTMLDOMNode*,HTMLAttributeCollection**);
event_target_t **(*get_event_target)(HTMLDOMNode*);
event_target_t **(*get_event_target_ptr)(HTMLDOMNode*);
HRESULT (*fire_event)(HTMLDOMNode*,DWORD,BOOL*);
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);