Live data from Hacker News

Google Docs will now use canvas based rendering

workspaceupdates.googleblog.com

411–420 of 953 posts

Re: Google Docs will now use canvas based rendering

#411
post #257

Earlier quoted context omitted.

This is what Flutter on the web is, by the way. You can try it out here: https://gallery.flutter.dev/#/ and marvel at the impossible to select text, one of the many affordances violently excised here. If it wasn't still incredibly slow even on a cutting-edge Zen3, Nvidia 3070 system they might almost be on to something here.

A dystopia. You can't control-F in the page. Can't copy and paste a word you don't know into a translator or dictionary. Can't share text unofficially - like copy a sentence into a email, etc.

So basically they are recreating the problems from Flash in 2021, but now using web standards ;-) ?

Here's me almost hoping that ADA lawyers will have many field days with this tech. Edit: since this time there is no good excuse for it.

Re: Google Docs will now use canvas based rendering

#412
post #257

Earlier quoted context omitted.

A dystopia. You can't control-F in the page. Can't copy and paste a word you don't know into a translator or dictionary. Can't share text unofficially - like copy a sentence into a email, etc.

Also, you know, accessibility. This could be a real serious problem for people with disabilities.

Accessibility is a first class citizen in flutter. https://flutter.dev/docs/development/accessibility-and-local...

Re: Google Docs will now use canvas based rendering

#413
post #378

Earlier quoted context omitted.

Just for what it’s worth, “word processors” are a logical starting point specifically because the APIs for text manipulation in the DOM are abysmal, and every in-browser WYSIWYG text editor is a steaming pile of hacks. Some of them work well despite this, but, it’s a horrible set of code to maintain and very, very hard to make a good user experience. One of the very hardest things to do well in the browser, actually.…

A million times this - having worked in this space, nobody wants to do this. I understand the cynicism, but the affordances provided by the browser for things like accessibility are very painful to give up. This isn't some dark pattern attempt to cut out whatever "openness" remains on the web, or to convert the browser into a display-streaming client for some sinister DRM reason. In my past job, we rewrote our spread…

Once the trail has been blazed by pioneers, expect a gold rush.

What would a good API look like, I wonder?

Re: Google Docs will now use canvas based rendering

#414
post #12

Earlier quoted context omitted.

The part I don’t understand is how in the world is a renderer written in JavaScript better performing than their own Chrome c++ code? With Edge being a Chrome clone and Safari being also performant browser, what are they worried about?

Their own renderer has to support all of HTML and CSS. Slapping some rectangles on a raster surface has a lot less to worry about.

Well... sort of.

For specific apps, or parts of apps, yes. Doing less is how you make things faster, highly agreed. And sometimes canvas allows you to do that, and then your app is much faster.

The problem is that in many cases, moving to canvas eventually turns into having a UI framework that renders to canvas, which turns into a layer of abstractions that handle keyboard and mouse events for you, including stuff like hover, which means suddenly you're tracking element position on your raster surface and thinking about z-indexes and event bubbling to parent elements...

I think this is part of the reason why individual apps that start using canvas and that can genuinely cut down on complexity by doing so tend to be able to get real speed improvements, but app frameworks like Flutter tend to perform so poorly. Eventually your cross-platform GUI toolkit like Flutter ends up being just another browser engine written in WASM. And in that scenario your approach becomes strict downside.

One good example: the browser doesn't expose an accessibility engine other than the DOM. So what I see apps end up eventually doing is either writing their own accessibility engine that doesn't work with programs like JAWS, or rendering out to a hidden DOM. For something like a game, you can get away that, maybe you don't even provide an accessibility layer at all. For a web component or a chart, a lot of your rendering might be unrelated to accessibility at all. But you get away with those kind of shortcuts because it's a targeted, specific use. For a big UI toolkit, it's harder to do that, and then surprise, suddenly you have all the overhead of updating a DOM tree and the overhead of updating a canvas.

When people talk about getting raw access to the graphics layer, I think it's important to understand there's a difference between apps that are genuinely reducing complexity vs the theoretical canvas-backed "universal web framework" that people sometimes talk about as just around the corner.

Re: Google Docs will now use canvas based rendering

#415
post #395

Earlier quoted context omitted.

This is a great example of a comment written by a developer or some otherwise technical person who is so used to thinking and speaking in terms of trees that they can't see the forest, let alone the village it's situated next to and the people inhabiting it. Google Docs may be an app, but a big part of the app, and confirmed to be one of the reasons for the migration here, is the part that renders the document to the…

> Documents are the quintessential use case for the Web, full stop In 1996, yes. And you can still use the Web that way. Nobody's stopping you. Much of the Web is still used that way, and that's not going to change. But in 2021, the web serves documents, and applications. And HTML/CSS was never intended as a way to build applications . It's why people came up with Flash, Java Applets, ActiveX, and all that other shit…

This is not a response to the point being made at the point where the quoted text originates, even though superficially it looks like it is. Please re-read the comment you're responding to.

Re: Google Docs will now use canvas based rendering

#416
post #99

Ever since WebAssembly was first introduced, I thought it was obvious[1][2] that the end game for those that want to control the web is sending opaque binary blobs of code that only use the browser for the canvas tag's framebuffer. Font rendering and layout can all easily be accomplished by embedding libraries like freetype. This breaks all forms of user control - like ad blockers - and turns the web back into cable…

I am in complete agreement. When I've brought this up on HN in the past it's always been dismissed with "But accessibility!". A big company like Google can handle that just fine. Presumably they'll eventually port Chrome to WASM. Then they can completely control the browsing experience. To exert any control over our browsing experience we'll be single-stepping thru machine code. I had fun cracking Apple II and PC sof…

Not Chrome. Chromium.

Chromium bundled with an option to run everything through Google/Alphabet infrastructure will make sure that the adds DO get through.

Re: Google Docs will now use canvas based rendering

#417
post #257

Earlier quoted context omitted.

A dystopia. You can't control-F in the page. Can't copy and paste a word you don't know into a translator or dictionary. Can't share text unofficially - like copy a sentence into a email, etc.

Also, you know, accessibility. This could be a real serious problem for people with disabilities.

Due to Section 508, this sounds like it would make Google Docs unsuitable for government work.

Re: Google Docs will now use canvas based rendering

#418
post #99

Ever since WebAssembly was first introduced, I thought it was obvious[1][2] that the end game for those that want to control the web is sending opaque binary blobs of code that only use the browser for the canvas tag's framebuffer. Font rendering and layout can all easily be accomplished by embedding libraries like freetype. This breaks all forms of user control - like ad blockers - and turns the web back into cable…

I literally had the same thought when I first heard of WebAssembly. Adblockers blocking your tracking JS/Cookies? Why not pass it via a binary blob though WASM and track the users? I know WASM is a boon to performance sensitive websites, but there are always players who would like to take advantage of the situation.

Re: Google Docs will now use canvas based rendering

#419

Earlier quoted context omitted.

Yet another reason to use Pi-hole. The web browser is the wrong place to try and fight against this sort of thing. Secure your home network once instead of fighting an arms race on each device you have.

DNS over HTTPS and, eventually, certificate pinning in the WASM-based DoH client running inside your browser will render your Pi Hole useless. It'll all just be opaque TLS to your network gear. Network operators who legitimately need to control traffic on their networks are lumped in with human rights-violating nation states. That includes you on your network.

Can you substantiate any of that? DoH is a feature of the browser that can be configured or disabled. Firefox even disabled DoH automatically if it detects you are using a custom DNS server which blocks "potentially malicious content"[1].

[1] https://support.mozilla.org/en-US/kb/firefox-dns-over-https

Re: Google Docs will now use canvas based rendering

#420

Earlier quoted context omitted.

This is what Flutter on the web is, by the way. You can try it out here: https://gallery.flutter.dev/#/ and marvel at the impossible to select text, one of the many affordances violently excised here. If it wasn't still incredibly slow even on a cutting-edge Zen3, Nvidia 3070 system they might almost be on to something here.

The demo doesn't have it, but they did fix the selectable text issue, just need to wrap your text in a SelectableText widget.

But this means the default is for text to be unselectable.

Which clearly says all I need to know about it :-/

Post reply on HN