4 ms·
Canvas is a last resort if you absolutely cannot build the thing any other way. When you use canvas you're giving up on not just accessibility but also optimiz
by zarzavat 2mo ago
Canvas is a last resort if you absolutely cannot build the thing any other way.
When you use canvas you're giving up on not just accessibility but also optimizations that the browser does for you transparently when you use the native render tree. There's no guarantee that your app will be faster in canvas, it could easily be slower. Do you really think you can beat the browser's C++ by writing code in a language that doesn't even have a native integer type? Perhaps you can, but your base assumption should be that you can't.
- sghiassy 2mo agoCan WASM write to Canvas though?
- SPascareli13 2mo agoYou need some JS in the middle but yes, you write your image to a buffer and share it with JS, then in the JS you put it in the canvas.
- josephg 2mo agoWASM can call javascript, and javascript can call canvas. You can use JS bridges to let WASM do more or less anything.
- muglug 2mo agoYou’re not “giving up” on accessibility. You’re just not getting it “for free” — though it was never free to begin with. When you’re dealing with things like spreadsheet viewers, disengaging from the DOM for sighted users can actually make accessibility simpler.
- josephg 2mo ago> disengaging from the DOM for sighted users can actually make accessibility simpler. Do you have any examples? In my experience, a lot of software written like this just doesn't work with screen readers at all.