Event System – Missing Event Types + Correct Dispatch #121

Open
opened 2026-06-20 08:19:57 +00:00 by Artur · 0 comments
Owner

Gap

Wir haben 12 Event-Typen implementiert. Der HTML Spec definiert ~50+. Fuer korrekte Seiten-Renderings brauchen wir alle Event-Typen (als noop-Shims erlaubt, aber die Interfaces muessen existieren).

Fehlende Event-Typen (nach Wichtigkeit)

Hohe Prioritaet (werden von Frameworks/Seiten genutzt)

  • DragEvent - Drag & Drop (React DnD, Interact.js)
  • ClipboardEvent - Clipboard API (Copy/Paste in Editoren)
  • TouchEvent - Touch Events (React, Vue, Mobile Detection)
  • BeforeUnloadEvent - beforeunload (Sites die 'Are you sure?' zeigen)
  • HashChangeEvent - hashchange (SPA Routing)
  • PopStateEvent - popstate (History API - existiert als Interface aber wird nie automatisch gefeuert)
  • StorageEvent - storage (Cross-Tab Storage Sync)
  • PageTransitionEvent - pageshow/pagehide (bfcache)
  • SecurityPolicyViolationEvent - CSP Violations (existiert in src/security/, muss auf Window registriert)

Mittlere Prioritaet

  • AnimationEvent - animationstart/animationend/animationiteration
  • TransitionEvent - transitionstart/transitionend/transitionrun/transitioncancel
  • CompositionEvent - compositionstart/compositionupdate/compositionend (IME Input)
  • MessageEvent - postMessage / WebSocket / Worker Messages (teilweise vorhanden)
  • ErrorEvent - error events auf window/document/element
  • PromiseRejectionEvent - unhandledrejection / rejectionhandled
  • GamepadEvent - Gamepad API
  • DeviceMotionEvent / DeviceOrientationEvent - Device APIs
  • SensorEvent - Generic Sensor API

Niedrige Prioritaet

  • FormDataEvent (existiert)
  • SubmitEvent (existiert)
  • ToggleEvent - toggle on details element
  • CloseEvent - close event auf dialog
  • SlotChangeEvent - slotchange (Shadow DOM)
  • TrackEvent - HTML Track
  • RTCDataChannelEvent / RTCPeerConnectionIceEvent - WebRTC

Automatisches Dispatchen

Folgende Events muessen automatisch gefeuert werden (nicht nur als Konstruktor existieren):

  • load auf window/document/element (script, img, link)
  • DOMContentLoaded auf document
  • error auf window/document/element (bei script/img/link Fehlern)
  • hashchange auf window (bei location.hash Aenderungen)
  • popstate auf window (bei history.pushState/replaceState)
  • storage (ueber OriginLocalStorage - nur im gleichen Tab, spec: same-origin andere Tabs)
  • beforeunload / unload auf window
  • scroll auf document/element (wenn scrollTop gesetzt wird - noop erlaubt)
  • resize auf window (wenn viewport sich aendert)
  • focus / blur auf element (bei .focus()/.blur()) - aktuell noop
  • submit auf form (bei .submit() oder button click)
  • reset auf form (bei .reset())

Labels

feature, html-spec

Architektur

  • src/dom/events.ts existiert, wird erweitert
  • Alle Event-Konstruktoren: keine Runtime-Logik noetig, nur Interface-Existenz
  • Auto-Dispatch: Event-Dispatch-Mechanismus in OwnWindow / OwnDocument
  • focus/blur: simple Tracker (welches Element hat aktuell Fokus)
  • error-Events: in ScriptLoader integrieren
## Gap Wir haben 12 Event-Typen implementiert. Der HTML Spec definiert ~50+. Fuer korrekte Seiten-Renderings brauchen wir alle Event-Typen (als noop-Shims erlaubt, aber die Interfaces muessen existieren). ## Fehlende Event-Typen (nach Wichtigkeit) ### Hohe Prioritaet (werden von Frameworks/Seiten genutzt) - `DragEvent` - Drag & Drop (React DnD, Interact.js) - `ClipboardEvent` - Clipboard API (Copy/Paste in Editoren) - `TouchEvent` - Touch Events (React, Vue, Mobile Detection) - `BeforeUnloadEvent` - beforeunload (Sites die 'Are you sure?' zeigen) - `HashChangeEvent` - hashchange (SPA Routing) - `PopStateEvent` - popstate (History API - existiert als Interface aber wird nie automatisch gefeuert) - `StorageEvent` - storage (Cross-Tab Storage Sync) - `PageTransitionEvent` - pageshow/pagehide (bfcache) - `SecurityPolicyViolationEvent` - CSP Violations (existiert in src/security/, muss auf Window registriert) ### Mittlere Prioritaet - `AnimationEvent` - animationstart/animationend/animationiteration - `TransitionEvent` - transitionstart/transitionend/transitionrun/transitioncancel - `CompositionEvent` - compositionstart/compositionupdate/compositionend (IME Input) - `MessageEvent` - postMessage / WebSocket / Worker Messages (teilweise vorhanden) - `ErrorEvent` - error events auf window/document/element - `PromiseRejectionEvent` - unhandledrejection / rejectionhandled - `GamepadEvent` - Gamepad API - `DeviceMotionEvent` / `DeviceOrientationEvent` - Device APIs - `SensorEvent` - Generic Sensor API ### Niedrige Prioritaet - `FormDataEvent` (existiert) - `SubmitEvent` (existiert) - `ToggleEvent` - toggle on details element - `CloseEvent` - close event auf dialog - `SlotChangeEvent` - slotchange (Shadow DOM) - `TrackEvent` - HTML Track - `RTCDataChannelEvent` / `RTCPeerConnectionIceEvent` - WebRTC ## Automatisches Dispatchen Folgende Events muessen automatisch gefeuert werden (nicht nur als Konstruktor existieren): - `load` auf window/document/element (script, img, link) - `DOMContentLoaded` auf document - `error` auf window/document/element (bei script/img/link Fehlern) - `hashchange` auf window (bei location.hash Aenderungen) - `popstate` auf window (bei history.pushState/replaceState) - `storage` (ueber OriginLocalStorage - nur im gleichen Tab, spec: same-origin andere Tabs) - `beforeunload` / `unload` auf window - `scroll` auf document/element (wenn scrollTop gesetzt wird - noop erlaubt) - `resize` auf window (wenn viewport sich aendert) - `focus` / `blur` auf element (bei .focus()/.blur()) - aktuell noop - `submit` auf form (bei .submit() oder button click) - `reset` auf form (bei .reset()) ## Labels feature, html-spec ## Architektur - src/dom/events.ts existiert, wird erweitert - Alle Event-Konstruktoren: keine Runtime-Logik noetig, nur Interface-Existenz - Auto-Dispatch: Event-Dispatch-Mechanismus in OwnWindow / OwnDocument - focus/blur: simple Tracker (welches Element hat aktuell Fokus) - error-Events: in ScriptLoader integrieren
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
glow-all/true-headless-browser#121
No description provided.