3 ms·
How about a flag on the body element like: <body canvas="true"></body> This would make the entire visible page into a canvas-like drawing surface which a
by russellbeattie 1y ago
How about a flag on the body element like:
<body canvas="true"></body>
This would make the entire visible page into a canvas-like drawing surface which also renders DOM elements as per usual. At some level there's a process which rasterizes the DOM - opening drawing APIs into that might be a better solution.
It's sort of the same thing as HTML in canvas conceptually, but architecturally it makes DOM rendering and canvas rendering overlapping equals with awareness going both ways. E.g., a line drawn on the page will cause the DOM elements to reflow unless told to ignore it.
- pyrolistical 1y agoScreen readers all cried in unison
- koolala 1y agoWhy wouldn't they work normally. The HTML is still modeled as a ground truth.
- koolala 1y agoWould this mean a canvas could also automatically resize? This would be a new era for html composition that could surpass iframes.
- flohofwoe 1y agoIsn't this already trivial? You just need to be aware that the framebuffer size of a canvas element is different from its dom element size, but you can easily glue the canvas framebuffer size to the element size by listening for resize events (this is for webgl and webgpu canvases, don't know about 2d canvas)