Has anyone experimented with html in canvas yet? ...
# compose-web
a
Has anyone experimented with html in canvas yet? It seems like it enables having true interop in compose web without punching holes to the canvas
😮 1
b
Hmm I'm out of the loop on this one. Can you say more?
a
it's a new browser api/capability, that lets u render html inside of
<canvas>
check demos in chrome at https://html-in-canvas.dev/demos/ lots of crazy stuff over X: https://x.com/search?q=html%20in%20canvas&amp;src=typed_query
I guess that would make Compose apps accessible out of the box too without extra work from jetbrains but i mostly care for being able to have nicer UX with the platform
👍 2
b
oooh neat!
r
I don't get it. From what I read, it will allow you to render some html on a canvas drawing, but the canvas itself is still a "black box" for the rendering engine, isn't it? Am I missing something?
b
From what I understand, you can have the elements that you render on the canvas be part of the DOM. And therefore give them accessible attributes.
r
I've installed the supported browser and checked how it works. I think I get it now.
👍 1
It works nice if you have the html fallback (or even better if you start with it). But with compose-web, I think the main problem will still be generating fallback html matching the UI.
a
yeah i might have spoken too fast about the accessibility part w/o extra work. still curious on the interop story tho
s
they already generate a DOM next to the canvas to tackle accessibility
today i learned 1
but this could for example be used to create login forms with html to get browser auto-fill
💡 2
j
Sounds like something to be used by JB for `WebElementView`'s inner workings https://kotlinlang.org/docs/multiplatform/whats-new-compose-190.html#new-api-for-embedding-html-content
o
Sounds like something to be used by JB for `WebElementView`'s inner workings
In case you folks would like to track a related ticket - https://youtrack.jetbrains.com/issue/CMP-9127
👍 1