Commit d52f41ba authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved nsIDOMEventListener implementations to HTMLDocumentNode.

parent 7690ff2f
......@@ -1763,6 +1763,8 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
{
HTMLDocumentNode *This = HTMLDOCNODE_NODE_THIS(iface);
if(This->nsevent_listener)
release_nsevents(This);
if(This->secmgr)
IInternetSecurityManager_Release(This->secmgr);
......@@ -1819,11 +1821,12 @@ HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocumentObj *doc_ob
HTMLDocumentNode_SecMgr_Init(doc);
doc->ref = 1;
doc->basedoc.window = window;
nsIDOMHTMLDocument_AddRef(nsdoc);
doc->nsdoc = nsdoc;
init_mutation(doc);
doc->basedoc.window = window;
init_nsevents(doc);
list_init(&doc->bindings);
list_init(&doc->selection_list);
......
......@@ -365,11 +365,6 @@ struct HTMLDocumentObj {
DWORD update;
};
typedef struct {
const nsIDOMEventListenerVtbl *lpDOMEventListenerVtbl;
NSContainer *This;
} nsEventListener;
struct NSContainer {
const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
......@@ -380,12 +375,6 @@ struct NSContainer {
const nsIWeakReferenceVtbl *lpWeakReferenceVtbl;
const nsISupportsWeakReferenceVtbl *lpSupportsWeakReferenceVtbl;
nsEventListener blur_listener;
nsEventListener focus_listener;
nsEventListener keypress_listener;
nsEventListener load_listener;
nsEventListener htmlevent_listener;
nsIWebBrowser *webbrowser;
nsIWebNavigation *navigation;
nsIBaseWindow *window;
......@@ -479,6 +468,8 @@ typedef struct _mutation_queue_t {
struct _mutation_queue_t *next;
} mutation_queue_t;
typedef struct nsDocumentEventListener nsDocumentEventListener;
struct HTMLDocumentNode {
HTMLDOMNode node;
HTMLDocument basedoc;
......@@ -495,6 +486,7 @@ struct HTMLDocumentNode {
BOOL content_ready;
IInternetSecurityManager *secmgr;
nsDocumentEventListener *nsevent_listener;
mutation_queue_t *mutation_queue;
mutation_queue_t *mutation_queue_tail;
......@@ -656,10 +648,12 @@ void nsAString_Finish(nsAString*);
nsICommandParams *create_nscommand_params(void);
HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*);
void get_editor_controller(NSContainer*);
void init_nsevents(NSContainer*);
void add_nsevent_listener(HTMLWindow*,LPCWSTR);
nsresult get_nsinterface(nsISupports*,REFIID,void**);
void init_nsevents(HTMLDocumentNode*);
void release_nsevents(HTMLDocumentNode*);
void add_nsevent_listener(HTMLWindow*,LPCWSTR);
void set_window_bscallback(HTMLWindow*,nsChannelBSC*);
void set_current_mon(HTMLWindow*,IMoniker*);
HRESULT start_binding(HTMLWindow*,HTMLDocumentNode*,BSCallback*,IBindCtx*);
......
......@@ -955,10 +955,6 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
if(This->window)
update_window_doc(This->window);
/* events are reset when a new document URI is loaded, so re-initialise them here */
if(This->window && This->window->doc_obj->basedoc.window == This->window)
init_nsevents(This->window->doc_obj->nscontainer);
}
This->bsc.readed += This->nsstream->buf_size;
......
......@@ -1697,8 +1697,6 @@ NSContainer *NSContainer_Create(HTMLDocumentObj *doc, NSContainer *parent)
if(NS_FAILED(nsres))
ERR("SetParentURIContentListener failed: %08x\n", nsres);
init_nsevents(ret);
nsres = nsIWebBrowser_QueryInterface(ret->webbrowser, &IID_nsIScrollable, (void**)&scrollable);
if(NS_SUCCEEDED(nsres)) {
nsres = nsIScrollable_SetDefaultScrollbarPreferences(scrollable,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment