WebKit | |
---|---|
![]() | |
Original author(s) | Apple Inc.[1][2] |
Developer(s) | Apple Inc.,Adobe Systems,Sony,KDE,Igalia, and others |
Initial release | November 4, 1998; 26 years ago (1998-11-04) (KHTML released) June 7, 2005; 20 years ago (2005-06-07) (WebKit sourced) |
Preview release | Nightly[3] |
Repository | github |
Written in | C++[4] |
Operating system | macOS,iOS,Linux,[5]Microsoft Windows[6][7] |
Type | Browser engine |
License | LGPLv2.1 (rendering engine, JavaScript engine),BSD 2-Clause (additional contributions from Apple)[8] |
Website | webkit |
WebKit is abrowser engine primarily used inApple'sSafariweb browser, as well as all web browsers oniOS andiPadOS. WebKit is also used by thePlayStation consoles starting with the PS3, theTizen mobile operating systems, theAmazon Kindlee-book reader,Nintendo consoles starting with the3DS Internet Browser,GNOME Web, and the discontinuedBlackBerry Browser.
WebKit started as afork of theKHTML andKJS libraries fromKDE,[1][9] and has since been further developed byKDE contributors,Apple,Google,Nokia,[9]Bitstream,BlackBerry,Sony,Igalia, and others.[10] WebKit supportsmacOS,Windows,Linux, and various otherUnix-likeoperating systems.[11] On April 3, 2013, Google announced that it had forked WebCore, a component of WebKit, to be used in future versions ofGoogle Chrome and theOpera web browser, under the nameBlink.[12][13]
ItsJavaScript engine, JavascriptCore, also powers theBun server-side JS runtime,[14] as opposed toV8 used byNode.js,Deno, andBlink. WebKit'sC++application programming interface (API) provides a set ofclasses to displayWeb content inwindows, and implements browser features such as following links when clicked by the user, managing a back-forward list, and managing a history of pages recently visited.
WebKit isopen source and available under theBSD 2-Clause license[15][8] with the exception of theWebCore andJavaScriptCore components, which are available under theGNU Lesser General Public License. As of March 7, 2013, WebKit is a trademark of Apple, registered with theUnited States Patent and Trademark Office.[16]
The code that would become WebKit began in 1998 as theKDE HTML (KHTML) layout engine andKDE JavaScript (KJS) engine. The WebKit project was started within Apple by Lisa Melton[17] on June 25, 2001,[18][19] as afork ofKHTML andKJS. Melton explained in an e-mail to KDE developers[1] thatKHTML andKJS allowed easier development than other available technologies by virtue of being small (fewer than 140,000lines of code), cleanly designed and standards-compliant. KHTML and KJS were ported tomacOS with the help of an adapterlibrary and renamed WebCore and JavaScriptCore.[1] JavaScriptCore was announced in an e-mail to a KDEmailing list in June 2002, alongside the first release of Apple's changes.[20]
According to Apple, some changes which called for different development tactics involved macOS-specific features that are absent in KDE's KHTML, such asObjective-C, KWQ (pronounced "quack") an implementation of the subset of Qt required to make KHTML work on macOS written in Objective C++, and macOS calls.[21]
The exchange of code between WebCore and KHTML became increasingly difficult as the code base diverged because both projects had different approaches in coding and code sharing.[22] At one point KHTML developers said they were unlikely to accept Apple's changes and claimed the relationship between the two groups was a "bitter failure".[23] They claimed Apple submitted their changes in large patches containing multiple changes with inadequate documentation, often in relation to future additions to the codebase. Thus, these patches were difficult for theKDE developers to integrate back into KHTML.[24] Also, Apple had demanded that developers sign non-disclosure agreements before looking at Apple's source code and even then they were unable to access Apple's bug database.[25]
During the publicized "divorce" period, KDE developer Kurt Pfeifle (pipitas) posted an article claiming KHTML developers had managed tobackport many (but not all) Safari improvements from WebCore to KHTML, and they always appreciated the improvements coming from Apple and still do so. The article also noted Apple had begun to contact KHTML developers about discussing how to improve the mutual relationship and ways of future cooperation.[26] In fact, the KDE project was able to incorporate some of these changes to improve KHTML's rendering speed and add features, including compliance with theAcid2 rendering test.[27]
Following the appearance of a story of the fork in the news, Apple released the source code of the WebKit fork in a publicrevision-control repository.[28]
The WebKit team had also reversed many Apple-specific changes in the original WebKit code base and implemented platform-specific abstraction layers to make committing the core rendering code to other platforms significantly easier.[29]
In July 2007,Ars Technica reported that the KDE team would move from KHTML to WebKit.[30] Instead, after several years of integration, KDE Development Platform version 4.5.0 was released in August 2010 with support for both WebKit and KHTML, and development of KHTML continued until 2016 before it was officially discontinued in 2023.[31][32]
On June 7, 2005, Safari developerDave Hyatt announced on hisweblog that Apple was open-sourcing WebKit (formerly, only WebCore and JavaScriptCore were open source) and opening up access to WebKit'srevision control tree and the issue tracker.[28]
In mid-December 2005, support forScalable Vector Graphics (SVG) was merged into the standard build.[33]
WebKit's JavaScriptCore and WebCore components are available under the GNU Lesser General Public License, while the rest of WebKit is available under the BSD 2-Clause license.[8]
![]() | This section needs to beupdated. Please help update this article to reflect recent events or newly available information.(July 2015) |
Beginning in early 2007, the development team began to implementCascading Style Sheets (CSS) extensions, includinganimation, transitions and both 2D and 3D transforms;[34] such extensions were released as working drafts to theWorld Wide Web Consortium (W3C) in 2009 for standardization.[35]
In November 2007, the project announced that it had added support for media features of theHTML5 draft specification, allowing embedded video to be natively rendered and script-controlled in WebKit.[36]
On June 2, 2008, the WebKit project announced they rewrote JavaScriptCore as "SquirrelFish", abytecodeinterpreter.[37][38] The project evolved into SquirrelFish Extreme (abbreviated SFX), announced on September 18, 2008, whichcompiles JavaScript into nativemachine code, eliminating the need for a bytecode interpreter and thus speeding up JavaScript execution.[39] Initially, the only supported processor architecture for SFX was thex86, but at the end of January 2009, SFX was enabled for macOS onx86-64 as it passes all tests on that platform.[40]
On April 8, 2010, a project named WebKit2 was announced to redesign WebKit. Its goal was to abstract the components that provide web rendering cleanly from their surrounding interface or application shell, creating a situation where, "web content (JavaScript, HTML, layout, etc) lives in a separate process from the application UI". This abstraction was intended to make reuse a more straightforward process for WebKit2 than for WebKit. WebKit2 had "an incompatible API change from the original WebKit", which motivated its name change.[41]
The WebKit2 targets were set to Linux, macOS, Windows,GTK, andMeeGo-Harmattan.[42][43] Safari for macOS switched to the new API with version 5.1.[44] Safari for iOS switched to WebKit2 with iOS 8.[45]
The original WebKit API has been renamed WebKitLegacy API.[46] WebKit2 API has been renamed just plain WebKit API.[47]
WebKit is used as the rendering engine withinSafari and was used byGoogle'sChrome web browser on Windows, macOS, andAndroid (before version 4.4 KitKat). Chrome used only WebCore, and included its ownJavaScript engine namedV8 and a multiprocess system.[48] Chrome foriOS continues to use WebKit because Apple requires that web browsers on that platform must do so.[49] Other applications on macOS and iOS make use of WebKit, such as Apple's e-mail clientMail, App Store, and the 2008 version of Microsoft'sEntouragepersonal information manager, both of which make use of WebKit to render HTML content.
New web browsers have been built around WebKit such as theS60 browser[50] onSymbian mobile phones,BlackBerry Browser (ver 6.0+),Midori,Chrome browser,[51][52] theAndroid Web browsers before version 4.4 KitKat, and the browser used inPlayStation 3 system software from version 4.10.[53] KDE's Rekonq web browser andPlasma Workspaces also use it as the native web rendering engine. WebKit has been adopted as the rendering engine inOmniWeb,iCab andWeb (formerly named Epiphany) andSleipnir, replacing their original rendering engines. GNOME's Web supported bothGecko and WebKit for some time, but the team decided that Gecko's release cycle and future development plans would make it too cumbersome to continue supporting it.[54]webOS uses WebKit as the basis of its application runtime.[55] WebKit is used to render HTML and run JavaScript in theAdobe Integrated Runtime application platform. InAdobe Creative Suite CS5, WebKit is used to render some parts of the user interface. As of the first half of 2010, an analyst estimated the cumulative number of mobile handsets shipped with a WebKit-based browser at 350 million.[56] By mid-April 2015, WebKitbrowser market share was 50.3%.[57]
The week after Hyatt announced WebKit's open-sourcing, Nokia announced that it had ported WebKit to theSymbian operating system and was developing a browser based on WebKit for mobile phones running S60. NamedWeb Browser for S60, it was used on Nokia, Samsung, LG, and other Symbian S60 mobile phones. Apple has also ported WebKit toiOS to run on theiPhone,iPod Touch, andiPad, where it is used to render content in the device's web browser and e-mail software.[58] TheAndroid mobile phone platform used WebKit (and later versions itsBlink fork) as the basis of its web browser[59][60][61] and thePalm Pre, announced January 2009, has an interface based on WebKit.[62] TheAmazon Kindle 3 includes an experimental WebKit based browser.[63]
In June 2007, Apple announced that WebKit had been ported toMicrosoft Windows as part of Safari. Although Safari for Windows was silently discontinued[64] by the company, WebKit's ports to Microsoft's operating system are still actively maintained.[65][66] The Windows port uses Apple's proprietary libraries to function and is used for iCloud[67] and iTunes[68] for Windows, whereas the "WinCairo" port is a fully open-source and redistributable port.[69][70]
WebKit has also been ported to several toolkits that support multiple platforms, such as theGTK toolkit forLinux, under the nameWebKitGTK which is used by Eolie,[71]GNOME Web,[72][73]Adobe Integrated Runtime,Enlightenment Foundation Libraries (EFL), and the Clutter toolkit.[74]Qt Software included a WebKit port in the Qt 4.4 release as a module called QtWebKit[75] (since superseded byQt WebEngine, which uses Blink instead). TheIris Browser on Qt also used WebKit. The Enlightenment Foundation Libraries (EFL) port – EWebKit – was developed (bySamsung and ProFusion[76]) focusing the embedded and mobile systems, for use as stand alone browser, widgets-gadgets, rich text viewer and composer.[citation needed] The Clutter port is developed byCollabora and sponsored byRobert Bosch GmbH.
There was also a project synchronized with WebKit (sponsored by Pleyo)[77] calledOrigyn Web Browser, which provided a meta-port to an abstract platform with the aim of making porting to embedded or lightweight systems quicker and easier.[78] This port is used for embedded devices such asset-top boxes, PMP and it has been ported intoAmigaOS,[79][80]AROS[81] andMorphOS. MorphOS version 1.7 is the first version ofOrigyn Web Browser (OWB) supportingHTML5 media tags.[82][83]
Web Platform for Embedded (WPE) is a WebKit port designed for embedded applications; it further improves the architecture by splitting the basic rendering functional blocks into a general-purpose routines library (libwpe), platform backends, and engine itself (called WPE WebKit).The GTK port, albeit self-contained, can be built to use these base libraries instead of its internal platform support implementation. The WPE port is currently maintained by Igalia.
On April 3, 2013, Google announced that it would produce a fork of WebKit's WebCore component, to be namedBlink. Chrome's developers decided on the fork to allow greater freedom in implementing WebCore's features in the browser without causing conflicts upstream, and to allow simplifying its codebase by removing code for WebCore components unused by Chrome. In relation toOpera Software's announcement earlier in the year that it would switch to WebKit by means of theChromium codebase, it was confirmed that theOpera web browser would also switch to Blink.[48] Following the announcement, WebKit developers began discussions on removing Chrome-specific code from the engine to streamline its codebase.[84] WebKit no longer has any Chrome specific code (e.g., buildsystem, V8 JavaScript engine hooks, platform code, etc.).[citation needed]
WebCore is a layout, rendering, andDocument Object Model (DOM)library for HTML andScalable Vector Graphics (SVG), developed by the WebKit project. Its full source code is licensed under theGNU Lesser General Public License (LGPL). The WebKit framework wraps WebCore and JavaScriptCore, providing an Objective-Capplication programming interface to theC++-based WebCore rendering engine and JavaScriptCore script engine, allowing it to be easily referenced by applications based on theCocoa API; later versions also include across-platform C++ platform abstraction, and various ports provide more APIs.[citation needed]
WebKit passes theAcid2 andAcid3 tests, with pixel-perfect rendering and no timing or smoothness issues on reference hardware.[85]
JavaScriptCore is a framework that provides aJavaScript engine for WebKit implementations, and provides this type of scripting in other contexts within macOS.[20][86] JavaScriptCore is originally derived fromKDE's JavaScript engine (KJS)library (which is part of the KDE project) and thePCREregular expression library. Since forking from KJS and PCRE, JavaScriptCore has been improved with many new features[example needed] and greatly improved performance.[87]
On June 2, 2008, the WebKit project announced they rewrote JavaScriptCore as "SquirrelFish", abytecodeinterpreter.[37][38] The project evolved into SquirrelFish Extreme (abbreviated SFX, marketed as Nitro), announced on September 18, 2008 further speeding up JavaScript execution.[39]
An optimizingjust-in-time (JIT) compiler namedFTL was announced on May 13, 2014.[88] It usesLLVM to generate optimized machine code. "FTL" stands for "Fourth-Tier-LLVM", and unofficially forfaster-than-light, alluding to its speed.[89] As of February 15, 2016, the backend of FTL JIT is replaced by "Bare Bones Backend" (or B3 for short).[90]
Removed for KF6, the 'kf5' branch contains the last maintained state.