Runtime wars (2): Apple’s answer to Flash, Silverlight and JavaFX

In yesterday’s Runtime wars (1): Does Apple have an answer to Flash, Silverlight and JavaFX?, we surveyed the primary contenders for rich-media, cross-platform application delivery: Flash, Silverlight and JavaFX. And wondered if Apple has an ace up its sleeve.

Apple’s options

Thanks to the surging popularity of Mac OS X and the iPhone, other companies are already bringing their plugins to Apple’s platforms, so the company may feel no urgent need to reinvent the wheel on Mac OS X. With Core Image, Core Animation, Core Audio, QuickTime and Cocoa, Apple’s desktop platform is not exactly a rich-media desert. Most of those capabilities are carried over to its post-PC devices AppleTV, iPhone and iPod touch via Mac OS X, so doing nothing may be one alternative.

Another “Apple should really…” item that refuses to die is the porting of core Apple media technologies to (at least) Windows, with a runtime for Cocoa. The “Yellow Box for Windows” which would have made write-once, deploy-anywhere possible still remains a dream of Cocoa developers.

Yet another option is #1 in Apple fans’ perennial Top Ten wishlist: buying Adobe (for Flash). This one’s quite unlikely, even during a week when Adobe’s CEO just called it quits.

Finally, Apple may choose to leverage an open source project such as OpenLaszlo, capable of outputting to multiple runtimes:


Core X

Of course, Apple could also be hard at work creating a brand new platform that integrates its Core X technologies into a new cross-platform runtime.


One huge barrier to that approach is distribution, however. It’s easy for Microsoft to distribute Silverlight through its OS monopoly. Flash, which Adobe claims is on 98% of desktops, has an unrivaled uptake rate for upgrades. Sun has close relationships with mobile device manufacturers and carriers and Java already runs on hundreds of millions of phones. While Apple claims 500,000 iTunes downloads and QuickTime is also on a lot of Windows desktops, it would still be a very difficult hurdle to get a new runtime on a broad range of platforms at this juncture. Yes, if the new platform is unambiguously superior it could happen, but Apple is coming way behind in this race.

So what then is Apple’s most sensible option? When in strategic doubt, resort to the famous stratagem devised by Odysseus.

Apple’s Trojan horse

Apple has been pretty good with the Trojan horse strategy, leveraging a few key assets (even when regarded as being late to the party) into domination in digital music, for example, and it’s trying the same with the iPhone in the mobile convergence space.

Apple’s Trojan horse in multi-platform, multimedia runtime is a piece of open source technology that’s already on Windows, Mac OS X, Linux, Adobe Flex/AIR, iPhone, iPod touch, Nokia S60 smartphones and Google’s new Android/Open Handset Alliance, with 30+ partners around the globe: WebKit 3.0.

WebKit 3.0

WebKit has come a long way since Apple’s adoption of the open source KHTML rendering engine and KJS libraries from KDE. A flurry of recent additions to WebKit by Apple and WHATWG now include:

Client-side storage via SQLite (bundled by Apple in Tiger and Leopard, but also used as a persistence layer by Google Gears and Adobe Flex) lets WebKit-based browsers store structured data locally.

Enhanced Rich Text Editing has been a problematic area for Safari for a while, especially with Google Docs, GMail and blogging apps. WebKit 3 solves that in an elegant way by providing a fully functional rich-text editing context activated by a simple click on the editable text:

rich text editing editor

Downloadable fonts let designers specify downloadable custom fonts via CSS @font-face rules.

Style-able form controls are now possible via CSS specification in WebKit 3:

stylized buttons

Advanced CSS styling ushers in multi-column text layout, text stroke and shadow, border-radius and shadow for box effects, among others.

Faster JavaScript and DOM parsing in WebKit 3 is said to be 2X or more, thereby speeding up rich-media applications.

New and faster XML technologies in WebKit 3 include XPath, the W3C standard XML Path Language that lets Ajax/CSS developers query document elements more efficiently, as well as XSLTProcessor, DOMParser, XMLSerializer and much improved XMLHttpRequest.

Scalable Vector Graphics (SVG) support for graphical presentantion and interaction via XHTML in WebKit 3 is shaping up to be the fastest among browsers. Although its rich potential has not yet been fully realized, SVG gets an opportunity to ride on the coattails of WebKit to tackle a range applications where only Flash could have been considered until now. Here’s a Mac OS X Dock-like magnification animation in SVG (WebKit 3 required for interactivity):

magnify SVG

CSS animation is a way of specifying animation via CSS, with transition properties like duration, timing, opacity, etc. Safari and WebKit architect Dave Hyatt promises even more:

In future posts I’ll go into transitions in more detail and also talk about another feature we’re adding: explicit animations. We are also preparing a more detailed proposal (full of intimidating spec language) that covers our thoughts on transforms, animation and other advanced visual effects.

CSS Transforms take a page out of currently available JavaScript effects libraries to enable boxes to be scaled, rotated, skewed and translated, with timings for fades, rotation, expansion, collapses, etc. Hyatt:

…transitions are for basic implicit animations. We will also be introducing explicit animations (using actual “animation” CSS properties)…We are exploring ideas for how to do transforms in ways that could affect layout.

HTML5 <audio> and <video> allow extremely simple media embedding in WebKit, with bi-directional JavaScript control:

<video autoplay></video>

There are other additions and improvements to WebKit as well. As you can see by now, WebKit is no longer your dad’s browser. Bit by bit, it has been gaining rich-media capabilities and Apple appears to be in no mood to slow down.

Renderer on steroids

WebKit architect Hyatt outlines future directions:

Like Microsoft our engine is also used inside many applications on our home operating system. We serve two masters: the Web and OS X (in all its forms). If people need these capabilities on OS X, we are going to provide them, regardless of whether or not they end up in any specification. That said, we are very interested in standardizing this stuff, and are preparing a proposal for the folks at the CSS WG.

Also, CSS has a well-documented means of providing safe non-conflicting extensions (using vendor-specific prefixes), so there is absolutely nothing wrong with CSS extensions. This isn’t like HTML, where you end up polluting the namespace. CSS can actually be extended safely in a way that doesn’t conflict with the standards.

While Apple’s ability to set a new rich-media standard may be limited, with the open source WebKit, even competitors like Nokia, Adobe and Google are helping the company achieve its primary goal of establishing a stable and ubiquitous platform from which it cannot be strategically excluded. That’s some Trojan horse!

Is WebKit as rich and powerful as Flash, Silverlight or JavaFX? No. Certainly not today. But it’s an extremely cost-effective way for Apple to have a pervasive rich-media platform whose future it can certainly affect.

A richer version of WebKit in the near future will have a commoditizing effect on Flash, Silverlight or any other proprietary platform. Remember Apple makes money mostly by selling iPhones, AppleTVs, Macs and related services. To the extent that these devices can have access to non-propriatery runtimes, not controlled by competitors like Adobe or Microsoft, Apple would be happy to sponsor open source development, as it’s doing with WebKit.

Where to next?

Perhaps next on Apple’s agenda is beefing up its development tools for WebKit. WebKit Inspector, a sophisticated development tool to navigate and debug web apps, is already out, as is Drosera, WebKit’s JavaScript debugger. Web Clip, a seemingly simple but extremely user-friendly tool, lets non-programmers create dynamic subscriptions to a selected portion of a web page as a Dashboard widget in just a couple of steps. Here, for instance, a 48-second video of YouTube “videos being watched right now” area turned into a Dashboard widget with a single click, with the widget capable of playing selected videos without going back to a browser, all thanks to WebKit:


Of course, Dashboard widgets are themselves rooted in WebKit and Dashcode greatly simplifies the creation of these small apps. It’s not out of the realm of possibility for Dashcode or a more professional tool to eventually grow into something closer in capability to Adobe Flex Builder or other IDEs based on Eclipse.

WebKit: an open-source, license-free, rich-media capable runtime…on desktops, TVs, phones and all manner of convergence devices to come. Could it be that when Steve Jobs introduced WebKit as the way to develop for the iPhone, he actually meant to signal its future direction?

UPDATE: Today, Apple updated WebKit’s Web Inspector, with a few new features including inline CSS editing and downloaded font previews elevating it closer to a web application IDE of sorts.


Runtime competitors were outlined in Part 1:
Runtime wars (1): Does Apple have an answer to Flash, Silverlight and JavaFX?

Runtime wars (1): Does Apple have an answer to Flash, Silverlight and JavaFX?

Adobe’s got Flash, Microsoft Silverlight and Sun JavaFX. What does Apple have in this multimedia runtime war of information and entertainment delivery?

On the surface, nothing. Some might argue that QuickTime is already the answer; Flash and Silverlight are finally catching up. Further, if Apple can convince Google’s YouTube to re-encode their video inventory in QuickTime’s primary codec H.264/AVC and if the new Flash player will also feature the industry standard H.264, why bother with anything else?

Because more than just video is at stake here. Surely, both Silverlight and the latest Flash offer high-resolution video, but they also deliver (rich media) applications.

Adobe Flash

Yahoo Maps done in Flash/Flex

Adobe, for example, can deliver the core of a reasonably non-trivial application targeting Flash runtime intact across platforms to web browsers (Flex), desktop (AIR) and even mobile devices (Flash Lite). Ditto, eventually, for Silverlight and JavaFX.

Microsoft Silverlight

Click to enlarge

Microsoft’s Silverlight can not only play HD 720p video but also includes CoreCLR, the .NET Common Language Runtime, so that applications can be written in any .NET language and run on Windows, Mac OS X and soon Linux. While Silverlight can be seen as an extension of Windows Presentation Foundation, a .NET 3.0 layer, it also supports fast compiled/just-in-time JavaScript and Ruby, Python and VBx.

Sun JavaFX

Click to go to Sun JavaFX site

Not to be outdone by Adobe and Microsoft, Sun recently introduced JavaFX, JavaFX Script, JavaFX Mobile. Based on Java, these technologies cover nearly the same domain as Flash and Silverlight.

Powerful runtimes

This new breed of network-aware platforms are capable of interacting with remote application servers and databases, parsing and emitting XML, crunching client-side scripts, rendering complex multimedia layouts, running animations, displaying vector graphics and overlaid videos, using sophisticated interface controls and pretty much anything desktop applications are able to do.

It is said that Adobe bought Macromedia to acquire Flash, whose runtime is likely the most ubiquitous plugin on the web. Fairly effortless to upgrade, the Flash runtime is a tremendous asset for Adobe and Flash/Flex/AIR developers to distribute their rich media applications.

Indeed the absence of Flash on the iPhone has been one of its most talked about shortcomings. Everyone expects Flash to arrive soon. Walt Mossberg at All Things Digital had said in July that the iPhone Flash plugin was imminent:

Apple says it plans to add that plug-in through an early software update, which I am guessing will occur within the next couple of months.

Yet four months and a couple of updates later, there’s no Flash support. Nor any support for Silverlight or JavaFX on any of Apple’s post-PC devices: AppleTV, iPhone and iPod touch. Is there more than the current absence of an SDK involved here? Mere Apple secrecy? NIMBY? Is Apple satisfied by merely having them on Mac OS X and not worried about its post-PC devices? Or does Apple have something up its corporate sleeve to counter this tsunami of powerful cross-platform runtimes?

The answer is in “Runtime wars (2): Apple’s answer to Flash, Silverlight and JavaFX,” here tomorrow.


A longer discussion on Core Animation and its significance is in:
What’s in Leopard for Designers (1): Core Animation