` as canvas children
- Physics-based Verlet integration for jelly animation
- SDF ray marching for 3D rendering
- CSS custom properties for theming (`--jelly-color`, etc.)
- Respects `prefers-reduced-motion` and `prefers-contrast`
- TypeGPU framework for WGSL shader generation
**Pattern (WebGPU):**
```js
(canvas as any).onpaint = () => {
(root.device.queue as any).copyElementImageToTexture(
valueElement, width, height, { texture: valueRawTexture }
);
// Manual transform sync (getElementTransform TODO noted in source)
};
```
**Insight:** Most complex example. Shows how HTML-in-Canvas enables mixing standard HTML controls (a range input) with advanced GPU rendering. The slider is a real `
` — it's accessible, keyboard-navigable, and its value drives the 3D scene. The percentage text displayed on the ground plane is an HTML `
` captured as a GPU texture.
---
## Pattern Summary
| Example | Context | API Used | Interactive | Accessible |
|---------|---------|----------|-------------|------------|
| Complex Text | 2D | `drawElementImage` | No | Yes (text content) |
| Pie Chart | 2D | `drawElementImage` | Yes (focus/tab) | Yes (ARIA roles) |
| Text Input | 2D | `drawElementImage` | Yes (full form) | Yes (form elements) |
| WebGL Cube | WebGL | `texElementImage2D` | No (inert) | No |
| Jelly Slider | WebGPU | `copyElementImageToTexture` | Yes (range input) | Yes |
## Common Boilerplate
Every example follows this pattern:
```js
// 1. Get context
const ctx = canvas.getContext('2d');
// 2. Handle paint events
canvas.onpaint = () => {
ctx.reset(); // Clear and reset CTM
// ... draw elements ...
};
// 3. Request initial paint
canvas.requestPaint();
// 4. Handle DPR
new ResizeObserver(([entry]) => {
canvas.width = entry.devicePixelContentBoxSize[0].inlineSize;
canvas.height = entry.devicePixelContentBoxSize[0].blockSize;
}).observe(canvas, { box: 'device-pixel-content-box' });
```
---
# Open Questions
_Source: https://html-in-canvas.dev/docs/open-questions/_
# Open Questions & Issues
_Auto-synced from [`WICG/html-in-canvas` issues](https://github.com/WICG/html-in-canvas/issues) on 2026-08-31 via `scripts/sync-spec-docs.mjs`._
There are currently **0** open issues on the spec repository. Each heading below links to the upstream discussion — follow the link to read the full thread and leave a comment.
_(No open issues — maybe the spec is perfect, or maybe the sync script hit a snag. Check the repo directly.)_
---
# Browser Support
_Source: https://html-in-canvas.dev/docs/browser-support/_
# Browser Support
_Auto-synced from [`WICG/html-in-canvas` README](https://github.com/WICG/html-in-canvas/blob/main/README.md) on 2026-08-31 via `scripts/sync-spec-docs.mjs`._
## Status
This is a living explainer which is continuously updated as we receive feedback.
The APIs described here are implemented behind a flag in Chromium and can be enabled with `chrome://flags/#canvas-draw-element`.
## Developer Trial (dev trial) Information
The HTML-in-Canvas features may be enabled with `chrome://flags/#canvas-draw-element` in Chrome Canary.
We are most interested in feedback on the following topics:
* What content works, and what fails? Which failure modes are most important to fix?
* How does the feature interact with accessibility features? How can accessibility support be improved?
Please file bugs or design issues [here](https://github.com/WICG/html-in-canvas/issues/new).
## How to try it
You can run the demos on either Chrome Canary or a current Brave Stable — the flag lives in Chromium and rides along with any fork whose base milestone includes it.
### Option A — Chrome Canary
1. Install [Chrome Canary](https://www.google.com/chrome/canary/).
2. Visit `chrome://flags/#canvas-draw-element` and enable the flag.
3. Restart the browser.
4. Load any demo from the [demo gallery](/demos/).
### Option B — Brave Stable (Chromium 147+)
Confirmed working on [Brave](https://brave.com/) Stable 1.89.132 / Chromium 147.0.7727.56. Older builds may not expose the flag.
1. Update Brave to a current Stable build (Menu → Brave → About Brave triggers an update).
2. Visit `brave://flags/#canvas-draw-element` and enable the flag.
3. Restart the browser.
4. Load any demo from the [demo gallery](/demos/).
## Other browsers
- **Brave:** supported on recent Stable builds (≥ 1.89.132 / Chromium 147) behind `brave://flags/#canvas-draw-element`.
- **Firefox:** no implementation — [details below](#firefox-support).
- **Safari / WebKit:** no implementation announced.
- **Edge / other Chromium forks:** the flag rides along wherever the underlying Chromium milestone has shipped the canvas-draw-element code. Try `chrome://flags/#canvas-draw-element` (or the fork's equivalent) on a recent build.
## Firefox support
HTML-in-Canvas does not work in Firefox today. There is no implementation and no flag to enable — `drawElementImage()`, `layoutsubtree`, and the WebGL/WebGPU element-texture methods are unavailable, so the live demos on this site need a Chromium-based browser.
Where Firefox actually stands:
- Mozilla's formal review is open but undecided: [mozilla/standards-positions#1076](https://github.com/mozilla/standards-positions/issues/1076) (opened September 2024) is still marked "needs proposed position" — no position, positive or negative, has been published.
- No Gecko implementation work has been announced.
What works in Firefox today: the library approach — snapshotting DOM to canvas with html2canvas-style tools — runs in every browser, Firefox included. See [Render HTML to canvas: native API vs. html2canvas](/render-html-to-canvas/) for the comparison and code.
This page is refreshed from the upstream spec repo, so Firefox status changes land here when they happen.
## Feedback
Browser vendors and contributors track discussion at — see the [Open Questions](/docs/open-questions/) page for the current list.
---