summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/node.c19
1 files 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);
}