New HTML Canvas APIs for Rendering HTML Content
2025-08-03
A new proposal introduces APIs to render HTML content within the HTML Canvas 2D and WebGL contexts. This addresses existing limitations in Canvas for handling complex layouts, accessibility, internationalization, and performance. New APIs, including `layoutsubtree`, `drawElement`, `texElement2D`, and `setHitTestRegions`, allow developers to render HTML elements and their subtrees into the canvas and handle hit testing. The proposal is currently under development and a developer trial is available.
Development
HTML rendering