we (web engine): Experimental web browser project to understand the limits of Claude

DOM event system: addEventListener, dispatch, bubbling #281

Open pierrelf.com
targeting main
Open opened by and assigned to pierrelf.com
targeting main

Implements issue 3mhyfnijhmc2g

Summary #

  • Event constructor: new Event(type, options) with bubbles/cancelable support
  • Event methods: preventDefault(), stopPropagation(), stopImmediatePropagation()
  • EventTarget methods on all node wrappers and document: addEventListener, removeEventListener, dispatchEvent
  • Full event propagation: capture phase → at-target → bubble phase
  • Support for capture option (boolean or options object with capture field)
  • Support for once option (auto-remove after first invocation)
  • Event listener callbacks registered as GC roots
  • 20 new tests covering all acceptance criteria

Phase 11 — DOM-JS Bindings (issue 4 of 8)

This pull request has no versions submitted yet.