Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Screen readers all cried in unison


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


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


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)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: