Jump to content

WebKit

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 99.229.102.235 (talk) at 14:10, 10 February 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WebKit
Original author(s)KDE[1][2]
Developer(s)Apple, Adobe, KDE, and others
Initial releaseNovember 4, 1998; 25 years ago (1998-11-04) (KHTML released)
June 7, 2005; 19 years ago (2005-06-07) (WebKit open sourced)
Preview release
Nightly[3]
Repository
Written inC++
Operating systemCross-platform[4]
TypeLayout engine
LicenseBSD v2.0 (most of browser engine), GNU LGPL v2.1 (some files in the JavaScriptCore & WebCore components)
Websitewebkit.org

WebKit is a layout engine software component for rendering web pages in web browsers. It powers Apple's Safari web browser, and a fork of the project is used by Chromium-based browsers, such as Google Chrome or Opera.

WebKit also forms the basis for the experimental browser included with the Amazon Kindle e-book reader, as well as the default browser in the Apple iOS, BlackBerry Browser in OS 6 and above, and Tizen mobile operating systems. WebKit's C++ application programming interface provides a set of classes to display web content in windows, 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's HTML and JavaScript code was originally a fork of the KHTML and KJS libraries from KDE,[1][5] and has now been further developed by individuals from KDE, Apple, Google, Nokia, Bitstream, BlackBerry, Igalia, and others.[6] OS X, Windows, Linux, and some other Unix-like operating systems are supported by the project.[7] On April 3, 2013, Google announced that it had forked WebCore, a component of WebKit, to be used in future versions of Google Chrome and the Opera web browser, under the name Blink.[8][9]

WebKit is available under a BSD-form license[10] with the exception of the WebCore and JavaScriptCore components, which are available under the GNU Lesser General Public License. As of March 7, 2013, WebKit is a trademark of Apple, registered with the U.S. Patent and Trademark Office.[11]

Origins

The code that would become WebKit began in 1998 as the KDE's HTML layout engine KHTML and KDE's JavaScript engine (KJS). The WebKit project was started within Apple by Don Melton on June 25, 2001[12] as a fork of KHTML and KJS. Melton explained in an e-mail to KDE developers[1] that KHTML and KJS allowed easier development than other available technologies by virtue of being small (fewer than 140,000 lines of code), cleanly designed and standards-compliant. KHTML and KJS were ported to OS X with the help of an adapter library and renamed WebCore and JavaScriptCore.[1] JavaScriptCore was announced in an e-mail to a KDE mailing list in June 2002, alongside the first release of Apple's changes.[13] WebCore was announced at the Macworld Expo in January 2003 by Apple CEO Steve Jobs with the release of the Safari web browser. JavaScriptCore was first included with Mac OS X v10.2 as a private framework which Apple used within their Sherlock application, while WebCore debuted with the first beta of Safari. Mac OS X v10.3 was the first major release of Apple's operating system to bundle WebKit, although it had already been bundled with a minor release of 10.2.

According to Apple, some changes involved OS X–specific features (e.g., Objective-C, KWQ,[14] OS X calls) that are absent in KDE's KHTML, which called for different development tactics.[15]

Split development

The exchange of code between WebCore and KHTML was increasingly difficult as the code base diverged because both projects had different approaches in coding and code sharing.[16] 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".[17] Apple submitted their changes in large patches that contained a great number of changes with inadequate documentation, often to do with future additions. Thus, these patches were difficult for the KDE developers to integrate back into KHTML.[18] Furthermore, 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.[19]

During the publicized 'divorce' period, KDE developer Kurt Pfeifle (pipitas) posted an article claiming KHTML developers had managed to backport 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.[20] 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 the Acid2 rendering test.[21]

Since the story of the fork appeared in news, Apple has released changes of the source code of WebKit fork in a public revision control repository.[22] Since the transfer of the sourcecode into a public CVS repository, Apple and KHTML developers have had increasing collaboration. Many KHTML developers have become reviewers and submitters for WebKit revision control repository.

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.[23]

In July 2007, Ars Technica reported that the KDE team would move from KHTML to WebKit.[24] 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 continues.[25]

Open-sourcing

On June 7, 2005, Safari developer Dave Hyatt announced on his weblog that Apple was open-sourcing WebKit (previously, only WebCore and JavaScriptCore were open source) and opening up access to WebKit's revision control tree and the issue tracker.[22] This was announced at Apple's Worldwide Developers Conference 2005 by Apple Senior Vice President of Software Engineering Bertrand Serlet.

In mid-December 2005 support for Scalable Vector Graphics was merged into the standard build[26] and in early January 2006 the source code was migrated from CVS to Subversion (SVN).

WebKit's JavaScriptCore and WebCore components are available under the GNU Lesser General Public License, while the rest of WebKit is available under a BSD-style license.

Further development

Beginning in early 2007, the development team began to implement Cascading Style Sheets (CSS) extensions, including animation, transitions and both 2D and 3D transforms;[27] such extensions were released as working drafts to the World Wide Web Consortium (W3C) in 2009 for standardization.[28]

In November 2007, the project announced that it had accomplished support for media features of the HTML5 draft specification, allowing for embedded video to be natively rendered and script-controlled in WebKit.[29]

On June 2, 2008, the WebKit project announced they rewrote JavaScriptCore as "SquirrelFish", a bytecode interpreter.[30][31] The project evolved into SquirrelFish Extreme (abbreviated SFX), announced on September 18, 2008, which compiles JavaScript into native machine code, eliminating the need for a bytecode interpreter and thus speeding up JavaScript execution.[32] Initially the only supported architecture for SFX was the x86 architecture, but at the end of January 2009 SFX was enabled for OS X on x86-64 architectures as it passes all tests on that platform.[33]

WebKit2

A project to redesign WebKit was announced on April 8, 2010 under the name WebKit2. The goal is 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 is intended to make WebKit2's reuse a more straightforward process than WebKit's. WebKit2 has "an incompatible API change from the original WebKit", which motivated its name change.[34]

WebKit2 will target Mac, Windows, GTK+, and MeeGo-Harmattan.[35][36] Safari for OS X switched to the new API with version 5.1.[37] Safari for iOS switched to WebKit2 since iOS 8.[38]

Use

Usage share of web browsers according to StatCounter

WebKit is used as the rendering engine within Safari and was formerly used by Google's Chrome web browser on Windows, OS X, iOS and Android before version 4.4 KitKat (Chrome only used WebCore, and also incorporated its own JavaScript engine called V8 and a multi-process system).[39] Other applications on OS X make use of WebKit, such as Apple's e-mail client Mail and the 2008 version of Microsoft's Entourage personal information manager, both of which make use of WebKit to render e-mail messages with HTML content.

Installed base

New web browsers have been built around WebKit such as the S60 browser[40] on Symbian mobile phones, BlackBerry Browser (ver 6.0+), Midori, Chrome browser,[41][42] the Android Web browser before version 4.4 KitKat, and the browser used in PlayStation 3 system software from version 4.10.[43] KDE's Rekonq web browser and Plasma Workspaces also use it as the native web rendering engine. WebKit has been adopted as the rendering engine in OmniWeb, iCab and Web (previously known as Epiphany) and Sleipnir, replacing their original rendering engines. GNOME's Web supported both Gecko 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.[44] webOS uses WebKit as the basis of its application runtime.[45] The latest interface update for Valve's Steam employs WebKit to render its interface and built-in browser.[46] WebKit is used to render HTML and run JavaScript in the Adobe Integrated Runtime application platform. In Adobe 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.[47] By mid April 2015, WebKit browser market share[48] at 50.3% was larger than that of all other five major browser engines combined.

Ports

The week after Hyatt's announcement of WebKit's open-sourcing, Nokia announced that it had ported WebKit to the Symbian operating system and was developing a browser based on WebKit for mobile phones running S60. Named Web Browser for S60, it was used on Nokia, Samsung, LG, and other Symbian S60 mobile phones. Apple has also ported WebKit to iOS to run on the iPhone, iPod Touch and iPad, where it is used to render content in the device's web browser and e-mail software.[49] The Android mobile phone platform used WebKit (and later versions its Blink fork) as the basis of its web browser[50] and the Palm Pre, announced January 2009, has an interface based on WebKit.[51] The Amazon Kindle 3 includes an experimental WebKit based browser.[52]

In June 2007, Apple announced that WebKit had been ported to Microsoft Windows as part of Safari.

WebKit has also been ported to several toolkits that support multiple platforms, such as the GTK+ toolkit,[53][54] Qt framework,[55] Adobe Integrated Runtime, Enlightenment Foundation Libraries (EFL), and the Clutter toolkit.[56] Qt Software (owned by Digia) includes the Qt port in the Qt 4.4 release. The Qt port of WebKit is also available to be used in Konqueror since version 4.1.[24] The Iris Browser on Qt also uses WebKit. The Enlightenment Foundation Libraries (EFL) port is under development (by Samsung and ProFUSION[57]) 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 by Collabora and sponsored by Bosch.

There is also a project synchronized with WebKit (sponsored by Pleyo)[58] called Origyn Web Browser, which provides a meta-port to an abstract platform with the aim of making porting to embedded or lightweight systems quicker and easier.[59] This port is used for embedded devices such as set-top boxes, PMP and it has been ported into AmigaOS,[60][61] AROS[62] and MorphOS. MorphOS version 1.7 is the first version of Origyn Web Browser (OWB) supporting HTML5 media tags.[63][64]

Fork

On April 3, 2013, Google announced that it would produce a fork of WebKit's WebCore component known as Blink. Chrome's developers decided to fork WebKit in order to allow greater freedom in implementing WebCore's features in the browser without causing conflicts upstream, and would also allow the simplification of its codebase through the removal of code for WebCore components that are not used by Chrome. In relation to Opera Software's announcement earlier in the year that it would switch to WebKit by means of the Chromium codebase, it was also confirmed that the Opera web browser would also switch to Blink.[39] Following the announcement, WebKit developers began discussions on the removal of Chrome-specific code from the engine in order to streamline its overall codebase.[65] WebKit no longer has any Chrome specific code (e.g. buildsystem, V8 JavaScript engine hooks, platform code, etc.)

Components

WebCore

WebCore is a layout, rendering, and Document Object Model (DOM) library for HTML and SVG, developed by the WebKit project. Its complete source code is licensed under the GNU Lesser General Public License (LGPL). The WebKit framework wraps WebCore and JavaScriptCore, providing an Objective-C application programming interface to the C++-based WebCore rendering engine and JavaScriptCore script engine, allowing it to be easily referenced by applications based on the Cocoa API; later versions also include a cross-platform C++ platform abstraction, and various ports provide additional APIs.

WebKit passes the Acid2 and Acid3 tests, with pixel-perfect rendering and no timing or smoothness issues on reference hardware.[66]

JavaScriptCore

JavaScriptCore is a framework that provides a JavaScript engine for WebKit implementations, and provides this type of scripting in other contexts within OS X.[13][67] JavaScriptCore is originally derived from KDE's JavaScript engine (KJS) library (which is part of the KDE project) and the PCRE regular expression library. Since forking from KJS and PCRE, JavaScriptCore has been improved with many new features and greatly improved performance.[68]

On June 2, 2008, the WebKit project announced they rewrote JavaScriptCore as "SquirrelFish", a bytecode interpreter.[30][31] The project evolved into SquirrelFish Extreme (abbreviated SFX, marketed as Nitro), announced on September 18, 2008, which compiles JavaScript into native machine code, eliminating the need for a bytecode interpreter and thus speeding up JavaScript execution.[32]

An optimizing JIT compiler called "FTL" was announced on May 13, 2014.[69] It uses LLVM to generate optimized machine code. "FTL" stands for "Fourth-Tier-LLVM", and unofficially for faster-than-light, alluding to its speed.[70]

See also

References

  1. ^ a b c d "'(fwd) Greetings from the Safari team at Apple Computer' — MARC". Lists.kde.org. January 7, 2003. Retrieved January 13, 2013.
  2. ^ "Safari is released to the world". Donmelton.com. Retrieved January 13, 2013.
  3. ^ "WebKit Nightly Builds". webkit.org. Retrieved May 27, 2014.
  4. ^ "WebKit". Trac.webkit.org. Retrieved December 27, 2010.
  5. ^ "The WebKit Open Source Project". Retrieved April 7, 2012.
  6. ^ Stachowiak, Maciej (November 9, 2008). "Companies and Organizations that have contributed to WebKit". WebKit Wiki. Retrieved November 17, 2008.
  7. ^ "The WebKit Open Source Project — Getting the Code". Webkit.org. Retrieved December 27, 2010.
  8. ^ Barth, Adam (April 3, 2013). "Chromium Blog: Blink: A rendering engine for the Chromium project". Blog.chromium.org. Retrieved June 14, 2013.
  9. ^ Lawson, Bruce. "Bruce Lawson's personal site : Hello Blink". Brucelawson.co.uk. Retrieved June 14, 2013.
  10. ^ "Open Source – WebKit". Apple. Retrieved March 5, 2009.
  11. ^ "Apple's "WebKit" is now a Registered Trademark in the US". Retrieved March 7, 2013.
  12. ^ Melton, Don (August 25, 2011). "Attention Internets! WebKit is not 10 years old today. That happened on June 25. I know the date because that's when I started the project". Twitter. Retrieved October 13, 2011.
  13. ^ a b Stachowiak, Maciej (June 13, 2002). "JavaScriptCore, Apple's JavaScript framework based on KJS". kde-darwin (Mailing list). Archived from the original on March 10, 2007. Retrieved August 21, 2008. {{cite mailing list}}: Unknown parameter |mailinglist= ignored (|mailing-list= suggested) (help)
  14. ^ KWQ (pronounced "quack") is an implementation of the subset of Qt required to make KHTML work on OS X. It is written in Objective C++.
  15. ^ "Safari and KHTML again". kdedevelopers.org. April 30, 2005. Retrieved February 20, 2010.
  16. ^ "So, when will KHTML merge all the WebCore changes?". kdedevelopers.org. Retrieved February 20, 2010.
  17. ^ "The bitter failure named 'safari and khtml'".
  18. ^ "Open-source divorce for Apple's Safari?".
  19. ^ http://lists.apple.com/archives/Webcore-dev/2005/Jun/msg00009.html. Retrieved June 3, 2015. {{cite web}}: Missing or empty |title= (help)
  20. ^ "WebCore – KHTML – Firefox: Know your facts!". Archived from the original on February 10, 2009.
  21. ^ "Konqueror now passes Acid2".
  22. ^ a b Molkentin, Daniel (June 7, 2005). "Apple Opens WebKit CVS and Bug Database". KDE News. Retrieved January 16, 2007.
  23. ^ "Ars at WWDC: Interview with Lars Knoll, creator of KHTML".
  24. ^ a b Unrau, Troy (July 23, 2007). "The unforking of KDE's KHTML and WebKit". Ars Technica. Retrieved July 30, 2007.
  25. ^ "KDE Development Platform 4.5.0 gains performance, stability, new high-speed cache and support for WebKit".
  26. ^ "Next Generation KDE Technologies Ported to WebCore".
  27. ^ "CSS Transforms".
  28. ^ "CSS3 Animations".
  29. ^ Koivisto, Antti (November 12, 2007). "HTML5 Media Support". Surfin' Safari blog.
  30. ^ a b "Announcing SquirrelFish".
  31. ^ a b "SquirrelFish project".
  32. ^ a b "Introducing SquirrelFish Extreme".
  33. ^ "Changeset 40439 – WebKit". Trac.webkit.org. January 30, 2009. Retrieved December 27, 2010.
  34. ^ "WebKit2 wiki". Webkit.org. Retrieved August 3, 2012.
  35. ^ "Announcing WebKit2". Webkit.org. Retrieved December 27, 2010.
  36. ^ "Introducing the Nokia N9: all it takes is a swipe! |Nokia Conversations – The official Nokia Blog". Nokia Corporation. Retrieved June 21, 2011.
  37. ^ "Source code repository for public parts of Safari 5.1". The WebKit Open Source Project. Retrieved July 20, 2011.
  38. ^ "WWDC 2014 Session 206 - Introducing the Modern WebKit API - ASCIIwwdc".
  39. ^ "Nokia S60 Webkit Browser".
  40. ^ "Google Chrome, Google's Browser Project".
  41. ^ "Comic describing the Google Chrome Project".
  42. ^ "PS3、ファームウェアv4.10からWebKitへ。 - あまたの何かしら。". D.hatena.ne.jp. February 8, 2012. Retrieved January 13, 2013.
  43. ^ "Epiphany Mailing list – Announcement: The Future of Epiphany".
  44. ^ Chen, Brian X. "HP Launches WebOS-Powered Tablet, Phones | Gadget Lab". Wired.com. Retrieved January 13, 2013.
  45. ^ "A Brand New Steam".
  46. ^ "100 Million Club (H1 2010 update)". 100 Million Club (H1 2010 update). VisionMobile. Retrieved March 1, 2011.
  47. ^ "StatCounter". StatCounter. Retrieved April 14, 2015.
  48. ^ Stachowiak, Maciej (January 10, 2007). "The Obligatory iPhone Post". Surfin' Safari weblog. Retrieved January 24, 2008.
  49. ^ "Android Uses WebKit".
  50. ^ "Palm Pre in-depth impressions, video, and huge hands-on gallery".
  51. ^ Topolsky, Joshua. "New Amazon Kindle announced: $139 WiFi-only version and $189 3G model available August 27th in the US and UK".
  52. ^ "WebKitGTK+ project website".
  53. ^ "Alp Toker – WebKit/Gtk+ is coming".
  54. ^ "QT WebKit". Archived from the original on August 3, 2009. {{cite web}}: Unknown parameter |deadurl= ignored (|url-status= suggested) (help)
  55. ^ "WebKitClutter project website".
  56. ^ "ProFUSION | Home". Profusion.mobi. Retrieved January 13, 2013.
  57. ^ "pleyo".
  58. ^ "See OWB forge".
  59. ^ "AmigaOS OWB official page".
  60. ^ "Amiga – Powering through, dead or alive!". amigaweb.net. Retrieved June 2, 2010.
  61. ^ "AROS OWB developer page".
  62. ^ "Origyn Web Browser for MorphOS". Fabian Coeurjoly. Retrieved January 4, 2010.
  63. ^ Holwerda, Thom (March 8, 2010). "Origyn Web Browser 1.7 Supports HTML5 Media, More". OSNews. Retrieved March 8, 2010.
  64. ^ "WebKit developers planning Chromium extraction". The H. Retrieved April 9, 2013.
  65. ^ Stachowiak, Maciej (September 25, 2008). "Full Pass Of Acid3". Surfin' Safari – The WebKit Blog. Retrieved September 29, 2008.
  66. ^ "The WebKit Open Source Project – JavaScript".
  67. ^ "The Great Browser JavaScript Showdown". December 19, 2007.
  68. ^ "Introducing the WebKit FTL JIT".
  69. ^ "Apple integrates LLVM compiler to boost WebKit JavaScript performance".