Behind the Browser !

Hi All ! we all use browsers, different kinds of browsers, to surf the internet. But do we know what makes a browser work ? How do a browser come to know that when to show which color or when to show which kind of style of text ? We can say we give instructions by using HTML or DHTML or JAVASCRIPT/VBSCRIPT kinds of language. But how do a browser come to know which instruction relates to which language and how to handle it ? There should be something in the browser which drives it and make it work according to our instructions.

Yes, This is my topic. Behind the BROWSER, something called WEB LAYOUT ENGINE, a mechanism used to make the browser work. The use of WEB LAYOUT ENGINE is not limited to browsers only. These are used in various email clients like OUTLOOK EXPRESS, thunderbird etc. Sometimes these are part of the operating system.Let's start with formal definition of WEB LAYOUT ENGINE(sometimes called RENDERING ENGINE):

A layout engine, or rendering engine, is software that takes marked up content (such as HTML, XML, image files, etc.) and formatting information (such as CSS, XSL, etc.) 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. A layout engine is typically used for web browsers, e-mail clients, or other applications that require the displaying (and editing) of web contents.

The term rendering engine can also refer to text rendering engines like Pango or Uniscribe which make multilingual texts present in proper shape, taking into account bidirectional text, combinations of "basic characters" with accents, and other intricacies of multilingual text.

For example, Gecko, the Mozilla project's open-source layout engine, is used by a variety of products derived from the Mozilla code base, including the Firefox web browser, the Thunderbird E-mail client, and Seamonkey application suite. Trident, the layout engine from Internet Explorer, is used by many applications on the Microsoft Windows platform to render HTML, as in Outlook Express, some versions of Microsoft Outlook, and the mini-browsers in Winamp and RealPlayer. Similarly, Opera Software's proprietary Presto engine is licensed to a number of other software vendors, as well as being used in Opera's own Opera web browser, and KDE's open-source KHTML engine is used both in KDE's own Konqueror web browser as well as being used, in an adapted form, as the basis for the rendering engine in Apple's Safari web browser.

Trident (also known as MSHTML) is the name of the layout engine for the Microsoft Windows version of Internet Explorer. It was first introduced with the release of Internet Explorer version 4 in October 1997, has been steadily upgraded and remains in use today.

Trident was designed as a software component to allow software developers to easily add web browsing functionality to their own applications. It presents a COM interface for accessing and editing web pages in any COM supported environment, like C++ and .NET. For instance, a web browser control can be added to a C++ program and Trident can then be used to access the page currently displayed in the web browser and retrieve element values. Events from the web browser control can also be captured. Trident functionality becomes available by connecting the file mshtml.dll to the software project.

All versions of Internet Explorer for Windows from 4.0 onwards use Trident, and it is also used by various other web browsers and software components (see Internet Explorer shells). In Windows 98, Windows Me, and Windows 2000, it is also used for the Windows file manager/shell, Windows Explorer. The Add/Remove Programs tool in Windows 2000 and Windows XP uses Trident to render the list of installed programs and in Windows XP, it is also used for the User Accounts Control Panel, which is an HTML Application. However Trident was not used by the IE5 version for Mac, or by Internet Explorer Mobile.

Presto is a layout engine for the Opera web browser developed by Opera Software. After several public betas and technical previews, it was released on January 28, 2003 in Opera 7.0 for Windows; it is the browser's current layout engine. Presto replaced the Elektra engine used in versions 46 of Opera. Unlike Elektra, it is dynamic: the page or parts of it can be re-rendered in response to DOM and script events. Presto is only available as a part of Opera browser or related products. The source or binary (DLL) forms of the engine are not publicly available. Subsequent releases have seen a number of bugs fixed and optimisations to improve the speed of the ECMAScript ("JavaScript") engine.

JavaScript engines
Two JavaScript engines are used in combination with Presto. The "linear_b" engine is used in Opera 7.0 through 9.25. The "futhark" engine is used in Opera 9.5 and will be used in Opera 10.

WebKit is an open source application framework that provides a foundation upon which to build a web browser. WebKit was originally derived by Apple Inc. from the Konqueror browsers KHTML software library for use as the engine of Mac OS Xs Safari web browser, and has now been further developed by Apple, Nokia, Google and others. The framework is now used by Omniweb, Shiira, iCab, Adobe AIR, Google Chrome, mobile phones (including the iPhone), Nokias Series 60 browser and Googles Android platform. Although WebKit is included with Trolltechs Qt 4.4, the underlying framework for KDE,the KDE project will use its original version of KHTML for the near future.

It passes the Acid2 test, and as of March 2008, latest nightly builds of WebKit score 100/100 in the Acid3 test with pixel-perfect rendering and no timing or smoothness issues.

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 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 easily be referenced by applications based on the Cocoa API; later versions also include a cross-platform C++ platform abstraction, and various ports provide additional APIs.

 JavaScriptCore
JavaScriptCore is a framework that provides a JavaScript engine for WebKit implementations, and provides this type of scripting in other contexts within Mac OS X.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.JavaScriptCore is currently being rewritten by the WebKit project as SquirrelFish to turn it into a bytecode interpreter.

 Drosera
Drosera is a JavaScript debugger that was included with the nightly builds of WebKit. It was named after Drosera, a genus of carnivorous plants (i.e. bug-eaters). Drosera has been replaced by the inclusion of debugging functionality in the Web Inspector.[17]

 SunSpider
A benchmark suite that aims to measure JavaScript performance on tasks that are relevant to the current and near future use of JavaScript in the real world, such as screen drawing, encryption and text manipulation.The suite further attempts to be balanced and statistically sound. It was released by Apple's WebKit team in December 2007. It was well-received, and other browser developers also use it to compare the JavaScript performance of different browsers.

Gecko is the open source browser engine designed to support open Internet standards such as HTML 4, CSS 1/2, the W3C DOM, XML, JavaScript, and others.

Gecko is used in multiple browsers, including Mozilla Firefox, SeaMonkey, Camino, and others. Gecko is continuously under development at mozilla.org. Gecko has been known previously by the code names "Raptor" and "NGLayout"; the new name was chosen following a trademark infringement dispute.

Formally, a layout engine defines the placement policy for a document and places content on a page. Gecko's core is a very fast layout engine. Gecko also offers the ability to parse various document types (HTML, XML, SVG, etc), advanced rendering capabilities including compositing and transformations, and support for embedded JavaScript and plugins.

Gecko is so fast and so powerful that it's being used to create the user interface of some applications ("chrome") as well. In other words, Gecko will not only be displaying the document's content, but it will also be painting the scrollbars, toolbars, and menus on the screen as well.

Gecko is written in C++ and is cross-platform, running on operating systems including Microsoft Windows, BSDs, Linux, Mac OS X, Solaris, OS/2, AIX and OpenVMS. Its development is now overseen by the Mozilla Foundation. Licensed a tri-license of the Mozilla Public License (MPL), GNU General Public License (GPL) and GNU Lesser General Public License (LGPL), Gecko is free and open source software.

Gecko is the second most-popular layout engine on the World Wide Web, after Trident (used by Internet Explorer for Windows since version 4), and followed by WebKit (used by Safari & Google Chrome) and Presto (used by Opera).

Hi all ! I have presented a few details 4 major web layout engines only. References have been taken from most of the times from WIKIPEDIA, MOZILLA FOUNDATION, WEBKIT.ORG, OPERA and few other sites also.
If you are interested to update the topic or you want to share knowledge about other web layout engines which I have missed out, you are most welcomed.