KHTML is the HTML layout engine developed by the KDE project. It is the engine used by the Konqueror web browser. A forked version of KHTML called WebKit is used by several web browsers, among them Safari and Google Chrome. Distributed under the terms of the GNU Lesser General Public License, KHTML is free software.
Built on the KPart framework and written in C++, KHTML has relatively good support for Web standards. To render as many pages as possible, some extra abilities and quirks from Internet Explorer are also supported, even though those are non-standard.
KHTML renders faster than the Gecko layout engine,[1] its main open source rival and core of the Mozilla and Mozilla Firefox browsers, among others. However, being a less widely known browser, many websites fail to support KHTML or claim no support even if the site does work correctly in Konqueror. Gmail, for instance, only works if Konqueror reports itself as Firefox (see User Agent Spoofing).
History
KHTML was preceded by an earlier engine called khtmlw or the KDE HTML Widget, developed by Torben Weiss and Martin Jones,[2] which implemented support for HTML 3.2, HTTP 1.0, and HTML frames, but not the W3C DOM, CSS, or scripting.
KHTML came into existence in November 4, 1998,[3] as a copy of the khtmlw library, with some slight refactoring and the addition of Unicode support and changes to support the move to Qt 2. Waldo Bastian[4] was among those who did the work of creating that early version of KHTML.[5]
The real work on KHTML actually started between May and October 1999, with the realization that the choice facing the project was "either do a significant effort to move KHTML forward or to use Mozilla"[6] and with adding support for scripting as the highest priority. So in May 1999, Lars Knoll[7] began doing research with an eye toward implementing the W3C DOM specification, finally announcing[8] on August 16, 1999 that he had checked in[9] what amounted to a complete rewrite of the KHTML library — changing KHTML to use the standard W3C DOM as its internal document representation. That in turn allowed the beginnings of Javascript support to be added in October 1999,[10] with the integration of Harri Porten's KJS following shortly afterward.
In the closing months of 1999 and first few months of 2000, Knoll did further work[11] with Antti Koivisto[12] and Dirk Mueller[13] to add CSS support and to refine and stabilize the KHTML architecture,[14] with most of that work being completed by March 2000. Among other things, those changes enabled KHTML to become the first browser other than Internet Explorer to correctly support languages written right-to-left (for example, Hebrew and Arabic)[15] — before Mozilla had such support.
KDE 2.0 was the first KDE release (on October 23, 2000) to include KHTML[16] (as the rendering engine of the new Konqueror file and web browser, which replaced the monolithic KDE File Manager).
KWQ
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++.
Standards compliance
The following standards are supported by the KHTML engine:
KHTML and Apple
KHTML and KJS were adopted by Apple in 2002 for use in the Safari web browser. Apple publishes the source code for their fork of the KHTML engine, called WebKit, as required by the LGPL.
However, the exchange of code patches between the two branches of KHTML has previously been difficult and the code base diverged because both projects had different approaches in coding.[18] One of the reasons for this is that Apple worked on their version of KHTML for a year before making their fork public.
Despite this, 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.citation needed
According to Apple, some changes involved Mac OS X-specific features (e.g. Objective-C, KWQ, OS X calls), which are absent in KDE's KHTML, which called for different development tactics.[19]
Controversy
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".[20] This was said to be largely due to Apple submitting their changes in large patches that contained a great number of changes and inadequately documented code, often to do with future feature additions. Thus, these patches were difficult for the KDE developers to integrate back into KHTML. Furthermore, Apple had demanded developers to sign nondisclosure agreements before looking at Apple's source code and even then they were unable to access Apple's bug database.[21]
During the publicized 'divorce' period, KDE developer 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.[22]
Since the story of the fork appeared in news, Apple has released changes of the source code of its KHTML fork in a CVS repository.[23] 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 Apple's WebKit SVN repository.
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.[24]
See also
References
External links
|