mshtml: Store event object in HTMLInnerWindow instead of HTMLOuterWindow.

This commit is contained in:
Jacek Caban 2012-06-25 14:06:27 +02:00 committed by Alexandre Julliard
parent bb02767f15
commit c73b135686
3 changed files with 9 additions and 7 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;