Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
KHTML

KHTML

Overview
KHTML is the HTML
HTML
HTML, which stands for Hyper Text Markup Language, is the predominant markup language for web pages. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists etc as well as for links, quotes, and other items. It allows images...

 layout engine
Layout engine
A layout engine, or rendering engine, is software that takes marked up content and formatting information and displays the formatted content on the screen. It "paints" on the content area of a window, which is displayed on a monitor or a printer...

 developed by the KDE
KDE
KDE is a free software project based around its flagship product, a desktop environment mainly for Unix-like systems. The goal of the project is to provide basic desktop functions and applications for daily needs as well as tools and documentation for developers to write stand-alone applications...

 project. It is the engine used by the Konqueror
Konqueror
Konqueror is a web browser, file manager, etc. that provides file-viewer functionality to a wide variety of things: local files, files on a remote ftp server, files in a disk image, etc. It is designed as a core part of the K Desktop Environment. It is developed by volunteers and can run on most...

 web browser. A forked version of KHTML called WebKit
WebKit
WebKit is a layout engine designed to allow web browsers to render web pages. The WebKit engine 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...

 is used by several web browsers, among them Safari
Safari (web browser)
Safari is a web browser developed by Apple Inc. First released as a public beta on 7 January 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3 "Panther". Apple has also made Safari the native browser for the iPhone OS...

 and Google Chrome
Google Chrome
Google Chrome is a web browser released by Google which uses the WebKit layout engine and application framework. It was first released as a beta version for Microsoft Windows on September 2 2008, and the public stable release was on December 11 2008. The name is derived from the graphical user...

. Distributed under the terms of the GNU Lesser General Public License
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT License...

, KHTML is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also...

.

Built on the KPart
KPart
In computer programming, KParts is the name of the component framework for the KDE desktop environment. An individual component is called a KPart. KParts are analogous to Bonobo components in GNOME and ActiveX controls in Microsoft's Component Object Model...

 framework and written in C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features...

, KHTML has relatively good support for Web standards. To render as many pages as possible, some extra abilities and quirks from Internet Explorer
Internet Explorer
Windows Internet Explorer , is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995...

 are also supported, even though those are non-standard.

KHTML was preceded by an earlier engine called khtmlw or the KDE HTML Widget, developed by Torben Weis and Martin Jones, which implemented support for HTML
HTML
HTML, which stands for Hyper Text Markup Language, is the predominant markup language for web pages. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists etc as well as for links, quotes, and other items. It allows images...

 3.2, HTTP 1.0, and HTML frames
Framing (World Wide Web)
On a web page, framing means that a website can be organized into frames. Each frame displays a different HTML document. Headers and sidebar menus do not move when the content frame is scrolled up and down. For developers frames can also be convenient...

, but not the W3C DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

, CSS
Cascading Style Sheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

, or scripting
DOM scripting
The term DOM scripting refers to programmatically accessing the Document Object Model . In common usage, DOM scripting implies JavaScript. DOM scripting has its roots in Dynamic HTML , but is more structured...

.

KHTML came into existence in November 4, 1998, 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
Qt (toolkit)
Qt is a cross-platform application development framework, widely used for the development of GUI programs , and also used for developing non-GUI programs such as console tools and servers. Qt is most notably used in KDE, Google Earth, Skype, Qt Extended, Adobe Photoshop Album, VirtualBox and OPIE...

 2.
Discussion
Ask a question about 'KHTML'
Start a new discussion about 'KHTML'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
KHTML is the HTML
HTML
HTML, which stands for Hyper Text Markup Language, is the predominant markup language for web pages. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists etc as well as for links, quotes, and other items. It allows images...

 layout engine
Layout engine
A layout engine, or rendering engine, is software that takes marked up content and formatting information and displays the formatted content on the screen. It "paints" on the content area of a window, which is displayed on a monitor or a printer...

 developed by the KDE
KDE
KDE is a free software project based around its flagship product, a desktop environment mainly for Unix-like systems. The goal of the project is to provide basic desktop functions and applications for daily needs as well as tools and documentation for developers to write stand-alone applications...

 project. It is the engine used by the Konqueror
Konqueror
Konqueror is a web browser, file manager, etc. that provides file-viewer functionality to a wide variety of things: local files, files on a remote ftp server, files in a disk image, etc. It is designed as a core part of the K Desktop Environment. It is developed by volunteers and can run on most...

 web browser. A forked version of KHTML called WebKit
WebKit
WebKit is a layout engine designed to allow web browsers to render web pages. The WebKit engine 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...

 is used by several web browsers, among them Safari
Safari (web browser)
Safari is a web browser developed by Apple Inc. First released as a public beta on 7 January 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3 "Panther". Apple has also made Safari the native browser for the iPhone OS...

 and Google Chrome
Google Chrome
Google Chrome is a web browser released by Google which uses the WebKit layout engine and application framework. It was first released as a beta version for Microsoft Windows on September 2 2008, and the public stable release was on December 11 2008. The name is derived from the graphical user...

. Distributed under the terms of the GNU Lesser General Public License
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT License...

, KHTML is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also...

.

Built on the KPart
KPart
In computer programming, KParts is the name of the component framework for the KDE desktop environment. An individual component is called a KPart. KParts are analogous to Bonobo components in GNOME and ActiveX controls in Microsoft's Component Object Model...

 framework and written in C++
C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level and low-level language features...

, KHTML has relatively good support for Web standards. To render as many pages as possible, some extra abilities and quirks from Internet Explorer
Internet Explorer
Windows Internet Explorer , is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995...

 are also supported, even though those are non-standard.

Origins


KHTML was preceded by an earlier engine called khtmlw or the KDE HTML Widget, developed by Torben Weis and Martin Jones, which implemented support for HTML
HTML
HTML, which stands for Hyper Text Markup Language, is the predominant markup language for web pages. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists etc as well as for links, quotes, and other items. It allows images...

 3.2, HTTP 1.0, and HTML frames
Framing (World Wide Web)
On a web page, framing means that a website can be organized into frames. Each frame displays a different HTML document. Headers and sidebar menus do not move when the content frame is scrolled up and down. For developers frames can also be convenient...

, but not the W3C DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

, CSS
Cascading Style Sheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

, or scripting
DOM scripting
The term DOM scripting refers to programmatically accessing the Document Object Model . In common usage, DOM scripting implies JavaScript. DOM scripting has its roots in Dynamic HTML , but is more structured...

.

KHTML came into existence in November 4, 1998, 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
Qt (toolkit)
Qt is a cross-platform application development framework, widely used for the development of GUI programs , and also used for developing non-GUI programs such as console tools and servers. Qt is most notably used in KDE, Google Earth, Skype, Qt Extended, Adobe Photoshop Album, VirtualBox and OPIE...

 2. Waldo Bastian was among those who did the work of creating that early version of KHTML.

Re-write and improvement


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
Mozilla
Mozilla is a term used in a number of ways in relation to the now-defunct Netscape Communications Corporation and its related application software, including the Mozilla.org group and its successor the Mozilla Foundation....

" and with adding support for scripting
DOM scripting
The term DOM scripting refers to programmatically accessing the Document Object Model . In common usage, DOM scripting implies JavaScript. DOM scripting has its roots in Dynamic HTML , but is more structured...

 as the highest priority. So in May 1999, Lars Knoll began doing research with an eye toward implementing the W3C DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

 specification, finally announcing on August 16, 1999 that he had checked in what amounted to a complete rewrite of the KHTML library — changing KHTML to use the standard W3C DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

 as its internal document representation. That in turn allowed the beginnings of Javascript
JavaScript
JavaScript is an object-oriented scripting language used to enable programmatic access to objects within both the client application and other applications. It is primarily used in the form of client-side JavaScript, implemented as an integrated component of the web browser, allowing the...

 support to be added in October 1999, with the integration of Harri Porten
Harri Porten
Harri Porten is a software engineer. Porten, a KDE developer and former Trolltech employee, is the CEO of Froglogic, a consultancy company related to Qt development. He currently lives in Hamburg, Germany. Porten originally wrote the KJS JavaScript engine for Konqueror, the KDE project's file...

's KJS following shortly afterward.

In the closing months of 1999 and first few months of 2000, Knoll did further work with Antti Koivisto and Dirk Mueller to add CSS
Cascading Style Sheets
Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

 support and to refine and stabilize the KHTML architecture, with most of that work being completed by March 2000. Among other things, those changes enabled KHTML to become the second browser after Internet Explorer
Internet Explorer
Windows Internet Explorer , is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995...

 to correctly support Hebrew and Arabic and languages written right-to-left
Bi-directional text
Bi-directional text is text containing text in both text directionalities, both right-to-left and left-to-right . It generally involves text containing different types of alphabets, but may also refer to boustrophedon, which is changing text directionality in each row.Some writing systems of the...

 — before Mozilla
Mozilla
Mozilla is a term used in a number of ways in relation to the now-defunct Netscape Communications Corporation and its related application software, including the Mozilla.org group and its successor the Mozilla Foundation....

 had such support.

KDE 2.0 was the first KDE release (on October 23, 2000) to include KHTML (as the rendering engine of the new Konqueror
Konqueror
Konqueror is a web browser, file manager, etc. that provides file-viewer functionality to a wide variety of things: local files, files on a remote ftp server, files in a disk image, etc. It is designed as a core part of the K Desktop Environment. It is developed by volunteers and can run on most...

 file
File manager
A file manager or file browser is a computer program that provides a user interface to work with file systems. The most common operations used are create, open, edit, view, print, play, rename, move, copy, delete, attributes, properties, search/find, and permissions. Files are typically displayed...

 and web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

, which replaced the monolithic KDE File Manager).

Other modules


KSVG
KSVG
KSVG is a SVG solution for KHTML based browsers.It is integrated in KDE and the Konqueror browser as a KPart. KSVG2 is developed on top of KDOM2 and was first released with KDE4.KSVG2 is also an experimental part of WebKit. It mostly supports SVG 1.1....

 was first developed in 2001 by Nikolas Zimmermann and Rob Buis; however, by 2003, it was decided to fork the then-current KSVG implementation into two new projects: KDOM
KDOM
KDOM is a KPart module for DOM rendering in KHTML-based browsers. KSVG2 is built on top of KDOM, and will be released in KDE 4.Along with KSVG, KDOM is an experimental component in Apple Inc.'s WebKit framework.-External links:* for KDOM* from Slashdot...

/KSVG2 (to improve the state of DOM rendering in KHTML underneath a more formidable SVG 1.0 render state) and Kcanvas (to abstract any rendering done within khtml/ksvg2 in a single shared library, with multiple backends for ie. Cairo/Qt etc.).

Standards compliance


The following standards are supported by the KHTML engine:
  • HTML
    HTML
    HTML, which stands for Hyper Text Markup Language, is the predominant markup language for web pages. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists etc as well as for links, quotes, and other items. It allows images...

     4.01
  • Partial HTML
    HTML
    HTML, which stands for Hyper Text Markup Language, is the predominant markup language for web pages. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists etc as well as for links, quotes, and other items. It allows images...

     5 support (standard still in progress)
  • CSS
    Cascading Style Sheets
    Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

     1
  • CSS
    Cascading Style Sheets
    Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

     2.1 (screen and paged media)
  • CSS
    Cascading Style Sheets
    Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

     3 Selectors (fully as of KDE 3.5.6)
  • CSS
    Cascading Style Sheets
    Cascading Style Sheets is a style sheet language used to describe the presentation semantics of a document written in a markup language...

     3 Other (multiple backgrounds, box-sizing and text-shadow)
  • PNG, MNG, JPEG
    JPEG
    In computing, JPEG is a commonly used method of compression for photographic images. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and image quality...

    , GIF graphic formats
  • DOM
    Document Object Model
    The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...

     1, 2 and partially 3
  • ECMA-262/JavaScript 1.5
    JavaScript
    JavaScript is an object-oriented scripting language used to enable programmatic access to objects within both the client application and other applications. It is primarily used in the form of client-side JavaScript, implemented as an integrated component of the web browser, allowing the...

  • Partial Scalable Vector Graphics
    Scalable Vector Graphics
    Scalable Vector Graphics is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both static and dynamic Scalable Vector Graphics (SVG) is a family of specifications of an XML-based file format for describing two-dimensional vector graphics, both...

     support

KHTML and Apple



KHTML and KJS were adopted by Apple
Apple Computer
Apple Inc. is an American multinational corporation that designs and manufactures consumer electronics and computer software products. The company's best-known hardware products include Macintosh computers, the iPod and the iPhone...

 in 2002 for use in the Safari
Safari (web browser)
Safari is a web browser developed by Apple Inc. First released as a public beta on 7 January 2003 on the company's Mac OS X operating system, it became Apple's default browser beginning with Mac OS X v10.3 "Panther". Apple has also made Safari the native browser for the iPhone OS...

 web browser. Apple publishes the source code for their fork of the KHTML engine, called WebKit
WebKit
WebKit is a layout engine designed to allow web browsers to render web pages. The WebKit engine 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...

.

See also



  • List of KHTML and WebKit-based browsers
  • List of layout engines
  • Comparison of layout engines
    Comparison of layout engines
    The following tables compare general and technical information for a number of layout engines. Please see the individual products' articles for further information. This article is not all-inclusive or necessarily up-to-date...


External links