mshtml: Try to avoid use_event_quirks in call_event_handlers if possible.
It may cause an unintended lock on document mode. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3099fda254
commit
adcb216208
|
@ -2301,25 +2301,27 @@ static BOOL is_cp_event(cp_static_data_t *data, DISPID dispid)
|
||||||
static void call_event_handlers(EventTarget *event_target, DOMEvent *event, dispatch_mode_t dispatch_mode)
|
static void call_event_handlers(EventTarget *event_target, DOMEvent *event, dispatch_mode_t dispatch_mode)
|
||||||
{
|
{
|
||||||
const listener_container_t *container = get_listener_container(event_target, event->type, FALSE);
|
const listener_container_t *container = get_listener_container(event_target, event->type, FALSE);
|
||||||
const BOOL use_quirks = use_event_quirks(event_target);
|
|
||||||
event_listener_t *listener, listeners_buf[8], *listeners = listeners_buf;
|
event_listener_t *listener, listeners_buf[8], *listeners = listeners_buf;
|
||||||
unsigned listeners_cnt, listeners_size;
|
unsigned listeners_cnt, listeners_size;
|
||||||
ConnectionPointContainer *cp_container = NULL;
|
ConnectionPointContainer *cp_container = NULL;
|
||||||
const event_target_vtbl_t *vtbl = NULL;
|
const event_target_vtbl_t *vtbl = NULL;
|
||||||
|
BOOL skip_onevent_listener = FALSE;
|
||||||
VARIANT v;
|
VARIANT v;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
assert(!event->current_target);
|
assert(!event->current_target);
|
||||||
event->current_target = event_target;
|
event->current_target = event_target;
|
||||||
|
|
||||||
if(use_quirks && container && !list_empty(&container->listeners)
|
if(container && !list_empty(&container->listeners) && event->phase != DEP_CAPTURING_PHASE) {
|
||||||
&& event->phase != DEP_CAPTURING_PHASE) {
|
|
||||||
listener = LIST_ENTRY(list_tail(&container->listeners), event_listener_t, entry);
|
listener = LIST_ENTRY(list_tail(&container->listeners), event_listener_t, entry);
|
||||||
if(listener && listener->function && listener->type == LISTENER_TYPE_ONEVENT) {
|
if(listener && listener->function && listener->type == LISTENER_TYPE_ONEVENT
|
||||||
|
&& use_event_quirks(event_target)) {
|
||||||
DISPID named_arg = DISPID_THIS;
|
DISPID named_arg = DISPID_THIS;
|
||||||
VARIANTARG arg;
|
VARIANTARG arg;
|
||||||
DISPPARAMS dp = {&arg, &named_arg, 1, 1};
|
DISPPARAMS dp = {&arg, &named_arg, 1, 1};
|
||||||
|
|
||||||
|
skip_onevent_listener = TRUE;
|
||||||
|
|
||||||
V_VT(&arg) = VT_DISPATCH;
|
V_VT(&arg) = VT_DISPATCH;
|
||||||
V_DISPATCH(&arg) = (IDispatch*)&event_target->dispex.IDispatchEx_iface;
|
V_DISPATCH(&arg) = (IDispatch*)&event_target->dispex.IDispatchEx_iface;
|
||||||
V_VT(&v) = VT_EMPTY;
|
V_VT(&v) = VT_EMPTY;
|
||||||
|
@ -2353,7 +2355,7 @@ static void call_event_handlers(EventTarget *event_target, DOMEvent *event, disp
|
||||||
continue;
|
continue;
|
||||||
switch(listener->type) {
|
switch(listener->type) {
|
||||||
case LISTENER_TYPE_ONEVENT:
|
case LISTENER_TYPE_ONEVENT:
|
||||||
if(use_quirks || event->phase == DEP_CAPTURING_PHASE)
|
if(skip_onevent_listener || event->phase == DEP_CAPTURING_PHASE)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
case LISTENER_TYPE_CAPTURE:
|
case LISTENER_TYPE_CAPTURE:
|
||||||
|
|
Loading…
Reference in New Issue