mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
mshtml: Moved event_vector to HTMLWindow.
This commit is contained in:
parent
ff0d147b22
commit
4956e3edb5
@ -856,16 +856,16 @@ static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDoc
|
||||
return S_OK;
|
||||
IDispatch_AddRef(disp);
|
||||
|
||||
if(doc->nscontainer && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) {
|
||||
if(!doc->nscontainer->event_vector) {
|
||||
doc->nscontainer->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL));
|
||||
if(!doc->nscontainer->event_vector)
|
||||
if(doc->window->nswindow && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) {
|
||||
if(!doc->window->event_vector) {
|
||||
doc->window->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL));
|
||||
if(!doc->window->event_vector)
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if(!doc->nscontainer->event_vector[eid]) {
|
||||
doc->nscontainer->event_vector[eid] = TRUE;
|
||||
add_nsevent_listener(doc->nscontainer, event_info[eid].name);
|
||||
if(!doc->window->event_vector[eid]) {
|
||||
doc->window->event_vector[eid] = TRUE;
|
||||
add_nsevent_listener(doc->window, event_info[eid].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -110,6 +110,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
|
||||
for(i=0; i < This->global_prop_cnt; i++)
|
||||
heap_free(This->global_props[i].name);
|
||||
heap_free(This->global_props);
|
||||
heap_free(This->event_vector);
|
||||
release_script_hosts(This);
|
||||
list_remove(&This->entry);
|
||||
release_dispex(&This->dispex);
|
||||
|
@ -198,6 +198,7 @@ struct HTMLWindow {
|
||||
|
||||
event_target_t *event_target;
|
||||
IHTMLEventObj *event;
|
||||
BOOL *event_vector;
|
||||
|
||||
SCRIPTMODE scriptmode;
|
||||
struct list script_hosts;
|
||||
@ -401,8 +402,6 @@ struct NSContainer {
|
||||
|
||||
nsChannelBSC *bscallback; /* hack */
|
||||
HWND reset_focus; /* hack */
|
||||
|
||||
BOOL *event_vector;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@ -613,7 +612,7 @@ nsICommandParams *create_nscommand_params(void);
|
||||
HRESULT nsnode_to_nsstring(nsIDOMNode*,nsAString*);
|
||||
void get_editor_controller(NSContainer*);
|
||||
void init_nsevents(NSContainer*);
|
||||
void add_nsevent_listener(NSContainer*,LPCWSTR);
|
||||
void add_nsevent_listener(HTMLWindow*,LPCWSTR);
|
||||
nsresult get_nsinterface(nsISupports*,REFIID,void**);
|
||||
void update_nsdocument(HTMLDocument*);
|
||||
|
||||
|
@ -932,7 +932,6 @@ static nsrefcnt NSAPI nsWebBrowserChrome_Release(nsIWebBrowserChrome *iface)
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
if(!ref) {
|
||||
heap_free(This->event_vector);
|
||||
if(This->parent)
|
||||
nsIWebBrowserChrome_Release(NSWBCHROME(This->parent));
|
||||
heap_free(This);
|
||||
|
@ -235,26 +235,18 @@ static void init_listener(nsEventListener *This, NSContainer *container,
|
||||
This->This = container;
|
||||
}
|
||||
|
||||
void add_nsevent_listener(NSContainer *container, LPCWSTR type)
|
||||
void add_nsevent_listener(HTMLWindow *window, LPCWSTR type)
|
||||
{
|
||||
nsIDOMWindow *dom_window;
|
||||
nsIDOMEventTarget *target;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIWebBrowser_GetContentDOMWindow(container->webbrowser, &dom_window);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetContentDOMWindow failed: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIDOMWindow_QueryInterface(dom_window, &IID_nsIDOMEventTarget, (void**)&target);
|
||||
nsIDOMWindow_Release(dom_window);
|
||||
nsres = nsIDOMWindow_QueryInterface(window->nswindow, &IID_nsIDOMEventTarget, (void**)&target);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMEventTarget interface: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
init_event(target, type, NSEVENTLIST(&container->htmlevent_listener), TRUE);
|
||||
init_event(target, type, NSEVENTLIST(&window->doc->nscontainer->htmlevent_listener), TRUE);
|
||||
nsIDOMEventTarget_Release(target);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user