a glass object with a black background

For two decades, web developers have faced a brutal choice: use the DOM for accessibility and text selection, or use Canvas for high-performance graphics. If you wanted a complex UI inside a 3D scene or a high-performance design tool, you usually had to 'fake' the UI by layering HTML on top of a canvas—a clunky process that often broke when things started moving or scaling.

Bridging the Gap Between DOM and GPU

Chrome is currently running an origin trial (versions 148-150) for the HTML-in-Canvas API, and it's a game-changer. Instead of choosing between the two, developers can now draw real DOM elements directly into a 2D canvas or as textures in WebGL and WebGPU.

The magic here isn't just the visual rendering; it's the persistence of the accessibility tree. Unlike previous hacks that turned text into flat pixels, this API keeps text selection, 'find-in-page' functionality, and screen reader support intact, even when the content is being rendered by the GPU.

Why This Matters for the Modern Web

This is a massive win for 'heavy' web applications. Think of tools like Figma or Google Docs, or complex 3D data visualizations where you need interactive, semantic labels that move perfectly with the scene. By bringing the DOM into the Canvas, we get the performance of hardware acceleration without sacrificing the inclusive nature of the web.

While the API is still in an experimental draft stage and requires manual enablement or origin trial registration, it signals a shift toward a more unified rendering pipeline.

Sources

Media