Is Canvas the new Flash?

With Apple doubling down on their “Flash is great, except when it comes from Adobe” stance, the future of Flash as a browser plugin continues to be a topic of discussion. There are two main aspects of this to consider: one, Flash as the plugin that enables video on the Web for countless of people still today and tomorrow, and two, Flash as the platform that enables advertisers to suck just a little bit of extra life out of our laptops—and ourselves.

For the first aspect, HTML5 video is the answer. It is also not a topic we’ll go into today, but rest assured that the debate on HTML5 Video vs. Flash video is far from settled. No, today I’m only talking about Flash ads, and the perceived answer of HTML+CSS3 and/or Canvas.

Regarding the idea that Canvas will replace Flash for web ads, Steven Frank has brought up a few interesting questions and concerns. As a web developer/designer who cares quite deeply about all of this, I’d like to address some of his points.

Suppose the ever-increasing Flash backlash is successful, where success is loosely defined as enough people uninstall Flash that it’s no longer considered by web developers to be “something that everyone has”.

Any web developer out there today who considers Flash “something that everyone has” should already re-educate themselves. That time is long, long behind us now, but I digress.

Further suppose then that said web developers adapt to the changing environment, and begin composing their animated advertising travesties in standard HTML5.

This is the ominous corollary to the prospect of a victory against pervasive Flash.

While I’d guess that <canvas> is, at least on the Mac platform, optimized to be more battery efficient than Flash, any continuously running animation is going to drain your notebook’s battery.

Obviously, there is nothing to negate about a continuously running animation using up battery life, but that’s not really the big issue. The problem of Flash ads, when it comes to battery life, is that they use up to 30% CPU time when idling. No animation, just a static image, and yet… up to 30% CPU is being occupied, just for it. The Flash plugin, at least on the Mac platform, is simply not idle enough, even in idle mode. Compare that to Canvas or CSS3 Transitions and Animations, and the latter (standards-based) technologies use up even less CPU when animating than Flash does when idle. That gargantuan difference is enough to have many of us shrug at the notion of Canvas– or CSS3-based ads that move around, though I’m sure some are still concerned about that, so moving on:

And there’s a potentially bigger problem, which is that this type of content would not be as easy to block, because it’s not self-contained in a single plug-in that can be removed or disabled.

Aha, the crux of the matter. It’s true that Canvas and CSS3 ads won’t be self-contained in a plugin, so… are we in a pickle here? Read on!

Turning off JavaScript is practically a non-starter. Compared to Flash, JavaScript is much more widely used to practical effect. While you can probably live without awful ads and gimmicky browser games, JavaScript cannot reasonably be turned off without dramatically crippling your web experience.

So, when advertisers finally come around to making a standards-based page suck, and they will, as soon as the market gives them a reason to do so, is ClickToCanvas inevitable? What happens next?

When ads on the web start to become JavaScript, Canvas and/or CSS3–driven, we most certainly won’t have an easy way to block them anymore. Except for the relatively easy way we already have, which is to block the ad-serving servers and scripts via extensions such as the JavaScript Blacklist.

A “ClickToCanvas” is certainly not out of the question, but it is unlikely to be as needed as ClickToFlash is. The difference between 30% CPU and 1-2% CPU is very serious, as is the difference between one third of battery life and a negligible impact on battery life.

And even then, if we really get annoyed by CSS3 and Canvas ads that keep on rotating, even on sites we insist on visiting regularly, simple things like the user preference file and (as-yet unwritten) extensions allow us to simply disable such animations. The difference between standards-based techniques and proprietary plugins is that there are myriad ways to deal with the former, and only one with the latter. That’s why things like ClickToFlash came with features such as letting Youtube work anyway—because we couldn’t distinguish “good use of plugin” from “bad use of plugin.”

Standards-based ads may be every bit as egregious in design and interaction as the current spawn of Flash-based ads, but their negative impact on battery life will be hugely different, and for those still bothered by the former, many more solutions will be available to make their lives happily ad-free.

If you liked this, you should follow me on Twitter!