HTML-in-Canvas ships and could make the web a lot more creative...and a lot stupider
“HTML-in-Canvas eliminates these trade-offs.” The Web API has been submitted for inclusion in the WHATWG HTML Living Standard, the ever-updating standard formerly known as HTML5 – for all the technologies that officially make up HTML (including Canvas itself).
- “Previously, when creating visually demanding web apps, you had to choose between standard HTML elements and raw canvas contexts,” enthused one Google DevRel in a tutorial.
- While fully supported by Chrome and Chrome Android beginning with release 157, none of the other major browsers support the API yet (Microsoft Edge 157 – which is made of Chromium – unofficially appears to support at least some HTML-in-Canvas actions as well).
- The Web’s about to get lit Google posted a few possibilities of what can be done with HTML-in-Canvas.
HTML-in-Canvas “opens up the door to a lot of stupid use cases … but also a lot of really creative, interesting things where you can apply stylistic effects to HTML,” Bos explained on X.
- Primarily developed by the Google Chromium team, HTML-in-Canvas allows JavaScript to place HTML commands within the canvas element, thanks to an attribute option within Canvas.
- With it comes a new vision of how Web pages could be designed, for better or worse, allowing richer, more interactive elements but also more opportunities for annoying ads.
- If the canvas tag includes a content attribute of "drawable," the browser’s rendering engine prepares the HTML content inside the box so JavaScript can render it.
- A trippy demo from html-in-canvas.dev shows a dragon slithering through the opening chapter of an online book, with the text smoothly reflowing in its wake.
- The core developers resolved the issue of canvas copying sensitive cross-origin data where it oughtn’t (as per CORS), but the API does not indicate when it declines to copy the data, leaving the community to file bug reports of what appear to be silent failures.
How this summary was made: extractive summary — built from the sources' own reporting. It is drawn only from the reporting of the sources listed below — read the originals for full detail. How we summarize →