|
|
Subscribe / Log in / New account

WebKit, Blink, and the big split

Did you know...?

LWN.net is a subscriber-supported publication; we rely on subscribers to keep the entire operation going. Please help out by buying a subscription and keeping LWN on the net.

By Nathan Willis
September 18, 2013
LinuxCon North America

The WebKit web rendering engine is used by free software projects of just about every flavor, from embedded Linux products to desktop browsers. Until recently, it was also the rendering engine that powered Google's Android and Chrome. At LinuxCon North America 2013 in New Orleans, Juan Sanchez from Igalia presented an inside look at the history of WebKit, and shared some thoughts on how the project will be affected by Google's decision to fork WebKit and create its own Blink engine.

Considering all the talk about HTML5 as the future of application development, Sanchez said, people talk surprisingly little about the actual components that go into delivering that future. WebKit is a key player, he explained. It is essentially the only practical choice for free software developers who want to embed web rendering into their code; Mozilla's Gecko is a highly capable rendering engine as well, but it is tied to the internals of Firefox in ways that make it less flexible for other uses. Igalia is one of the top contributors to WebKit; the company maintains the WebKitGTK+ "port" (a term with a specific meaning in the WebKit community) and it does a lot of consulting work for other companies which often includes embedding the WebKit engine.

The bird's eye kit

Sanchez reviewed the history of the project, and how the architecture of the code has evolved along with the community. WebKit started off as a fork of the KHTML renderer and KJS JavaScript engine from KDE. Apple began WebKit development in 2001, then opened the project up (with its contributions under a permissive BSD license) in 2005. WebKit's scope is limited: it just provides an engine that can understand and render HTML, CSS, JavaScript, and the Document Object Model (DOM), plus ways to interact with those web page contents. It does not attempt to be a browser on its own, and project members are not interested in turning WebKit into one. The project's focus is on compatibility: adhering to standards and providing components that are rigorously tested for compliance. As such, the project is pragmatic about its decision making—or as Sanchez put it, "WebKit is an engineering project, not a science project."

[Juan Sanchez]

The entirety of what is commonly called WebKit consists of a few discrete parts, he said. There is the component called "WebKit," which simply provides a thin API layer for applications above it in the stack. Underneath this layer is "WebCore," which contains the rendering engine, page layout engine, and network access—the bulk of the functionality. In addition, there is a JavaScript engine (although which one is used varies from one WebKit-based application to another), and a platform-specific compatibility layer that hooks into general-purpose system libraries.

A "port" in WebKit is a version of WebKit adapted to specific target platform. The main ports maintained by the project are iOS, OS X, GTK+, Qt, EFL (for Tizen), and Google's Chromium. One new port is being discussed: WebKitNIX, which would be a lightweight port for OpenGL. But there are many smaller ports of WebKit as well, such as those for Symbian and Blackberry. To further illustrate how ports are designed, Sanchez explained how the WebKitGTK+ port is structured: The WebKit API layer becomes webkit/gtk, the JavaScript engine is JavaScriptCore, and the platform-specific compatibility layer calls out to GNOME components like libsoup, GStreamer, Cairo, and the Accessibility Toolkit (ATK).

Recent history and changes

In addition to the architecture described above, there is also another, known as WebKit2, which is currently in development. As Sanchez explained, WebKit2 is intended to replace the "WebKit" API layer, primarily to support a split-process model. In the new model, the user interface runs in one process, the main parsing and rendering of web content runs in a second process, and browser plugins run in a third. The goals are increased stability and performance, plus better security brought about by isolating the processes. Apple initiated the WebKit2 effort, and the code is currently working in the GTK+ and Qt ports as well. It is more-or-less complete, so that WebKit1 will move into maintenance mode shortly.

A major issue, however, is that WebKit2 is unrelated to Google's own work adapting Chrome to a split-process design. Chrome draws the "split process" barrier lower, so that each Chrome instance can have several rendering processes. This difference of opinion between Apple and Google goes back quite a ways, but it certainly contributed to Google's recent decision to fork WebKit and create Blink.

Another possible factor in the split related to project governance. The project has long had just two officially-defined roles: committer and reviewer. A committer must have sent in 20 to 30 patches and demonstrated a commitment to the project's rules: once designated a committer, a person can submit changes, although their changes are always reviewed. Becoming a designated reviewer is more difficult: around 300 patches are required, and three existing reviewers must vouch for the candidate. But once designated, a reviewer can commit changes directly, without review. More recently, though, Apple introduced the new top-level role of "owner," and declared that only owners would be allowed to commit changes to WebKit2.

Google abruptly left WebKit in April, via a surprise announcement that Sanchez said came as a shock to the WebKit community. Over the preceding years, as it had contributed to WebKit for Chrome, Google had risen to the point of equaling Apple in terms of the number of commits—each company contributed about one third of the changes to the code, with the remaining third coming from everyone else (Igalia included). In addition to the number of commits, Google actually had more engineers working on WebKit than did any other company (including Apple, who had fewer developers even though those developers produced as many patches as Google's).

WebKit from here on out

The divergence of Chrome and WebKit's multi-process model and Apple's desire to add a top-tier level of committer were both factors in Google's decision to start Blink, but there were other factors, too. Sanchez said that Google expressed its desire to simplify Blink's architecture, eliminating the concept of ports altogether and building the rendering engine specifically to suit Chrome's needs. The Blink code has already started to diverge, he said, and so far the Blink governance model is far simpler: there is no official code review, just people submitting changes and looking at others' changes informally. The majority of the Blink developers are Google employees, he said, but outside contributors have begun to appear, too.

Google's departure will certainly have an impact on WebKit, Sanchez said, although how much remains to be seen. The company obviously contributed a lot of code, so the developer-power will be missed, as will Google's ability to balance out Apple. With Apple as the largest remaining contributor to the project (and by a large margin), it will likely be more difficult for other companies or volunteers to have a say in steering the project.

The WebKit community is already seeing the impact of Google's departure in terms of orphaned modules that now need new maintainers. But there are also several instances of downstream projects dropping WebKit in favor of Blink. Sanchez noted that Opera had announced it would switch to WebKit just a few days before the Blink announcement; the company then issued a follow-up announcement announcing that it would be switching from WebKit to Blink. More recently, of course, Qt announced that it would adopt Blink as its HTML rendering engine, too.

On the other hand, Sanchez said, there were positive outcomes to Google's departure. Apple now seems likely to drop its proposal for a formal "owner" contributor role. There are also several hacks put into WebKit specifically for Chrome support that have already been removed. But that also means that the two rendering engines have already begun to diverge, and Sanchez said he was not sure how long code would remain portable between the two. It is good that free software developers now have two engines to choose from when creating an embedded web application, after so many years of WebKit being the only viable option. But the divergence could ultimately prove bad for the community, at least in some ways. Only time will tell.

[The author would like to thank the Linux Foundation for assistance with travel to New Orleans.]

Index entries for this article
ConferenceLinuxCon North America/2013


(Log in to post comments)

WebKit, Blink, and the big split

Posted Sep 19, 2013 7:25 UTC (Thu) by oever (guest, #987) [Link]

Great writeup!

If Google is removing the idea of ports from WebKit/Blink, this will affect how it can be used in Qt. The "ports" in WebKit/Blink are an abstraction around native classed for the widget set. Google uses Skia, Qt uses Qt. I wonder how this issue will be solved. It was not addressed in the accouncement of Qt WebEngine.

WebKit, Blink, and the big split

Posted Sep 19, 2013 14:01 UTC (Thu) by kov (guest, #7423) [Link]

Ports in Blink go on top of the Chrome embedding framework. So the Qt port of Chromium - it really is a chromium port, not a blink port - will only be able to provide a viewport widget and custom APIs, it won't be able to change the internals. That means it will be using Skia for painting the page.

WebKit, Blink, and the big split

Posted Sep 23, 2013 12:40 UTC (Mon) by jospoortvliet (guest, #33164) [Link]

Interesting. Sounds, honestly, like a less ideal situation - I've already seen some people commenting on the fact that they'll loose some interesting abilities to interact with the DOM tree and html that were available in Qt.

WebKit, Blink, and the big split

Posted Sep 23, 2013 14:21 UTC (Mon) by hummassa (guest, #307) [Link]

care to elaborate or send some pointers here?

Slides of the LinuxCon talk

Posted Sep 19, 2013 12:36 UTC (Thu) by clopez (guest, #66009) [Link]

WebKit, Blink, and the big split

Posted Sep 19, 2013 14:06 UTC (Thu) by kov (guest, #7423) [Link]

Great article, and it looks like it was a great talk! I'd like to point out two small incorrections:

1) it's no longer the case that each port decides which JS engine to use. In fact, of all the in-tree ports, it was only chromium using v8 as the JS engine, and when it left the tree v8 and all of the infrastructure which allowed for its coexistence with JSCore were removed from the tree.

2) the number of commits for committer/reviewer are officially 10-20 and 80 (http://www.webkit.org/coding/commit-review-policy.html) but it is quite true that much more than those may be required for someone to be accepted.

WebKit, Blink, and the big split

Posted Sep 19, 2013 14:08 UTC (Thu) by kov (guest, #7423) [Link]

I disagree that the OWNER role had anything to do with Google's departure. That role was only used for the WebKit2 codebase, a codebase which chromium never used and did not plan to use. That decision only affected what we call the small ports - GTK+, Qt, EFL - which are actively using WebKit2. I agree the tension between WebKit2 and chromium architecture requirements being an important factor, though, there was a lot of arguing about how to refactor WebCore components, because WebKit2 and chromium requirements clashed constantly.

WebKit, Blink, and the big split

Posted Sep 20, 2013 7:15 UTC (Fri) by jmah (guest, #80103) [Link]

This was a great and informative read, thanks!


Copyright © 2013, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds