From 2cfac4a5dd97de052b089c1df035ee4046687cb9 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 31 Oct 2015 10:52:13 +0100 Subject: Fix end-of-event phasing --- src/core/node.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/core/node.c b/src/core/node.c index 704d7e5..abfa38c 100644 --- a/src/core/node.c +++ b/src/core/node.c @@ -2461,19 +2461,12 @@ dom_exception _dom_node_dispatch_event(dom_event_target *et, if (dei->actions == NULL) goto cleanup; - /* The end callback of default action */ - if (evt->prevent_default != true) { - dom_default_action_callback cb = dei->actions(evt->type, - DOM_DEFAULT_ACTION_END, &pw); - if (cb != NULL) { - cb(evt, pw); - } - } - - /* The prevented callback of default action */ - if (evt->prevent_default != true) { - dom_default_action_callback cb = dei->actions(evt->type, - DOM_DEFAULT_ACTION_PREVENTED, &pw); + if (dei->actions != NULL) { + dom_default_action_phase phase = DOM_DEFAULT_ACTION_END; + if (evt->prevent_default == true) + phase = DOM_DEFAULT_ACTION_PREVENTED; + dom_default_action_callback cb = dei->actions(evt->type, phase, + &pw); if (cb != NULL) { cb(evt, pw); } -- cgit v1.2.3