Implement DOM event system: addEventListener, dispatch, bubbling
Implements the W3C DOM event model connecting JavaScript event handlers
to the DOM tree with full capture/target/bubble phase propagation.
- Event constructor: new Event(type, options) with bubbles/cancelable
- Event methods: preventDefault, stopPropagation, stopImmediatePropagation
- EventTarget methods on all node wrappers and document:
addEventListener, removeEventListener, dispatchEvent
- Event propagation: capture phase -> at-target -> bubble phase
- Support for capture option (boolean or options object)
- Support for once option (auto-remove after first invocation)
- Event listener GcRefs registered as GC roots
- 20 new tests covering all acceptance criteria
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
authored by
tangled.org
1c17a938
bba4f8e6