Tag Archives: webkit

Appcelerator plans to rethink Titanium architecture, standardise on WebKit JavaScript engine

Appcelerator CEO Jeff Haynie has posted about his plans for Titanium, the company’s cross-platform mobile development toolkit.

The plan is to completely rewrite the core engine, while maintaining a mostly-compatible API. Central to the plans is the idea of using one JavaScript engine on all platforms:

With Ti.Next, we’ve created a small microkernel design that will allow us to have minimal bootstrap code in the native language (C, Java, C#, etc) that talks to a common set of compilers, tools and a single JavaScript Virtual Machine. We have found a way to make the WebKit KJS VM work on multiple platforms instead of using different VMs per platform. This means we can heavily optimize the microkernel (herein after called the “TiRuntime”) and maintenance, optimizations and profiling can be greatly simplified. We’re talking about ~5K LOC vs. 100K LOC per platform.

This will make it possible to share almost all the Titanium code itself across all platforms. The Titanium runtime itself will be shared code written in JavaScript.

Appcelerator says that Titanium code will be “faster than native code in most situations.”

No date for Ti.Next is given though according to this slidedeck the plan is to have the “first set of developer builds available soon to GitHub repo – possibly in the next 45-60 days”. It adds, “production builds are a ways away.”

Using a WebKit JavaScript engine on Windows Phone, for example, sounds interesting.

Google forks WebKit into Blink: what are the implications?

Yesterday Google announced that it is forking WebKit to create Blink, a new rendering engine to be used in its Chrome browser:

Chromium uses a different multi-process architecture than other WebKit-based browsers, and supporting multiple architectures over the years has led to increasing complexity for both the WebKit and Chromium projects. This has slowed down the collective pace of innovation – so today, we are introducing Blink, a new open source rendering engine based on WebKit.

Odd that not long ago we were debating the likelihood and merits of WebKit becoming the de facto standard for HTML. Now Google itself is arguing against such a thing:

… we believe that having multiple rendering engines—similar to having multiple browsers—will spur innovation and over time improve the health of the entire open web ecosystem.

Together with the announcement from Mozilla and Samsung of a new Android browser which, one assumes, may become the default browser on Samsung Android phones, there is now significant diversity/competition/fragmentation in the browser market (if you can call it a market when everything is free).

The stated reason for the split concerns multi-process architecture, with claims that Google was unwilling to assist with integrating Chromium’s multi-process code into WebKit:

Before we wrote a single line of what would become WebKit2 we directly asked Google folks if they would be willing to contribute their multiprocess support back to WebKit, so that we could build on it. They said no.

At that point, our choices were to do a hostile fork of Chromium into the WebKit tree, write our own process model, or live with being single-process forever. (At the time, there wasn’t really an API-stable layer of the Chromium stack that packaged the process support.)

Writing our own seemed like the least bad approach.

Or maybe it was the other way around and Apple wanted to increase its control over WebKit and optimize it for the OSX and iOS rather than for multiple platforms (which would be the Apple way).

It matters little. Either way, it is unsurprising that Apple and Google find it difficult to cooperate when Android is the biggest threat to the iPhone and iPad.

The new reality is that WebKit, instead of being a de facto standard for the Web, will now be primarily an Apple rendering engine. Chrome/Chromium will be all Google, making it less attractive for others to adopt.

That said, several third parties have already adopted Chromium, thanks to the attractions of the Chromium Embedded Framework which makes it easy to use the engine in other projects. This includes Opera, which is now a Blink partner, and Adobe, which uses Chromium for its Brackets code editor and associated products in the Adobe Edge family.

The benefit of Blink is that diverse implementations promote the importance of standards. The risk of Blink is that if Google further increases the market share of Chrome, on desktop and mobile, to the point where it dominates, then it is in a strong position to dictate de-facto standards according to its own preferences, as suggested by this cynical take on the news.

The browser wars are back.

Browser monoculture draws nearer as Opera adopts WebKit, Google Chromium

Browser company Opera is abandoning development of its own browser engine and adopting WebKit.

To provide a leading browser on Android and iOS, this year Opera will make a gradual transition to the WebKit engine, as well as Chromium, for most of its upcoming versions of browsers for smartphones and computers.

Note that Opera is not only adopting WebKit but also the Google-sponsored Chromium engine, which is the open source portion of the Google Chrome browser.

What are the implications?

The obvious one, from Opera’s perspective, is that the work involved in keeping a browser engine up to date is large and the benefit, small, given that WebKit and Chromium are both capable and also close to de facto standards in mobile.

This last point is key though. If everyone uses WebKit, then instead of the W3C being the authority on which web standards are supported, then the WebKit community becomes that authority. In the case of Chromium, that means Google in particular.

On the desktop Microsoft’s Internet Explorer and Mozilla Firefox both have substantial market share, but in mobile both iOS and Android, which dominate, use WebKit-derived browsers. BlackBerry is also using WebKit in its new BlackBerry 10 OS.

There is already a debate about web pages and applications which make use of webkit-specific tags, which often implies a degraded experience for users of other browsers, even if those other browsers support the same features. A year agao, Daniel Glazman, co-chairman of the W3C CSS working group, wrote a strongly-worded post on this issue:

Without your help, without a strong reaction, this can lead to one thing only and we’re dangerously not far from there: other browsers will start supporting/implementing themselves the -webkit-* prefix, turning one single implementation into a new world-wide standard. It will turn a market share into a de facto standard, a single implementation into a world-wide monopoly. Again. It will kill our standardization process. That’s not a question of if, that’s a question of when.

Therefore, Opera’s decision is probably bad for open web standards; though web developers may not mind since one fewer browser variation to worry about makes their life easier.

People commonly raise the spectre of Microsoft’s Internet Explorer 6 and the way it effectively froze web standards for several years, thanks to its dominance. Might WebKit’s dominance repeat this? It is doubtful, since the IE6 problem would not have been so great, except that Microsoft decided it would rather promote its own platform (Windows) rather than the web platform. The WebKit community will not do that.

On the other hand, for rivals like Microsoft and Mozilla this is a concern. Something as important as web standards should ideally be vendor-neutral, so that big companies do not use standards as a means of promoting their own platforms and making other platforms work less well. In practice, it is rare that standards are truly vendor-neutral; the big vendors dominate standards groups like the W3C for exactly this reason. That said, it would be true to say that the W3C is more vendor-neutral than WebKit or Chromium.

Leaving all that aside, another question is what value Opera can add if it is building on the same core as Google and Apple. That is a matter I hope to clarify at the Mobile World Congress later this month.

Apple breaks web storage in iOS 5.1, does not care about web apps?

Many iOS apps which rely on web storage APIs for persistent data have been broken by the recent upgrade to iOS 5.1. The issue affects apps built with PhoneGap or others which use WebKit APIs to store data. The affect for users is that they lose all their data after the upgrade. For example, it sounds like the issue has hit this app:

image

Another developer says:

My statistics show users abandoning ship as their settings are wiped over and over, after each app restart.
This is a critical error that must be patched as soon as possible. Remember there’s also a delay from Apples app approval process to consider.

Put more precisely, WebKit used to store its local databases in Library/WebKit which is a location that the OS regards as persistent and which is backed up to iCloud. In iOS 5.1 this data is stored in Library/Caches which means it is regarded as temporary and likely to be deleted. The W3C Candidate Recommendation says of localStorage:

User agents should expire data from the local storage areas only for security reasons or when requested to do so by the user.

An embedded browser is not quite the same as a web browser though, and if you are using SQLite in Webkit then that falls outside the W3C HTML 5 API since Web SQL is no longer included.

The issue is complicated in that there also seems to be a bug, described here, which causes data to be lost after upgrading an app to a newer version; and there are problems with actual web apps as well as with apps that use an embedded UIWebView.

PhoneGap is fixable in that it can call native APIs and there is work going on to implement this. The danger is that more platform-specific code undermines the cross-platform benefits.

Discussions on the Apple developer forums during the beta period for 1OS 5.1 show that Apple was aware of the issue and that it is by design. The impression given is that Apple was annoyed by the number of apps using web storage to speed up their apps (whether web or native) rather than just storing customer-created content, and felt it was imposing too much burden on the constrained storage space in an iOS device.

It does not help that there is no way to increase the storage in an iPad or iPhone other than by replacing it with a newer one with more memory.

The problem is a real one, but you cannot escape the impression that Apple considers solutions like PhoneGap, or even web apps that behave like local apps, as a kind of workaround or hack that is to be discouraged in favour of apps written entirely with the iOS SDK.

Apple benefits from true native apps as they are more likely to be exclusive to its platform, and must be sold through the App Store with a fee to Apple.

The official Data Storage Guidelines for iOS are here.

PhoneGap comes to Windows Phone

Nitobi has announced PhoneGap for Windows Phone 7, nicely timed just before the Microsoft BUILD conference next week.

PhoneGap is a cross-platform mobile development tool that uses the HTML and JavaScript engine on the phone as its runtime, supplemented by extensions which give access to other device features:

After unpackaging the contents of the www folder, your www/index.html file is loaded into an embedded headless browser control. This is essentially the same paradigm as other platforms, except here it is an IE9 browser and not a webkit variant. IE9 is a much more standards-compliant browser than previous IEs, and implements commonly used html5 features like DOMContentLoaded events, addEventListener interfaces, and CSS3. Be sure to use to get the html5 implementation otherwise the browser may fallback to a compatibility mode, and your code will likely choke and die.

The version for Windows Phone 7, just released in preview, is extended to support features including the camera, accelerometer, contacts, and notifications. There is also support for plugins:

PhoneGap-WP7 maintains the plugability of other platforms via a command pattern, to allow developers to add functionality with minimal fuss, simply define your C# class in the WP7GapClassLib.PhoneGap.Commands namespace and derive your class from BaseCommand.

In general Windows Phone 7 is not well supported by cross-platform toolkits, so PhoneGap support is an interesting development. PhoneGap has a high profile currently, and is being integrated into a diverse range of tools ranging from Adobe Dreamweaver to Embarcadero RadPHP, as well as the standard PhoneGap tools based on Eclipse.

Android only 23% open says report; Linux, Eclipse win praise

Vision Mobile has published a report on what it calls the Open Governance Index. The theory is that if you want to measure the extent to which an open source project is really open, you should look at its governance, rather than focusing on the license under which code is released:

The governance model used by an open source project encapsulates all the hard questions about a project. Who decides on the project roadmap? How transparent are the decision-making processes? Can anyone follow the discussions and meetings taking place in the community? Can anyone create derivatives based on the project? What compliance requirements are there for creating derivative handsets or applications, and how are these requirements enforced? Governance determines who has influence and control over the project or platform – beyond what is legally required in the open source license.

The 45-page report is free to download, and part-funded by the European Union Seventh Framework Program. It is a good read, covering 8 open source projects, including the now-abandoned Symbian Foundation. Here is the result:

Open Governance Index (%open)
Eclipse 84%
Linux 71%
WebKit 68%
Mozilla 65%
MeeGo 61%
Symbian 58%
Qt 58%
Android 23%

The percentages are derived by analysing four aspects of each project.

  • Access covers availability of source code and transparency of decisions.
  • Development refers to the transparency of contributions and acceptance processes.
  • Derivatives covers constraints on use of the project, such as trademarks and distribution channels.
  • Community structure looks at project membership and its hierarchy.

What is wrong with Android? I am not sure how the researchers get to 23%, but it scores badly in all four categories. The report observes that the code to the latest “Honeycomb” version of Android has not been published. It also has this to say about the Open Handset Alliance:

When launched, the Open Handset Alliance served the purpose of a public industry endorsement for
Android. Today, however, the OHA serves little purpose besides a stamp of approval for OHA
members; there is no formal legal entity, no communication processes for members nor frequent
member meetings.

By contrast, Eclipse and Linux are shining lights. MeeGo and Mozilla are also praised, thought the report does mention Mozilla’s “Benevolent dictators”:

In the case of conflicts and disputes, these are judged by one of two Mozilla “benevolent dictators” – Brendan Eich for technical disputes and Mitchell Baker for non-technical disputes.

Qt comes out OK but has a lower score because of Nokia’s control over decision making, though it sounds like this was written before Nokia’s Windows Mobile revolution.

WebKit scores well though the report notes that most developers work for Apple or Google and that there is:

Little transparency regarding how decisions are made, and no public information provided on this

Bearing that in mind, it seems odd to me that WebKit comes above Mozilla, but I doubt the percentages should be taken too seriously.

It is good to see a report that looks carefully at what it really means to be open, and the focus on governance makes sense.

Mozilla CEO fearful of closed mobile platforms. So what next for Mozilla and Firefox?

What next for Mozilla? Tristan Nitot, president of Mozilla Europe, posts about some of the issues facing the open source browser project and Foundation. His list is not meant to be a list of problems for Mozilla exactly, but it does read a bit like that, especially the third point:

Google marketing budgets for Chrome are much larger than Mozilla’s annual revenue.

though he does not mention how much of Mozilla’s income actually comes from Google. The Foundation’s last published figures are from 2009, and show that most of Mozilla’s income is from deals with search providers, and while it is not specified, both common sense and evidence from previous years tells us that most of that is from Google.

Chrome is a mighty competitor on the PC, but here at least Mozilla has a large and established base of users. That is not so on mobile, and this is even more challenging, as Nitot notes:

In the mobile space, not all platforms enable the user to choose what Web browser to use. This trend may also be coming to the PC world with Chrome OS, which only runs Chrome.

He also refers to a recent interview in which CEO Ben Kovacs talks about why there is no Firefox for Apple iOS:

The biggest challenge is to get access to the lowest level of the device, these open platforms are not quite open, which is why we are worried about it, you don’t have the true open web.

He adds:

It frightens me, it frightens me from a user point of view, I am not allowed to choose.

It is hard to see how Safari will not always be the browser for iOS, and while Mozilla has better chances on Android, it is hard to see how Google’s stock browser will not always dominate there.

At a browser engine level, Mozilla has lost out to WebKit, which is used by Apple Safari, Google Chrome, RIM Playbook and HP WebOS. Microsoft’s Windows Phone 7 uses Internet Explorer.

What can Mozilla do? Well, it seems that Mozilla executives have in mind to go beyond the browser into the world of apps. Kovacs hints at this in the interview above. In another post, the Chair of the Foundation Mitchell Baker says:

… the browser is no longer the only way people access the Internet. People also use more focused “apps” to do discrete tasks, and often feel a strong sense of attachment to the apps and the app model. This is an exciting addition. Mozilla should embrace some aspects of the current app model in addition to the browser model.

Therefore we find Firefox Home in Apple’s App Store:

image

That said, it is not clear to me what sort of major contribution Mozilla can make in the app world, and the transition from browser company to app company would be a difficult one to pull off.

I cannot escape the thought that Mozilla’s time is passing. Its success was built not only on an excellent browser, but also on widespread dissatisfaction with Microsoft’s Internet Explorer and the stifling effect it was having on the progress of web standards. Firefox was a better browser, and gained disruptive momentum. In Germany Firefox currently has a 55% market share, according to Statcounter.

However, while Firefox is still a great desktop browser, Google and WebKit between them are now strongly advancing web standards, and even Microsoft is now talking up HTML 5. Mozilla has largely achieved its goal, leaving it now with an uncertain purpose.

It is good for web standards to have a powerful independent non-profit foundation, rather than having commercial giants like Google and Apple dominate, but in the end this has to be paid for either by a business model, or by sponsors. In this latter respect, IBM’s withdrawal of funding for Firebug author John Barton is not a good sign.

In retrospect, Mozilla was too slow to embrace mobile; but most of the developments which are now impacting the Foundation are outside its control. On a day when Apple has announced breathtaking profits, it is worth noting Kovacs remarks about the chilling effects of closed platforms on Mozilla’s work.

Fast JavaScript engine in Apple iOS 4.3 is in standalone Safari only, but why?

Now that Apple iOS 4.3 is generally available for iPhone and iPad, users have noticed something that seems curious. The fast new “Nitro” JavaScript engine only works in the standalone Safari browser, not when a web app is pinned to the home screen, or when a web view is embedded into an app.

This link at mobilexweb.com shows the evidence. Here is the SunSpider test standalone, showing a time of 4098ms, and pinned to the home screen as an app, where it shows 10391.9ms:

image image

The consequence: apps created using WebKit as a runtime, for example using PhoneGap, will not get the benefit of Nitro.

It would be easy to conclude that Apple is deliberately hobbling these apps in order to protect native apps, which can only be installed via Apple’s App Store and are subject to its 30% cut. However that might not be the case. It could be a bug – according to Hacker News it has been reported as such:

To add another note to this, its a bug that Apple seems to know about. I can’t link to it because its marked CONFIDENTIAL across the top of the dev forums, but in short its known about and being investigated.

or it could be a security feature. Using a just-in-time compiler exposes the operating system more than just interpreting the code; perhaps Safari has more protection when running standalone.

Either way, with the increasing interest in WebKit as a de facto cross-platform application runtime for mobile, this particular limitation is unfortunate.

Update: There are also reports of the HTML 5 offline cache not working other than in full Safari:

I’ve tested this by switching apple-mobile-web-app-capable from ‘yes’ to ‘no’ and offline cache works as expected. But whenever it’s switched back to ‘yes’, it’s not working anymore. This occurs when the app is standalone at home screen. As a website, viewed with Safari cache is working as expected.

Ten big tech trends from 2010

This was an amazing year for tech. Here are some of the things that struck me as significant.

Sun Java became Oracle Java

Oracle acquired Sun and set about imposing its authority on Java. Java is still Java, but Oracle lacks Sun’s commitment to open source and community – though even in Sun days there was tension in this area. That was nothing to the fireworks we saw in 2010, with Java Community Process members resigning, IBM switching from its commitment to the Apache Harmony project to the official OpenJDK, and the Apache foundation waging a war of words against Oracle that was impassioned but, it seems, futile.

Microsoft got cloud religion

Only up to a point, of course. This is the Windows and Office company, after all. However – and this is a little subjective – this was the year when Microsoft convinced me it is serious about Windows Azure for hosting our applications and data. In addition, it seems to me that the company is willing to upset its partners if necessary for the sake of its hosted Exchange and SharePoint – BPOS (Business Productivity Online Suite), soon to become Office 365.

This is a profound change for Microsoft, bearing in mind its business model. I spoke to a few partners when researching this article for the Register and was interested by the level of unease that was expressed.

Microsoft also announced some impressive customer wins for BPOS, especially in government, though the price the customers pay for these is never mentioned in the press releases.

Microsoft Silverlight shrank towards Windows-only

Silverlight is Microsoft’s browser plug-in which delivers multimedia and the .NET Framework to Windows and Mac; it is also the development platform for Windows Phone 7. It still works on a Mac, but in 2010 Microsoft made it clear that cross-platform Silverlight is no longer its strategy (if it ever was), and undermined the Mac version by adding Windows-specific features that interoperate with the local operating system. Silverlight is still an excellent runtime, powerful, relatively lightweight, easy to deploy, and supported by strong tools in Visual Studio 2010. If you have users who do not run Windows though, it now looks a brave choice.

The Apple iPad was a hit

I still have to pinch myself when thinking about how Microsoft now needs to catch up with Apple in tablet computing. I got my first tablet in 2003, yes seven years ago, and it ran Windows. Now despite seven years of product refinement it is obvious that Windows tablets miss the mark that Apple has hit with its first attempt – though drawing heavily on what it learnt with the equally successful iPhone. I see iPads all over the place, in business as well as elsewhere, and it seems to me that the success of a touch interface on this larger screen signifies a transition in personal computing that will have a big impact.

Google Android was a hit

Just when Apple seemed to have the future of mobile computing in its hands, Google’s Android alternative took off, benefiting from mass adoption by everyone-but-Apple among hardware manufacturers. Android is not as elegantly designed or as usable as Apple’s iOS, but it is close enough; and it is a relatively open platform that runs Adobe Flash and other apps that do not meet Apple’s approval. There are other contenders: Microsoft Windows Phone 7; RIM’s QNX-based OS in the PlayBook; HP’s Palm WebOS; Nokia Symbian and Intel/Nokia MeeGo – but how many mobile operating systems can succeed? Right now, all we can safely say is that Apple has real competition from Android.

HP fell out with Microsoft

Here is an interesting one. The year kicked off with a press release announcing that HP and Microsoft love each other to the extent of $250 million over three years – but if you looked closely, that turned out to be less than a similar deal in 2006. After that, the signs were even less friendly. HP acquired Palm in April, signalling its intent to compete with Windows Mobile rather than adopting it; and later this year HP announced that it was discontinuing its Windows Home Server range. Of course HP remains a strong partner for Windows servers, desktops and laptops; but these are obvious signs of strain.

The truth though is that these two companies need one another. I think they should kiss and make up.

eBook readers were a hit

I guess this is less developer-oriented; but 2010 was the year when electronic book publishing seemed to hit the mainstream. Like any book lover I have mixed feelings about this and its implications for bookshops. I doubt we will see books disappear to the same extent as records and CDs; but I do think that book downloads will grow rapidly over the next few years and that paper-and-ink sales will diminish. It is a fascinating tech battle too: Amazon Kindle vs Apple iPad vs the rest (Sony Reader, Barnes and Noble Nook, and others which share their EPUB format). I have a suspicion that converged devices like the iPad may win this one, but displays that are readable in sunlight have special requirements so I am not sure.

HTML 5 got real

2010 was a huge year for HTML 5 – partly because Microsoft announced its support in Internet Explorer 9, currently in beta; and partly because the continued growth of browsers such as Mozilla Firefox, and the WebKit-based Google Chrome, Apple Safari and numerous mobile browsers showed that HTML 5 would be an important platform with or without Microsoft. Yes, it is fragmented and unfinished; but more and more of HTML 5 is usable now or in the near future.

Adobe Flash survived Apple and HTML 5

2010 was the year of Steve Jobs’ notorious Thoughts on Flash as well as a big year for HTML 5, which encroaches on territory that used to require the services of a browser plug-in. Many people declared Adobe Flash dead, but the reality was different and the company had a great year. Apple’s focus on design and usability helps Adobe’s design-centric approach even while Apple’s refusal to allow Flash on its mobile computers opposes it.

Windows 7 was a hit

Huge relief in Redmond as Windows 7 sold and sold. The future belongs to mobile and cloud; but Windows is not going away soon, and version 7 is driving lots of upgrades as even XP diehards move over. I’m guessing that we will get first sight of Windows 8 in 2011. Another triumph, or another Vista?

New Amazon Kindle with WebKit browser and free 3G internet

Never mind the books. Amazon’s new Kindle reader is offering as an “experimental feature” a web browser based on WebKit – the same engine as Apple Safari and Google Chrome – that is free to use over 3G networks:

New WebKit-Based Browser
Kindle’s new web browser is based on WebKit to provide a better web browsing experience. Now it’s easier than ever to find the information you’re looking for right from your Kindle. Experimental web browsing is free to use over 3G or Wi-Fi.

Amazon pays for the 3G coverage which is available globally. OK, it is monochrome, but since the Kindle also has a neat little keyboard is this now a great deal for blogging, checking Google maps, and so on?

image

Maybe not. Here’s what the terms and conditions say:

Use of Wireless Connectivity. Your Kindle uses wireless connectivity to allow you to shop for and download Digital Content from the Kindle Store. In general, we do not charge you for this use of wireless connectivity … You may use the wireless connectivity provided by us only in connection with the Service. You may not use the wireless connectivity for any other purpose.

If you are like me you may feel there is some inconsistency between these two statements. Enough to say that from my point of view free global web browsing would be a big incentive to purchase a Kindle; but I suspect that if this is real and turns out to be a popular feature consuming significant data traffic, Amazon will soon find a way to charge for it or turn it off.

It is also interesting to see a smidgen of convergence between the Kindle and more general-purpose slate devices. I am not sure if the Kindle strictly counts as a slate since it has a keyboard, but it certainly has the slate look and feel.