
Inside look: KHTML vs. Gecko vs. Trident vs. Presto
- Transfer

When netizens click on the icon to launch their favorite browser, only the most advanced of them understand which engine it is running on. For the average user, there is no difference between browsers and how they display web pages.
In any case, users are much more concerned about how secure their browser is. Perhaps they are worried if the older versions of Apple’s browser were more secure because they used KHTML? Or maybe Firefox from the Mozilla Foundation is much safer and more usable because it uses Gecko? Is Microsoft's Internet Explorer 7 (IE7) the best browser to date because it uses the Trident engine? Why are there so many possible alternatives?
“Why aren't we using the only browser engine? This helps to slow down innovative development and prevent errors that cannot be found in all browsers at the same time. In any case, several implementations of the same are better than one, ”commented Gene Spafford, a professor of computer science at Purdue University, specifically for LinuxInsider .
What kind of animals?
The three main browser engines to date are Trident, Gecko, and Presto. IE7 is based on the Trident engine.
Mozilla uses Gecko in Firefox and the Thunderbird mail client, followed by several other open source browsers. Opera Software uses Presto as an engine to display pages in its browser. Nokia also uses it in its Internet Tablet product line. Also, some Nintendo products are based on Presto.
Apple finally abandoned the development of the KHTML model. She partially used the KHTML code to create her own HTML WebKit engine.
“KHTML no longer exists for the modern Web,” says Guy Lunardi, product manager at Novell, specifically for LinuxInsider.
What are the differences?
Both the Apple Safari browser and the Apple iPhone use WebKit. However, according to Lunardi, WebKit's popularity is not limited to this.
WebKit is currently also used in Adobe AIR (Adobe Integrated Runtime) and Nokia smartphones.
However, you should not think, as the creator of KHTML, Lars Knoll, now working as a developer of software for Trolltech, says that his legendary engine will be a thing of the past. KHTML source code is much smaller and easier to work than Gecko, according to Knoll.
“If we look at the latest innovations in KHTML, I believe that the main advance should be considered its convergence with the development of WebKit,” he told LinuxInsider in an interview from his office in Oslo, Norway.
At the beginning
KHTML began as part of KDE 2.0, a graphical desktop environment on some Linux-based operating systems. KHTML forms the basis of the Linux web browser, Konqueror, and the KDE built-in browser and file manager based on KHTML.
Its heyday fell on the decline of the popularity of the Netscape browser. But his position was staggered with the return of the Gecko engine, in the heavy agony of the Mozilla Foundation community, separated from the source code of the Netscape browser.
“From the very beginning, Gecko’s goal was to create a complete platform for developers, while KHTML always remained the only engine for rendering HTML,” says Knoll. “The main idea that was built into KHTML is to create a standards-compliant HTML engine that will support all the most modern (at that time) web pages using CSS (cascading style sheets) and JS (JavaScript).”
The Mozilla / Gecko commercial project was supported first by Netscape and then by AOL. The Mozilla Foundation later fostered a large number of hired developers for the Gecko engine, he adds.
“KHTML has always been an entirely voluntary project, until Apple joined it. None of the people who worked on KHTML until 2003 received money for the work they did, ”Knoll explains.
The paths diverged
The goals of both web page rendering projects were the same. When there were many differences between them, both created a standards-compliant HTML engine that could handle all the pages on the Internet. Today, both of them provide the same functionality to one degree or another: HTML 4.1, XHTML, CSS 2.1, JavaScript and web applications using AJAX, Knoll says.
One of the main tasks that Knoll set himself at the very beginning, according to him, was an attempt to create a flexible and maximally simple architecture for the HTML rendering engine. This made it easy for other participants to join in and contribute to the project.
“Perhaps this was the main reason for Apple to choose between KHTML and Gecko for their Safari browser,” Knoll suggests.
Novell's Lunardi agrees that performance among browsers is not the most critical factor. All browser engines have a lot of standards and specifications, including HTML, CSS, the XML Document Object Model ( DOM ), RDF ( resource description framework ), JavaScript, and much more.
Same differences
Different engines exist because they were developed by different groups of people for different specific needs. In reality, they all achieve, in general, the same global goals.
“For example, they will parse the same code in different ways. In various ways they will seek compliance with the specifications. And in handling errors and incorrect page content, they will vary, ”says Lunardi.
Knoll supported the KHTML project until 2003, when it transferred control over it and moved on to specific tasks. Essentially, he made a full circle as a software developer and returned to where he started. Last fall, he started working on WebKit, trying to include this engine in KDE 4.
No best
It will be extremely difficult for users to choose between browsers based solely on their internal engine. None of the engines, when installed in conjunction with others, does not lead to any conflicts between the user or the headache of program developers, Knoll emphasizes.
The choice of a particular engine depends very much on the current conditions for browser developers. For example, KHTML is best suited for integrated devices because of less memory footprint. Gecko has more market share, Knoll explains.
Web developers have their own nuances, but they are quite trivial, says Knoll. The biggest problem for developers may be the differences between standards compliant browsers (Gecko, KHTML and WebKit ( note and Opera )), and IE.
“In the end, it's a matter of taste, which browser to use. For Linux, there are three possible options: Firefox (or another browser based on the Gecko engine), Konqueror or Opera. As a user, you can choose what you like best, ”concludes Knoll.
Why not the only one?
Why is there no single standard engine for all browsers? Knoll sees two reasons for this, why the existence of a single web page rendering engine would adversely affect end-users.
If there was only one implementation of the display engine, there would be no guarantee that it corresponds to the documentation. It will also not guarantee that the standards will be implemented in any way, he says.
The existence of several engines is good from the point of view of market competition: if there is a monopoly on the market, then there is no incentive to develop further, he agrees with the point of view of Spafford.
“The result of this we see now among browsers that are trying to be as fast as possible or as compliant with the standards,” he says.
Thanks to everyone who found the strength to familiarize themselves with this translation. It will be great if you share your thoughts in the comments.
Web Optimizator: checking the speed of loading sites