Remix.run Logo
russellbeattie 7 days 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 7 days ago | parent | next [-]

Screen readers all cried in unison

koolala 7 days ago | parent [-]

Why wouldn't they work normally. The HTML is still modeled as a ground truth.

koolala 7 days ago | parent | prev [-]

Would this mean a canvas could also automatically resize? This would be a new era for html composition that could surpass iframes.

flohofwoe 7 days ago | parent [-]

Isn'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)