From: Gabriel Ivăncescu gabrielopcode@gmail.com
Rather than filling it during initialization, which was a bit confusing, even more later on when dispex will handle Cycle Collection.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/mshtml/htmlanchor.c | 2 +- dlls/mshtml/htmlarea.c | 2 +- dlls/mshtml/htmlbody.c | 2 +- dlls/mshtml/htmlcomment.c | 3 ++- dlls/mshtml/htmlelem.c | 5 +---- dlls/mshtml/htmlevent.h | 1 + dlls/mshtml/htmlform.c | 2 +- dlls/mshtml/htmlframe.c | 4 ++-- dlls/mshtml/htmlgeneric.c | 3 ++- dlls/mshtml/htmlhead.c | 9 +++++---- dlls/mshtml/htmlimg.c | 2 +- dlls/mshtml/htmlinput.c | 6 +++--- dlls/mshtml/htmllink.c | 2 +- dlls/mshtml/htmlobject.c | 5 +++-- dlls/mshtml/htmlscript.c | 2 +- dlls/mshtml/htmlselect.c | 4 ++-- dlls/mshtml/htmlstyleelem.c | 3 ++- dlls/mshtml/htmltable.c | 7 ++++--- dlls/mshtml/htmltextarea.c | 3 ++- 19 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/dlls/mshtml/htmlanchor.c b/dlls/mshtml/htmlanchor.c index 1e783ce007e..7620bc45d81 100644 --- a/dlls/mshtml/htmlanchor.c +++ b/dlls/mshtml/htmlanchor.c @@ -902,7 +902,7 @@ static const tid_t HTMLAnchorElement_iface_tids[] = {
static dispex_static_data_t HTMLAnchorElement_dispex = { L"HTMLAnchorElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLAnchorElement_tid, HTMLAnchorElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlarea.c b/dlls/mshtml/htmlarea.c index c518432519d..b6dbd0b28d5 100644 --- a/dlls/mshtml/htmlarea.c +++ b/dlls/mshtml/htmlarea.c @@ -509,7 +509,7 @@ static const tid_t HTMLAreaElement_iface_tids[] = { }; static dispex_static_data_t HTMLAreaElement_dispex = { L"HTMLAreaElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLAreaElement_tid, HTMLAreaElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 6338e7e907b..5ee2555e421 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -1010,7 +1010,7 @@ static const tid_t HTMLBodyElement_iface_tids[] = {
static dispex_static_data_t HTMLBodyElement_dispex = { L"HTMLBodyElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLBody_tid, HTMLBodyElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlcomment.c b/dlls/mshtml/htmlcomment.c index cc3bec32959..705d84f4367 100644 --- a/dlls/mshtml/htmlcomment.c +++ b/dlls/mshtml/htmlcomment.c @@ -27,6 +27,7 @@ #include "ole2.h"
#include "mshtml_private.h" +#include "htmlevent.h"
#include "wine/debug.h"
@@ -200,7 +201,7 @@ static const tid_t HTMLCommentElement_iface_tids[] = { }; static dispex_static_data_t HTMLCommentElement_dispex = { L"Comment", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLCommentElement_tid, HTMLCommentElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index ad5bda63665..53c418ab333 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -7326,7 +7326,7 @@ static const tid_t HTMLElement_iface_tids[] = { 0 };
-static event_target_vtbl_t HTMLElement_event_target_vtbl = { +const event_target_vtbl_t HTMLElement_event_target_vtbl = { { NULL, HTMLElement_get_dispid, @@ -7946,9 +7946,6 @@ void HTMLElement_Init(HTMLElement *This, HTMLDocumentNode *doc, nsIDOMElement *n This->IProvideMultipleClassInfo_iface.lpVtbl = &ProvideMultipleClassInfoVtbl; This->IWineHTMLElementPrivate_iface.lpVtbl = &WineHTMLElementPrivateVtbl;
- if(dispex_data && !dispex_data->vtbl) - dispex_data->vtbl = &HTMLElement_event_target_vtbl.dispex_vtbl; - if(nselem) { nsIDOMHTMLElement *html_element; nsresult nsres; diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index 5a46b855a30..5e2c7a0a054 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -138,6 +138,7 @@ typedef struct { IHTMLEventObj *(*set_current_event)(DispatchEx*,IHTMLEventObj*); } event_target_vtbl_t;
+extern const event_target_vtbl_t HTMLElement_event_target_vtbl; IHTMLEventObj *default_set_current_event(HTMLInnerWindow*,IHTMLEventObj*);
static inline EventTarget *get_node_event_prop_target(HTMLDOMNode *node, eventid_t eid) diff --git a/dlls/mshtml/htmlform.c b/dlls/mshtml/htmlform.c index 3e7ca112311..385cc6f9834 100644 --- a/dlls/mshtml/htmlform.c +++ b/dlls/mshtml/htmlform.c @@ -1007,7 +1007,7 @@ static const tid_t HTMLFormElement_iface_tids[] = {
static dispex_static_data_t HTMLFormElement_dispex = { L"HTMLFormElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLFormElement_tid, HTMLFormElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 9be69c29f9a..acc5dbad8ca 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -1043,7 +1043,7 @@ static const tid_t HTMLFrameElement_iface_tids[] = {
static dispex_static_data_t HTMLFrameElement_dispex = { L"HTMLFrameElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLFrameElement_tid, HTMLFrameElement_iface_tids, HTMLElement_init_dispex_info @@ -1638,7 +1638,7 @@ static const tid_t HTMLIFrame_iface_tids[] = {
static dispex_static_data_t HTMLIFrame_dispex = { L"HTMLIFrameElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLIFrame_tid, HTMLIFrame_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlgeneric.c b/dlls/mshtml/htmlgeneric.c index 9244ba017fb..4666348fddb 100644 --- a/dlls/mshtml/htmlgeneric.c +++ b/dlls/mshtml/htmlgeneric.c @@ -29,6 +29,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@@ -169,7 +170,7 @@ static const tid_t HTMLGenericElement_iface_tids[] = {
static dispex_static_data_t HTMLGenericElement_dispex = { L"HTMLUnknownElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLGenericElement_tid, HTMLGenericElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlhead.c b/dlls/mshtml/htmlhead.c index 072efd967b9..1ef183338c7 100644 --- a/dlls/mshtml/htmlhead.c +++ b/dlls/mshtml/htmlhead.c @@ -29,6 +29,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@@ -184,7 +185,7 @@ static const tid_t HTMLTitleElement_iface_tids[] = { }; static dispex_static_data_t HTMLTitleElement_dispex = { L"HTMLTitleElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLTitleElement_tid, HTMLTitleElement_iface_tids, HTMLElement_init_dispex_info @@ -369,7 +370,7 @@ static const tid_t HTMLHtmlElement_iface_tids[] = { }; static dispex_static_data_t HTMLHtmlElement_dispex = { L"HTMLHtmlElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLHtmlElement_tid, HTMLHtmlElement_iface_tids, HTMLElement_init_dispex_info @@ -606,7 +607,7 @@ static const tid_t HTMLMetaElement_iface_tids[] = {
static dispex_static_data_t HTMLMetaElement_dispex = { L"HTMLMetaElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLMetaElement_tid, HTMLMetaElement_iface_tids, HTMLElement_init_dispex_info @@ -770,7 +771,7 @@ static const tid_t HTMLHeadElement_iface_tids[] = { }; static dispex_static_data_t HTMLHeadElement_dispex = { L"HTMLHeadElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLHeadElement_tid, HTMLHeadElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlimg.c b/dlls/mshtml/htmlimg.c index 50fa3531464..47fc2be8d5d 100644 --- a/dlls/mshtml/htmlimg.c +++ b/dlls/mshtml/htmlimg.c @@ -742,7 +742,7 @@ static void HTMLImgElement_init_dispex_info(dispex_data_t *info, compat_mode_t m
static dispex_static_data_t HTMLImgElement_dispex = { L"HTMLImageElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLImg_tid, HTMLImgElement_iface_tids, HTMLImgElement_init_dispex_info diff --git a/dlls/mshtml/htmlinput.c b/dlls/mshtml/htmlinput.c index c220a2495c7..4d59cf4f158 100644 --- a/dlls/mshtml/htmlinput.c +++ b/dlls/mshtml/htmlinput.c @@ -1456,7 +1456,7 @@ static const tid_t HTMLInputElement_iface_tids[] = { }; static dispex_static_data_t HTMLInputElement_dispex = { L"HTMLInputElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLInputElement_tid, HTMLInputElement_iface_tids, HTMLElement_init_dispex_info @@ -1653,7 +1653,7 @@ static const tid_t HTMLLabelElement_iface_tids[] = {
static dispex_static_data_t HTMLLabelElement_dispex = { L"HTMLLabelElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLLabelElement_tid, HTMLLabelElement_iface_tids, HTMLElement_init_dispex_info @@ -2001,7 +2001,7 @@ static const tid_t HTMLButtonElement_iface_tids[] = {
static dispex_static_data_t HTMLButtonElement_dispex = { L"HTMLButtonElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLButtonElement_tid, HTMLButtonElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmllink.c b/dlls/mshtml/htmllink.c index 124507a2fc9..d5ae5932e0e 100644 --- a/dlls/mshtml/htmllink.c +++ b/dlls/mshtml/htmllink.c @@ -448,7 +448,7 @@ static const tid_t HTMLLinkElement_iface_tids[] = { }; static dispex_static_data_t HTMLLinkElement_dispex = { L"HTMLLinkElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLLinkElement_tid, HTMLLinkElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c index 9e30b5426fb..6e29ccd640c 100644 --- a/dlls/mshtml/htmlobject.c +++ b/dlls/mshtml/htmlobject.c @@ -29,6 +29,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h" #include "pluginhost.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -777,7 +778,7 @@ static const tid_t HTMLObjectElement_iface_tids[] = { }; static dispex_static_data_t HTMLObjectElement_dispex = { L"HTMLObjectElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLObjectElement_tid, HTMLObjectElement_iface_tids, HTMLElement_init_dispex_info @@ -1040,7 +1041,7 @@ static const tid_t HTMLEmbedElement_iface_tids[] = { }; static dispex_static_data_t HTMLEmbedElement_dispex = { L"HTMLEmbedElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLEmbed_tid, HTMLEmbedElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlscript.c b/dlls/mshtml/htmlscript.c index 2ef21fbfb0a..42cf63c47bd 100644 --- a/dlls/mshtml/htmlscript.c +++ b/dlls/mshtml/htmlscript.c @@ -481,7 +481,7 @@ static const tid_t HTMLScriptElement_iface_tids[] = {
static dispex_static_data_t HTMLScriptElement_dispex = { L"HTMLScriptElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLScriptElement_tid, HTMLScriptElement_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlselect.c b/dlls/mshtml/htmlselect.c index bbe6fadebba..dd1c784c28d 100644 --- a/dlls/mshtml/htmlselect.c +++ b/dlls/mshtml/htmlselect.c @@ -419,7 +419,7 @@ static const tid_t HTMLOptionElement_iface_tids[] = { }; static dispex_static_data_t HTMLOptionElement_dispex = { L"HTMLOptionElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLOptionElement_tid, HTMLOptionElement_iface_tids, HTMLElement_init_dispex_info @@ -1496,7 +1496,7 @@ static const tid_t HTMLSelectElement_tids[] = {
static dispex_static_data_t HTMLSelectElement_dispex = { L"HTMLSelectElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLSelectElement_tid, HTMLSelectElement_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmlstyleelem.c b/dlls/mshtml/htmlstyleelem.c index abd720cc18f..434afcd46e3 100644 --- a/dlls/mshtml/htmlstyleelem.c +++ b/dlls/mshtml/htmlstyleelem.c @@ -29,6 +29,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h" #include "mshtmdid.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml); @@ -464,7 +465,7 @@ static const tid_t HTMLStyleElement_iface_tids[] = { }; static dispex_static_data_t HTMLStyleElement_dispex = { L"HTMLStyleElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLStyleElement_tid, HTMLStyleElement_iface_tids, HTMLStyleElement_init_dispex_info diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c index 1afb32ea6ec..3cadc75b90d 100644 --- a/dlls/mshtml/htmltable.c +++ b/dlls/mshtml/htmltable.c @@ -28,6 +28,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@@ -522,7 +523,7 @@ static const tid_t HTMLTableCell_iface_tids[] = {
static dispex_static_data_t HTMLTableCell_dispex = { L"HTMLTableDataCellElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLTableCell_tid, HTMLTableCell_iface_tids, HTMLElement_init_dispex_info @@ -968,7 +969,7 @@ static const tid_t HTMLTableRow_iface_tids[] = {
static dispex_static_data_t HTMLTableRow_dispex = { L"HTMLTableRowElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLTableRow_tid, HTMLTableRow_iface_tids, HTMLElement_init_dispex_info @@ -2002,7 +2003,7 @@ static const tid_t HTMLTable_iface_tids[] = {
static dispex_static_data_t HTMLTable_dispex = { L"HTMLTableElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLTable_tid, HTMLTable_iface_tids, HTMLElement_init_dispex_info diff --git a/dlls/mshtml/htmltextarea.c b/dlls/mshtml/htmltextarea.c index 5820c0c7291..98468685eab 100644 --- a/dlls/mshtml/htmltextarea.c +++ b/dlls/mshtml/htmltextarea.c @@ -28,6 +28,7 @@ #include "wine/debug.h"
#include "mshtml_private.h" +#include "htmlevent.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
@@ -481,7 +482,7 @@ static const tid_t HTMLTextAreaElement_iface_tids[] = {
static dispex_static_data_t HTMLTextAreaElement_dispex = { L"HTMLTextAreaElement", - NULL, + &HTMLElement_event_target_vtbl.dispex_vtbl, DispHTMLTextAreaElement_tid, HTMLTextAreaElement_iface_tids, HTMLElement_init_dispex_info