Live data from Hacker News

Google Docs will now use canvas based rendering

workspaceupdates.googleblog.com

271–280 of 953 posts

Re: Google Docs will now use canvas based rendering

#272
post #187

It makes a hell of a lot of sense, even from a QA perspective alone. Canvas is going to be far more predictable as a rendering target than the wide swath of browsers they manage now. The DOM certainly has a place, but if you've looked at Google docs rendered output you'd notice it left web standards behind a long long time ago. This is an application which happens to be served on the web, not a traditional website. I…

VS Code already shows why Google would do this. They moved the Terminal from DOM nodes to canvas and got somewhere like a 20x render improvement (after already having spent a lot of time optimizing the DOM implementation). The previous jank all but went away too. EDIT: added their blog article https://code.visualstudio.com/blogs/2017/10/03/terminal-rend...

So the previous jank did not go away?

Re: Google Docs will now use canvas based rendering

#273

Earlier quoted context omitted.

I for one would welcome the death of HTML and CSS. Unfortunately I suspect they will merely be re-used for this.

HTML and CSS are fantastic; when used what they were designed for. Document markup and display. I blame webapp developers for the scope creep and subsequent denigration of a perfectly reasonable set of standards.

HTML and CSS were never denigrated. There's not one superficial feature which doesn't make sense. Most of it is barebones. If I had to pick one feature the blows the scope out of proportion, it would be the `is` selector, but that's the only one I can think of

Re: Google Docs will now use canvas based rendering

#274
post #53

How would they implement things like copy-to-clipboard then?

Current Google Docs already uses iframes to intercept keyboard/text events, the document you actually see isn't the thing you're interacting with, because contentEditable is nowhere near powerful enough for something like this.

All their decision to use canvas is doing is changing the render target.

Re: Google Docs will now use canvas based rendering

#275

Maybe because I am out of loop with web development, but this sounds like a huge change to me. So instead of HTML elements, there will be just one big element, and everything will be rendered there? How will text selection work for example? Will Google Docs basically implement a GUI library like GTK, which renders everything itself, but for the web?

I'm not sure but what you are suggesting is not outside the realm of possibility. There are already projects like https://makepad.dev/ which implement their GUI on top of WebGL. (Which is arguably more challenging than implementation on top of Canvas 2D.)

Visiting that website made my laptop's fans start running.

Re: Google Docs will now use canvas based rendering

#276
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.

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

Re: Google Docs will now use canvas based rendering

#277
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…

Man, this is a very dramatic interpretation of their intent. Docs doesn't even have ads. They actually do have issues rendering consistently across browsers (I ran into this just like 2 days ago where something that had been carefully laid out on Chrome looked different in Safari).

My bigger criticism of this is that I imagine it was a very large refactor at a time when docs has barely evolved for years and still remains far behind desktop counterparts in many ways (although still slowly taking over because of vastly superior online collaboration).

Re: Google Docs will now use canvas based rendering

#278
post #241

The Web started as a document display and delivery framework. Now it has turned into an application delivery framework, which uses the old document-rendering abilities to display the UI, with many quirks and workarounds, because DOM was never intended as a performant dynamic medium. With canvas and WebGL taking more and more, it will turn back into an X terminal, with more advanced network capabilities. If most impor…

You say this like it wont be used to completely remove all user choice and be an utter disaster.

Re: Google Docs will now use canvas based rendering

#279
post #246

Earlier quoted context omitted.

Wait, how is decrypting the WASM blob illegal?

I should have chosen my words more carefully, but the blobs with ads will have some sort of DRM on them, which is technically illegal to decrypt and cut out.

Removing DRM on something you own for personal use is perfectly legal.

Re: Google Docs will now use canvas based rendering

#280
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…

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.

That is absolutely horrible. I am only waiting for the day when people start making desktop apps using electron + Flutter on the web.
Post reply on HN