Hacker News new | ask | show | jobs
by bapak 324 days ago
I don't see a problem with what you're saying at all. For reference, you can already have HTML in SVG in HTML in SVG.

If you have a canvas-first page, where do you store the title? Right, in <title>, so

    <!doctype html>
    <title>My canvas site</title>
    <canvas style="fill all">

In reality they should really just allow content in the canvas element and call it a day:

    <canvas type="html">
        <h1>Canvassing</h1>
    </canvas>
3 comments

> you can already have HTML in SVG in HTML in SVG

It's kind of different because SVG and HTML are both XML-like text-based format, doesn't feel that wrong to mix them together. Unlike with canvas..

Oh god that canvas h1 code looks so sexy. Imagine if a canvas could dynamically resize too.
Yes - and maybe you could call it something else, for example... div? ;-)
but then what's the point of the canvas here? Unless if it was possible to mix and match canvas painting operations seamlessly with the declared elements...
This post is titled HTML-in-Canvas, so you can find the point in the link. A lot of people just want the freedom of canvas rendering/shading and the flexibility of HTML/CSS. Current options may force you to create a layout engine from scratch for example.
Opening it in WebXR!