Live data from Hacker News

Google Docs will now use canvas based rendering

workspaceupdates.googleblog.com

211–220 of 953 posts

Re: Google Docs will now use canvas based rendering

#213
I think this is actually one of the few cases where canvas-based rendering makes sense as a replacement for the DOM.

Docs is a full-featured application which already has to re-implement a lot of DOM-like features in order to fulfill its primary function (things like text formatting and layout, spell checking, etc). Doing it all in canvas doesn't sound significantly more difficult than what they're already doing.

The loss of extensibility is regrettable, but probably worth the trade-off for better performance.

If this starts happening with more traditional websites, then yes I'd agree that'd be a bad thing. We're certainly not there yet though.

Re: Google Docs will now use canvas based rendering

#214
HTML Canvas is really smooth. Especially with all graphics acceleration work. Afaik, it's smart enough to load elements that aren't in the view port. I believe text rendering was an issue, but it's mostly usable now.

It might work well for rendering logs as well :)

[1]https://news.ycombinator.com/item?id=26587951

Re: Google Docs will now use canvas based rendering

#215
post #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 onl…

I've seen some rather atrocious techniques employed to bake ads into source but that can still be done without any performance impact. Making that work in WASM would require dynamic recompilation, doable perhaps for smaller apps but for behemoths like Gmail and Docs I couldn't see even Google getting that to scale. I think we'll still have browsers performing additional HTTP requests for that stuff, at least in the short to medium term. So traditional adblocking techniques will still be viable.

Re: Google Docs will now use canvas based rendering

#216
post #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 onl…

It will be like cutting out the ads in a newspaper. Lots of holes, everywhere.

Re: Google Docs will now use canvas based rendering

#217

This reminds me a lot of those websites that used to be implemented in Flash. It's just one giant opaque blob that gets downloaded and can do whatever it wants. When this stuff inevitably starts being used by every news and shopping website I wonder how search engines will be able to index it.

When this stuff inevitably starts being used by every news and shopping website I wonder how search engines will be able to index it.

Legal agreements and money changing hands between publishers and Google.

Re: Google Docs will now use canvas based rendering

#219
post #88

Earlier quoted context omitted.

Performance of DOM based rendering is very problematic and not unified across browser implementations. Canvas rendering will likely increase the performance of Google Docs, and make the UX more unified across platforms. Google Docs is really an application built on the web platform. HTML DOM rendering was never intended to give developers the control they need to build fully featured high performant applications, we…

I think this is the real reason for the change as well. A few years ago Visual Studio Code underwent a similar change where rendering the terminal moved from using DOM to canvas. I never noticed a huge difference between the two methods but I imagine using canvas gave them a lot more flexibility in addition to being more performant.

I like the hacking mindset to make something work even if the odds are against it but the better approach would be to fix the DOM APIs and to do the necessary performance work instead of basically throwing all the responsibility on some library and the web developer.

Re: Google Docs will now use canvas based rendering

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

Is ad blocking Google Docs really a concern though?

i think the worry is more about the next steps, not google docs per se
Post reply on HN