Implements the event dispatch infrastructure enabling JS scripts to register event listeners and respond to click events with DOM-spec-compliant bubbling. Key additions: - Function expression parsing (anonymous and named) in js_parser - Function identity via monotonic u64 IDs on JsFunction for removeEventListener - call_function_with_host on JsVm that isolates handler errors (stays Primed, never Failed) - EventListenerRegistry with addEventListener/removeEventListener deduplication - DomEvent model with preventDefault/stopPropagation support - Event dispatch algorithm: target phase + bubble phase with listener snapshots - 11 integration tests covering click handlers, bubbling, error recovery, and event properties Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
17 lines
269 B
TOML
17 lines
269 B
TOML
[package]
|
|
name = "web_api"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
dom = { path = "../dom" }
|
|
js = { path = "../js" }
|
|
shared = { path = "../shared" }
|
|
tracing.workspace = true
|
|
|
|
[dev-dependencies]
|
|
js_parser = { path = "../js_parser" }
|
|
|
|
[lints]
|
|
workspace = true
|