From 2bffe9af8d5e6360dc1e977535d41acf2e64c649 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 25 Oct 2017 18:13:54 +0200 Subject: [PATCH] mshtml: Added support for capturing event phase. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmlevent.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 778b6929763..a3359e01e1d 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1551,8 +1551,15 @@ void dispatch_event(EventTarget *event_target, DOMEvent *event) event->target = event_target; IDispatchEx_AddRef(&event_target->dispex.IDispatchEx_iface); - event->phase = DEP_AT_TARGET; - call_event_handlers(target_chain[0], event); + event->phase = DEP_CAPTURING_PHASE; + i = chain_cnt-1; + while(!event->stop_propagation && i) + call_event_handlers(target_chain[i--], event); + + if(!event->stop_propagation) { + event->phase = DEP_AT_TARGET; + call_event_handlers(target_chain[0], event); + } if(event_flags & EVENT_BUBBLES) { event->phase = DEP_BUBBLING_PHASE;