Live data from Hacker News

Google Docs will now use canvas based rendering

workspaceupdates.googleblog.com

111–120 of 953 posts

Re: Google Docs will now use canvas based rendering

#111

Earlier quoted context omitted.

The programmers will need to add accessibility features to their apps: https://html.spec.whatwg.org/multipage/canvas.html#best-prac...

This is a huge amount of work, and authors are most strongly encouraged to avoid doing any of it by instead using the input element, the textarea element, or the contenteditable attribute. When the spec warns you in advance that this is a high risk approach.

High work != high risk

Re: Google Docs will now use canvas based rendering

#112

I don't build extensions or work on much front end web lately but this reads like Google wants more control over their stuff. The web is becoming less open. > By moving away from HTML-based rendering to a canvas-based rendering, some Chrome extensions may not function as intended on docs.google.com and may need to be updated. > If you are building your own integrations with Google Docs, we recommend using Google Work…

> this reads like Google wants more control over their stuff. The web is becoming less open. Absolutely agreed. I'd also be surprised if they don't try to roll out the same for search results, ostensibly for the purpose of improving performance, but actually to thwart ad-blockers.

The only thing that's kept everyone from doing that, so far, is accessibility. If not for that all the major ad platform companies (FB, Twitter, Google, and so on) would be already be all-in on Canvas.

Accessibility concerns make it both expensive to develop a UI that renders to canvas, and ensures that the content can be processed & understood by a program (else how will assistive tools read it?), which opens up the door to ad blockers again, defeating the purpose of the whole exercise.

We literally have blind people to thank for the Web remaining as open as it has, for this long.

Re: Google Docs will now use canvas based rendering

#113
post #73

Earlier quoted context omitted.

> The dom is really, really fast, no, it is barely tolerable. Web apps in 2021 have trouble reaching the UI performance (latency) of early 2000 desktop software.

Looking at the DOM in isolation, its pretty quick. The primary reason web apps are slow is because the business logic is typically un-optimized. I've encountered a web app that persisted its state by stringifying it and putting it into localStorage with every UI change. The resulting string was ~5MB and took 200-300ms each time (freezing the UI) on my tablet. I've encountered an app that used an in-house built chart…

Engineers will figure out how to make mistakes like this whether its in the browser or in a native app

Re: Google Docs will now use canvas based rendering

#114

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?

Yes, then you will need a unified approach to text editing, and another markup language inside.

Re: Google Docs will now use canvas based rendering

#115
post #103
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…

It's a bad thing in terms of openness but a good thing in terms of performance and making web applications more like real desktop applications. A lot of DOM work is a nightmare, so I sort of welcome to the Canvas based approach.

We're just one more concession away from getting the performance we had 20 years ago with native applications.

Edit:

The path we're on just seems so obvious I kind of just want to skip ahead and get it over with.

- Developers and content publishers love the ergonomics and control of just shipping WASM binaries that paint to a canvas and it becomes the de facto standard.

- After 2-3 years of everyone's computer being used to surreptitiously mine crypto everywhere they go we re-learn the lessons of Java applets.

- In comes browsers that require signed WASM binaries for your protection.

The world is an app store. Curtains.

Re: Google Docs will now use canvas based rendering

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

Ad blockers could still "scroll" through a website, run an AI model on it to discover the ad sections, and cut them out. Even a simple model that filters out visual animations and replaces them with a static would be useful as a large annoying component of online ads is the movement and blinking etc. that make it hard to focus on the content.

Dark mode etc can, too, be implemented to work in terms of framebuffers only.

But yes, unless there is a serious need, canvas rendering is a severe regression.

Re: Google Docs will now use canvas based rendering

#117

Earlier quoted context omitted.

I want to say that Flutter would be a good candidate, but I don't think it's ready for this. Or is it?

If they don't use Flutter, then myself and Flutter community and Flutter Googlers will all be very disappointed.

I am also wondering about this. Having recently built a production app in Flutter Web used by millions of people, I am very eager to hear about other people's experiences with Flutter Web in real life applications.

Re: Google Docs will now use canvas based rendering

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

[deleted]

Re: Google Docs will now use canvas based rendering

#119

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.)

That's amazing, the IDE itself and the shader preview running on a WebGL canvas. Thanks for sharing!
Post reply on HN