From c73b135686d145c760c9c66622489ca4dbd81c4c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 25 Jun 2012 14:06:27 +0200 Subject: [PATCH] mshtml: Store event object in HTMLInnerWindow instead of HTMLOuterWindow. --- dlls/mshtml/htmlevent.c | 10 ++++++---- dlls/mshtml/htmlwindow.c | 2 +- dlls/mshtml/mshtml_private.h | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 4b201c4c463..ca966ba32af 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -989,6 +989,7 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode IHTMLEventObj *prev_event; nsIDOMNode *parent, *nsnode; BOOL prevent_default = FALSE; + HTMLInnerWindow *window; HTMLDOMNode *node; PRUint16 node_type; nsresult nsres; @@ -996,7 +997,8 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode TRACE("(%p) %s\n", doc, debugstr_w(event_info[eid].name)); - prev_event = doc->basedoc.window->event; + window = doc->basedoc.window->base.inner_window; + prev_event = window->event; if(set_event) { hres = get_node(doc, target, TRUE, &node); if(FAILED(hres)) @@ -1004,9 +1006,9 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode event_obj = create_event(node, eid, nsevent); node_release(node); - doc->basedoc.window->event = &event_obj->IHTMLEventObj_iface; + window->event = &event_obj->IHTMLEventObj_iface; }else { - doc->basedoc.window->event = NULL; + window->event = NULL; } nsIDOMNode_GetNodeType(target, &node_type); @@ -1070,7 +1072,7 @@ void fire_event(HTMLDocumentNode *doc, eventid_t eid, BOOL set_event, nsIDOMNode if(event_obj && event_obj->prevent_default) prevent_default = TRUE; - doc->basedoc.window->event = prev_event; + window->event = prev_event; if(event_obj) IHTMLEventObj_Release(&event_obj->IHTMLEventObj_iface); diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index c20d765d5b9..dc6d9af92a1 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1027,7 +1027,7 @@ static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocumen static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p) { HTMLWindow *This = impl_from_IHTMLWindow2(iface); - HTMLOuterWindow *window = This->outer_window; + HTMLInnerWindow *window = This->inner_window; TRACE("(%p)->(%p)\n", This, p); diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index de0a23777aa..31532cd15be 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -331,8 +331,6 @@ struct HTMLOuterWindow { IUri *uri; BSTR url; - IHTMLEventObj *event; - SCRIPTMODE scriptmode; IInternetSecurityManager *secmgr; @@ -355,6 +353,8 @@ struct HTMLInnerWindow { struct list script_hosts; + IHTMLEventObj *event; + HTMLOptionElementFactory *option_factory; global_prop_t *global_props;