Skip to content

0007 Player DOM strategy

  • Status: accepted (2026-10-29)
  • Component elements are Lit custom elements with their own shadow root. Authored content (prompts, option text) stays in the light DOM and is slotted with manual slot assignment, so the view's DOM is never mutated.
  • Controls that must share a group (radio buttons) live in one shadow root per component, so native keyboard behaviour works.
  • <astl-player> mounts the trusted view (engine output, optionally checked against its SHA-256) into its own shadow root and talks to elements only through PlayerElementApi.
  • The player never imports the engine or definitions; a boundary check fails the build otherwise.
  • Theming: --astl-* custom properties and ::part() names declared in manifests.

Host CSS cannot break the exercise; screen readers get native controls; theming is an explicit, documented surface.