Skip to content

Commit

Permalink
mshtml: Don't handle special case when doc != node->doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan McGrath authored and julliard committed Feb 29, 2024
1 parent 74ff9f2 commit 57c2c41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dlls/mshtml/nsevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ static nsresult handle_htmlevent(HTMLDocumentNode *doc, nsIDOMEvent *nsevent)
nsIDOMEventTarget *event_target;
EventTarget *target;
nsIDOMNode *nsnode;
HTMLDOMNode *node = NULL;
DOMEvent *event;
nsresult nsres;
HRESULT hres;
Expand All @@ -436,7 +437,6 @@ static nsresult handle_htmlevent(HTMLDocumentNode *doc, nsIDOMEvent *nsevent)
target = &doc->window->event_target;
IHTMLWindow2_AddRef(&doc->window->base.IHTMLWindow2_iface);
}else {
HTMLDOMNode *node;
hres = get_node(nsnode, TRUE, &node);
nsIDOMNode_Release(nsnode);
if(FAILED(hres))
Expand All @@ -451,7 +451,7 @@ static nsresult handle_htmlevent(HTMLDocumentNode *doc, nsIDOMEvent *nsevent)
}

/* If we fine need for more special cases here, we may consider handling it in a more generic way. */
if(event->event_id == EVENTID_FOCUS || event->event_id == EVENTID_BLUR) {
if((!node || doc == node->doc) && (event->event_id == EVENTID_FOCUS || event->event_id == EVENTID_BLUR)) {
DOMEvent *focus_event;

hres = create_document_event(doc, event->event_id == EVENTID_FOCUS ? EVENTID_FOCUSIN : EVENTID_FOCUSOUT, &focus_event);
Expand Down

0 comments on commit 57c2c41

Please sign in to comment.