Live data from Hacker News

Google Docs will now use canvas based rendering

workspaceupdates.googleblog.com

131–140 of 953 posts

Re: Google Docs will now use canvas based rendering

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

> But there's nothing stopping someone from creating a complex web application that's performant.

Google--the folks who make V8--seem to disagree with you here. If they find canvas rendering to be more performant, then I'm going to believe them absent more information.

Re: Google Docs will now use canvas based rendering

#132
It's like going back in time with Flash Player, There were many WYSIWYG flash based editors around 2010. The problem was it required a browser plugin but it did work much better then HTML4 at that time. For canvas rendering no plugin is needed. Even there was a feature to export SWF file to canvas.

There are some issues like accessibility, browser features like search or text highlighting, lazy loading etc. What HTML provides out of the box must be implemented from scratch.

Re: Google Docs will now use canvas based rendering

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

I, for one, welcome our new canvas based overlords.

Re: Google Docs will now use canvas based rendering

#134
post #98

Earlier quoted context omitted.

I would not consider myself super deep in web technology, but rendering to canvas allows programmers to have pixel perfect control over the look of their applications across all devices. Currently, web developers need to "reset" lots of default rendering behaviors in every major browser to ensure that their applications look the same. After building lots of specialized UI components within the HTML standard, a progra…

Do your users care about your app looking the same or do they care about their browser looking and acting like a browser? Moving to canvas is sure to break many features such as text selection, adblocking, and accessibility. All in the name of more controls over the pixels? Are you truly doing it for the users?

Very good point, users do not care that a padding is rounded up or down when they switch from their laptop to their desktop, as long as the application is usable, understandable and visually competent.

But mindspace is much more important for interaction, so if their laptop is a Mac, their brain will be in "Mac mode", and "Linux" or "Windows" mode when on their other device. Respecting the platform's conventions will allow them to keep their cognitive load due to "fiddling" to a minimum.

Re: Google Docs will now use canvas based rendering

#135
post #103

Earlier quoted context omitted.

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…

Careful here, these are more like thin clients with high network latencies.

Re: Google Docs will now use canvas based rendering

#136
post #113
post #73

Earlier quoted context omitted.

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

Perhaps - but then the question just becomes "which one of those makes it easier for such mistakes to occur".

Re: Google Docs will now use canvas based rendering

#137
post #132

It's like going back in time with Flash Player, There were many WYSIWYG flash based editors around 2010. The problem was it required a browser plugin but it did work much better then HTML4 at that time. For canvas rendering no plugin is needed. Even there was a feature to export SWF file to canvas. There are some issues like accessibility, browser features like search or text highlighting, lazy loading etc. What HTML…

Padora box was already open the day, WebAssembly and WebGL came into the browser.

Re: Google Docs will now use canvas based rendering

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

> Presumably they'll eventually port Chrome to WASM. Then they can completely control the browsing experience.

...what? As opposed to shipping binary executables for an OS/arch combo, they'll ship a binary executable for WASM, and then a second binary executable for the OS?

If they want to take Chrome closed source and make it fully obfuscated, they can do that already, with or without WASM. Chrome is already closed-source, only Chromium is open -- and we know Chrome has secret sauce in it not from the repos.

Re: Google Docs will now use canvas based rendering

#139
post #17

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 think they already have with Flutter

yeah flutter's "web" target has a whole UI framework built inside the tag

Re: Google Docs will now use canvas based rendering

#140

RIP web accessibility when everyone starts doing this to make ad blocking more difficult

This is exactly the reason I don't use an ad blocker. In the long run, it will make everything worse, and I still probably won't be able to block ads. I'm clearly on the losing side of this though.

"Ad blockers" need a new name. I don't consider uBlock Origin an "ad blocker". It's a proper user agent (like a browser is supposed to be) that gives the user control over what is allowed to happen on their machine. That just happens to have the side effect of not allowing most ads to render because the way they're typical delivered. It won't matter if everyone starts using canvas unless they also stop using my machine to fetch random third-party content, which they won't, because the "ad" industry is now really the "tracking" industry.

The very few times I've seen ads over the last decade or so, they were standard images hosted directly by the site. That's all ads should be. The contract between the site and advertiser should be their problem, my machine isn't obligated to be their mediator.

Post reply on HN