📜 ⬆️ ⬇️

An inside look: KHTML vs. Gecko vs. Trident vs. Presto

Note: below is the translation of the article “KHTML vs. Gecko vs. Trident vs. Presto: Behind the Browser ” , which examines the main browser engines, the history of their emergence and development, as well as some philosophical issues related to them. These are mainly KHTML, WebKit and Gecko.

When network users click on the icon to launch their favorite browser, only the most advanced of them understand which engine it works on. For a regular user, there is no difference between browsers and how they display web pages.

In any case, users are much more worried about how much their browser is safer. Perhaps they’re worried if the old versions of Apple’s browser were safer because they used KHTML? Or maybe the security and usability is much better with Firefox from the Mozilla Foundation, because it uses Gecko? Is Microsoft Internet Explorer 7 (IE7) the best browser today 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 the innovative development and prevent the appearance of errors that are not found in all browsers at the same time. In any case, several implementations of the same are better than one, ”comments Gene Spafford, a computer science professor at Purdue University, specifically for LinuxInsider .


What kind of animals?



The three main browser engines today are Trident, Gecko and Presto. IE7 is based on the Trident engine.

Mozilla uses Gecko in Firefox and in the Thunderbird mail client, some other open source browsers follow suit. Opera Software uses Presto as an engine for displaying pages in its browser. It is also used by Nokia 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 KHTML code to create her own WebKit HTML engine.

“KHTML no longer exists for the modern Web,” says Guy Lunardi, product manager at Novell, specifically for LinuxInsider.

What are the differences?



Both Apple Safari and Apple iPhone use WebKit. However, according to Lunardi, the popularity of WebKit 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 software developer for Trolltech, says that his legendary engine will be a thing of the past. KHTML source code is much smaller and easier to work with than Gecko, according to Knoll.

“If we look at the latest innovations in KHTML, I believe that the main advancement is to consider its rapprochement with the development of WebKit,” he told LinuxInsider in an interview from his office in Oslo, Norway.

At the beginning



KHTML started 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 KHTML-based browser and file manager built into KDE.

His heyday fell on the decline of the popularity of the Netscape browser. But his position has been shaken with the return of the Gecko engine, which, in heavy agony, is separated from the source code of the Netscape browser by the Mozilla Foundation community.

“From the very beginning, the goal of Gecko was to create a full-fledged platform for developers, whereas KHTML has always been just an HTML rendering engine,” says Knoll. - “The main idea that was incorporated in KHTML is the creation of standards-compatible HTML engine that will be supported by 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 AOL. Later, the Mozilla Foundation contributed to the emergence of a large number of hired developers for the Gecko engine, he adds.

“KHTML has always been a purely voluntary project until Apple connected to it. None of the people who worked on KHTML before 2003 received money for the work they did, ”Knoll explains.

The paths diverged



The goals of both web visualization projects were the same. When there were many differences between them, they both created a standard-compliant HTML engine that could handle all existing web pages. Today, they both provide the same functionality in some way: HTML 4.1, XHTML, CSS 2.1, JavaScript, and web applications that use AJAX, Knoll says.

One of the main tasks Knoll set itself at the very beginning, he said, was an attempt to create a flexible and simple architecture for the HTML visualization engine. This made it easy to integrate and contribute to the project to other participants.

“Perhaps this was the main reason Apple was choosing between KHTML and Gecko for its Safari browser,” Knoll suggests.

Novell Lunardi agrees that performance among browsers is not the most critical factor. All browser engines have many standards and specifications, including HTML, CSS, XML Document Object Model ( DOM ), RDF (Resource Description Framework ), JavaScript, and more.

Same differences



Different engines exist because they were developed by different groups of people for various specific needs. In fact, they all achieve, in general, the same global goals.

“For example, they will parse the same code differently. In different ways will seek compliance with specifications. And in the processing of errors and incorrect content of the pages, they will differ, ”says Lunardi.

Knoll supported the KHTML project until 2003, when he handed over control over it and proceeded to specific tasks. Essentially, he made a full circle as a software developer and went back to where he started. Last fall, he started working on WebKit, trying to enable this engine in KDE 4.

No better



Users will be extremely difficult to choose between browsers, based solely on their internal engine. None of the engines, being installed together with others, does not lead to any user conflicts or a headache for software developers, emphasizes Knoll.

The choice of a specific engine is very much dependent on the current conditions for browser developers. For example, KHTML is best suited for integrated devices due to the smaller memory footprint. Gecko has more market share, explains Knoll.

Web developers have their own nuances, but they are quite trivial, says Knoll. The biggest challenge for developers is perhaps the differences between standards-compliant browsers (Gecko, KHTML and WebKit (for example, 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 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 one standard engine for all browsers? For this, Knoll sees two reasons why the existence of a single web page rendering engine would have a negative impact on end users.

With only one implementation of the display engine, there would be no guarantee that it complies with the documentation. It will also not guarantee that standards will be implemented at all, he argues.

The existence of several engines is good from the point of view of market competition: if there is a monopoly in the market, then there is no incentive to develop further, he agrees with the point of view of Spafford.

“We see the result of this among browsers that are trying to be as fast as possible or as compatible as possible with standards,” he says.

Thanks to all who have found the strength to familiarize themselves with this translation. It would be great if you share your thoughts in the comments.

Web Optimizator: checking the speed of loading sites

Source: https://habr.com/ru/post/31251/


All Articles