[PATCH 7/9] mshtml: Added support for capturing event phase.

Jacek Caban <[email protected]>
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
Signed-off-by: Jacek Caban <[email protected]>
---
 dlls/mshtml/htmlevent.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
0007-mshtml-Added-support-for-capturing-event-phase.diff (text/x-patch, 819 B)
diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c
index 778b692976..a3359e01e1 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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.