HTML-in-Canvas ships and could make the web a lot more creative...and a lot stupider
The Web’s Canvas element gave would-be webcassos space to draw whatever they fancied; now HTML controls come along for the ride.
The HTML-in-Canvas API, released by the Chrome team as part of Chrome 157, introduces a new way to design web pages with richer, more interactive elements. This API allows developers to embed HTML commands within a canvas element, thanks to a drawable attribute option. While this feature is fully supported by Chrome and Chrome Android in release 157, it remains unsupported by other major browsers. The API has been submitted for inclusion in the WHATWG HTML Living Standard, which governs the evolution of HTML technologies.
The potential for HTML-in-Canvas is vast, as it enables developers to create 3D environments using Three.js, generate charts with D3.js, and even design entire note-taking applications within the canvas. However, this new API also opens up a world of creative possibilities, with developers experimenting with whimsical designs, such as a "Margin Dragon" that burns virtual text with its fiery breath when interacted with.
Despite its creative potential, HTML-in-Canvas also poses several challenges. The API lacks cross-platform support, and several bugs, such as improper CSS painting and synchronization issues with reactive frameworks, have been identified. Additionally, developers must learn to properly document on-screen bounding boxes to ensure accessibility tools function correctly in 3D environments.
As the API continues to evolve and gain broader support, it has the potential to make the web a more creative platform, but it may also give rise to more intrusive and annoying advertisements.
Written by urgent.news from The Register Science's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.