All posts tagged ‘Webkit’

File Under: Browsers

What Makes WebKit, WebKit?

WebKit, the rendering engine that powers web browsers like Google’s Chrome, Apple’s Safari, and soon Opera as well, has become a developer favorite thanks to its support for web standards and near-ubiquity in the mobile world.

Unfortunately for developers, WebKit isn’t always WebKit. While WebKit-based browsers share some code, not every WebKit-based browser behaves exactly the same way.

WebKit is an open source project with dozens of browsers based off the core code. But WebKit doesn’t have everything you need to build a graphical web browser, which means there’s considerable variation even among the two biggest WebKit users — Google and Apple.

To clear up just what WebKit is, and why there’s sometimes quite a bit of difference between WebKit browsers, Google’s Paul Irish — who is part of Chrome’s Developer Relations team — has put together a comprehensive guide to WebKit. Irish covers exactly what WebKit is, what it isn’t, how WebKit is used by WebKit-based browsers and why not all “WebKits” are the same.

Irish’s write-up should be required reading for all developers, but especially anyone who’s ever wondered why something works in Chrome, but not Safari; or why 3D transforms that fly in one WebKit-based browser crawl in another (short answer: GPU code is not shared among WebKit browsers).

When you’ve finished with Irish’s overview, be sure to follow the links at the bottom of his post for more details — particularly worth your time is Eric Seidel’s talk on how WebKit renders a webpage.

File Under: Browsers, Web Standards

Give the Web the Finger With Microsoft’s Proposed ‘Pointer Events’

The proposed Pointer Events spec makes it easier to handle input from fingers, pens. Image: W3C.

The W3C recently moved Microsoft’s proposed Pointer Events spec to Last Call Working Draft. To help developers get up to speed, the IEBlog has published an overview of Pointer Events.

Microsoft has even helped to create a build of WebKit with experimental support for Pointer Events (for those not using Windows 8 or who’d prefer not to test in IE 10).

The goal of the Pointer Events spec is to provide a unified model for dealing with all the various input devices on today’s web, namely, the mouse, the stylus and the finger.

Pointer Events handle the various ways a user might be interacting with your site without requiring you to write unique code for each input method.

Currently most browsers register any input as a mouse event, even when it obviously is not (as is the case for most mobile browsers). It works, but it’s what you might call a blunt approach. Pointer Events adds some finesse to the equation, including details like the touch contact geometry size, the pressure applied or the tilt angle of a pen.

If you’d like to get your hands dirty with Pointer Events, either fire up IE 10 or download the experimental WebKit build and head on over to the W3C’s Web Platform docs. Microsoft’s Rob Dolin has a great overview tutorial with basic examples on how to get started. Also be sure to watch the video below from the recent W3Conf; Jacob Rossi, IE Program Manager gives a nice overview of Pointer Events and what you can do with them.

Right now only IE 10 supports Pointer Events, but Microsoft’s David Catuhe has developed a JavaScript polyfill, called HandJS, to support Pointer Events in browsers that don’t yet offer native support. Kudos to Microsoft for not just bringing pointer events to the W3C, but for working to add support to a competing browser and creating a polyfill for the rest.

File Under: Browsers, Web Standards

Think One Fewer Browser Means Less Work? Think Again

WebKit: not actually one ring, but many, many rings. Image: Screenshot/Webmonkey

Opera software is abandoning its homegrown rendering engine in favor of the open source WebKit rendering engine. Many developers seem to think this means one fewer browser to test in, but unfortunately, that’s not the case.

The problem with the dream of less testing because there’s more WebKit is that “WebKit” can mean many things. The WebKit in Safari does not have all the features you’ll find in the WebKit that powers Google Chrome. The situation gets even more complicated with mobile where there are about as many different versions of WebKit as there are browsers.

As Mozilla’s Rob Hawkes and Robert Nyman point out in the post WebKit: An Objective View, that means “each browser will still have its own quirks, performance differences, design, and functionality. These should all be tested for.”

Worse, individual WebKit browsers can pick and choose which APIs to include in their final builds, which means just because something is available in WebKit, does not mean it’s available in, for example, both Chrome and Safari. Couple this with Safari’s relatively slow release schedule and just the two major desktop WebKit variants are going to require testing to make sure everything works.

Throwing a WebKit-based Opera in the mix just means another WebKit browser that needs to be part of your testing.

There’s nothing wrong with this state of affairs, nor will it change all that much when Opera is on WebKit as well, but it won’t mean less testing, nor is it going to make web developers’ lives any easier (especially since most of them weren’t testing in Opera anyway).

Testing will always be a necessary part of web development, but the danger that Hawkes and Nyman foresee is that developers will test less because they assume that if something works in one version of WebKit it will work in all of them. While that hasn’t happened yet, the CSS prefix debacle certainly doesn’t bode well for the WebKit-heavy future.

File Under: Browsers

Presto Is Dead; Long Live Opera!

Opera software announced this morning that it is dumping its homegrown Presto rendering engine in favor of the increasingly ubiquitous WebKit rendering engine.

For all new products Opera will use WebKit as its rendering engine and V8 as its JavaScript engine, mirroring what you’ll find in Google’s Chrome browser. Apple’s Safari also uses WebKit, though it has its own JavaScript engine.

Writing on the Opera Developer Blog, Opera’s Bruce Lawson says the first WebKit-based Opera browser “will be for smartphones, which we’ll demonstrate at Mobile World Congress in Barcelona at the end of the month.”

While Opera’s desktop market share hovers around 2 to 4 percent, the company’s two mobile browsers have, until very recently, been the most used mobile browsers on the web.

Indeed, while Opera’s official announcement is vague about the reasons for the switch, it doesn’t take a soothsayer to know that the reason is mobile. One influencing factor is no doubt the fact that Apple’s iOS only allows third-party web browsers if they use the built-in WebKit rendering engine.

Then there’s the -webkit CSS vendor prefix problem. At least some of the blame for Presto’s demise falls on web developers for developing against WebKit, rather than using web standards.

CSS vendor prefixes were designed to help web developers by giving them a way to target CSS to specific browsers and use proposed standards before they were finalized. The idea was to move the web forward without rushing the CSS standards process. Unfortunately, it hasn’t always worked out that way. In fact, web developers fell in love with the -webkit prefix and often forget that there are other prefixes as well: -o for Opera, -moz for Firefox and -ms for Internet Explorer.

Using only -webkit means sites break in Opera even though Opera could have rendered the site just fine if the developer had bothered to include the -o prefix.

Of course, as Mozilla’s Christian Heilmann points out, “content not showing up or showing up broken in your product is terrible for a commercial company — the web is never wrong, if your browser shows it wrongly it is your fault, right?”

It would always be Opera’s fault in the eyes of most users and that’s why the company decided to support the -webkit prefix last year. In many ways today’s announcement is just one step further — if you’re going to support the prefix, why not just use the rendering engine? That seems to be exactly what Opera has decided to do.

So what becomes of the Opera features you know and love? The DragonFly developer tools are most likely done for, WebKit already has its own developer tools. It’s less clear what might happen to Opera’s other unique features like the built-in e-mail client or Opera Turbo, which compresses webpages to give broadband-like speeds on almost any internet connection.

An Opera spokesperson declined to comment on the future of any Opera features, telling Webmonkey only that “compression is in Opera’s DNA, but other than that we don’t talk about features of unreleased products.”

While I’m optimistic about Opera’s WebKit future, it’s hard to see the loss of a rendering engine as anything but bad news for the web. One less rendering engine means one less way to discover and fix bugs in web standards, one less place to see what you’ve done wrong. And Opera, while sometimes difficult to test in, was almost always right when it came to implementing web standards. In 13 years of building websites I’ve found no other testing environment in which I knew that if something didn’t work, it was almost certainly my code that was wrong. And I’m not alone; apparently even some Chromium developers feel the same way.

But that won’t stop developers who’d like to see a monoculture of WebKit from shortsightedly cheering this news.

Mozilla developer Robert O’Callahan summarizes why a WebKit-centric web is not a good thing:

some people are wondering whether engine diversity really matters. ‘Webkit is open source so if everyone worked together on it and shipped it, would that be so bad?’ Yes. Web standards would lose all significance and standards processes would be superseded by Webkit project decisions and politics. Webkit bugs would become the standard: there would be no way for developers to test on multiple engines to determine whether an unexpected behavior is a bug or intended.

WebKit makes a fine rendering engine and it does a good job of keeping up with web standards, but don’t assume that just because a web browser uses WebKit under the hood that it will render your pages the same as every other WebKit browser. Just look at the rendering and feature differences between Chrome, Safari, Mobile Safari and Mobile Chrome to get a sense of the pain that awaits developers yearning for a WebKit monoculture.

The other possible downside to a WebKit Opera is that the company’s once mighty voice for standards may not be heard as clearly amid the Google- and Apple-dominated WebKit developer culture.

Hopefully the WebKit community will find a place for the developers who brought us tabbed browsing, mouse gestures, “Speed Dial”, Turbo, and an uncompromising support for web standards that made Opera one of the first browsers to pass both the ACID 2 and ACID 3 page-rendering tests. For its part Opera is starting off on the right foot, offering up code that brings Presto-quality support for the CSS Multi-column Layout Module to WebKit.

Hopefully Opera engineers will continue to bring the same kind of innovation to WebKit and Chromium as they did to Presto and with any luck WebKit will listen and the web will end up a better, if less diverse, place.

File Under: Browsers

New Opera 12.50 Dons WebKit Disguise

Is it Opera or is it WebKit? Photo: Ariel Zambelich/Wired

 Opera software has made good on its controversial decision to support the -webkit CSS prefix. The browser maker has released a preview version of Opera 12.50 with support for a dozen -webkit prefixed CSS properties, including transforms, transitions and border-radius.

If you’re curious and want to see how Opera handles -webkit prefixes, head on over to Opera and download the latest version of Opera Next for Windows 32-bit, Windows 64-bit, Mac or Linux. (Keep in mind that 12.50 is still a very early release and contains some known bugs.)

Opera’s decision to support another browser’s CSS prefix code has caused considerable outcry among web developers and members of the CSS Working Group, which created vendor prefixes.

CSS vendor prefixes were designed to help web developers by giving them a way to target CSS to specific browsers and use proposed standards before they were finalized. The idea was to move the web forward without rushing the CSS standards process. Unfortunately, it hasn’t always worked out that way. In fact, web developers fell in love with the -webkit prefix and often forget that there are other prefixes as well: -o for Opera, -moz for Firefox and -ms for Internet Explorer.

The problem, in Opera’s view, is that instead of writing code that will work in any web browser, some of even the largest sites on the web are coding exclusively for WebKit (the rendering engine that powers web browsers on the iPhone, iPad and Android phones). Web developers have, the argument goes, created the same sort of monoculture that used to exist around Internet Explorer, with websites proudly proclaiming they “work best in WebKit.”

Opera decided that, in order to remain competitive, it needed to support -webkit in addition to its normal -o prefix.

The company previously updated its mobile emulator tool to support -webkit, but Opera 12.50 is the first actual browser release to do so.

Naturally the -webkit prefix support isn’t the only thing new in Opera 12.50. This release also manages to pack in an implementation of the Clipboard API, and Mac Opera users will find that Opera 12.50 uses Mac OS X 10.8’s coming Notification Center.