How wicg/html-in-canvas works
HTML-in-Canvas is a living proposal for rendering laid-out HTML content into 2D and 3D canvases; it is not an implementation repository. The documented workflow opts DOM descendants into drawable layout, snapshots them through paint events, draws snapshots into canvas or textures, and optionally synchronizes their geometry back to DOM hit testing and accessibility. The README also describes worker transfer and asynchronous geometry updates. The tree contains illustrative examples, but no source excerpts were provided, so their internal behavior and connections are not inferred.
Main entry points: README.md Geometry updates
Components 15
DOM Layout
- Canvas content mode
README.md - Drawable subtree
README.md
Snapshots and Rendering
- Paint events
README.md - requestPaint
README.md - Element snapshots
README.md - Canvas draw APIs
README.md - ElementImage capture
README.md - WebGL and WebGPU
README.md
Geometry and Interaction
- Geometry updates
README.md - Hit testing
README.md - Accessibility geometry
README.md - Worker transfer
README.md
Examples
- HTML demos
Examples - WebGPU jelly slider
Examples/webgpu-jelly-slider
Other components
- Web author
Connections 15
- Web author → Canvas content mode: opts in
README.md - Canvas content mode → Drawable subtree: lays out
README.md - Drawable subtree → Element snapshots: records
README.md - Paint events → Element snapshots: exposes updates
README.md - Web author → requestPaint: requests repaint
README.md - requestPaint → Paint events: schedules
README.md - Web author → Canvas draw APIs: draws snapshots
README.md - Canvas draw APIs → Element snapshots: draws
README.md - Canvas draw APIs → Geometry updates: updates automatically
README.md - Web author → ElementImage capture: captures snapshot
README.md - ElementImage capture → Worker transfer: transfers to
README.md - Web author → WebGL and WebGPU: draws to texture
README.md - Web author → Geometry updates: updates explicitly
README.md - Geometry updates → Hit testing: sets hit-test state
README.md - Geometry updates → Accessibility geometry: updates geometry
README.md