HTML-in-canvas enables customizing the rendering of html using canvas with three new primitives: an attribute to opt-in canvas elements (layoutsubtree), methods to draw child elements (2d: drawElementImage, webgl: texElementImage2D, webgpu: copyElementImageToTexture), and a paint event which fires to handle updates.
High-performance web applications rely on <canvas> for control over rendering that goes beyond standard HTML/CSS. However, by using <canvas>, they lose all the rich, built-in features of the web platform, including: * Advanced formatting, such as styled multi-line text. * Interactivity, such as forms, selection, and native scrolling. * Accessibility. This forces a bad trade-off: developers must either re-implement these fundamental browser features in JS, or simply not provide them, resulting in a sub-par, inaccessible user experience.
Samples: https://github.com/WICG/html-in-canvas?tab=readme-ov-file#demos
Explainers: https://github.com/WICG/html-in-canvas