about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-22 21:41:25 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-22 21:41:25 +0200
commit03ac991def7e517ef2e035beed8bd6d4338b07a0 (patch)
treeb73adaacc69cf7e5376af3711a09869d59c698e2
parent6ab23760e27a590c753965debe2d51f7f4640e25 (diff)
downloadchawan-03ac991def7e517ef2e035beed8bd6d4338b07a0.tar.gz
dom: fix wrong proc call in fireEvent
dispatchEvent is for JS only, since it unsets isTrusted.
-rw-r--r--src/html/dom.nim2
-rw-r--r--src/html/event.nim2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index d1b8d249..0e3c83ee 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -2467,7 +2467,7 @@ windowConsoleError = proc(ctx: JSContext; ss: varargs[string]) =
 
 proc fireEvent*(window: Window; name: StaticAtom; target: EventTarget) =
   let event = newEvent(window.toAtom(name), target)
-  discard window.jsctx.dispatchEvent(target, event)
+  discard window.jsctx.dispatch(target, event)
 
 proc parseColor(element: Element; s: string): ARGBColor =
   let cval = parseComponentValue(s)
diff --git a/src/html/event.nim b/src/html/event.nim
index 04b7fb67..67131e63 100644
--- a/src/html/event.nim
+++ b/src/html/event.nim
@@ -326,7 +326,7 @@ proc dispatch*(ctx: JSContext; target: EventTarget; event: Event): bool =
   event.flags.excl(efDispatch)
   return canceled
 
-proc dispatchEvent*(ctx: JSContext; this: EventTarget; event: Event):
+proc dispatchEvent(ctx: JSContext; this: EventTarget; event: Event):
     DOMResult[bool] {.jsfunc.} =
   if efDispatch in event.flags:
     return errDOMException("Event's dispatch flag is already set",