What is the best HTML Rendering Engine to embed in an application? [closed]
Asked Answered
B

6

18

At the moment, our application uses the Trident Win32 component, but we want to move away from that for a few reasons, chief among them being our desire to go cross-platform.

We're looking at WebKit and Gecko, but I'd love to get some feedback before I make a decision. Here are some of the most important requirements:

  1. It should be relatively fast, with a small footprint. Ideally, we would be able to trim away anything we don't need without too much effort.

  2. Decent documentation is important. I don't anticipate needing to do anything too unusual with it, but you never know.

  3. We're using C++, and would like to work with a well-designed object-oriented architecture, if possible.

  4. Cross-platform is a must, and good performance would be helpful in the long run (we may end up porting to mobile platforms).

Are there any considerations I need to take into account before making a decision? Has anyone worked with WebKit or Gecko before? If so, are there any articles or tutorials I might find useful?

Update:

Thanks for the responses guys. We ended up going with Qt 4.5, which includes WebKit. We're really pleased with it so far, in fact I think Qt is probably the best UI framework I've ever used; the difference between coding with the native Win32 APIs and this is staggering. It's also real easy to learn, the only major issue we had was getting used to the signals/slots paradigm.

Brigid answered 8/10, 2008 at 19:8 Comment(3)
Are you (or can you be) open source? If no, that may limit what you can use. (I think WebKit is LGPL? Those restrictions aren't too bad if you're closed source)Gilliangilliard
We're not far enough along yet to make that decision, but it's certainly a possibility.Brigid
This question should be merged or linked with "What embedded browser for C++ project?" (stackoverflow.com/questions/835201) Although that question is about embedding web browser engine with rendering stripped off.Erenow
H
9

A little history might help in your decision. When Apple was considering which engine to use in making Safari they looked at Gecko, but decided to go with KHTML, fork it and called it WebKit. Their reasons for doing this was that Gecko had tons of legacy cruft still leftover from Netscape and was far more complicated.

KHTML/WebKit was newer, and thus had less legacy. It was also cleaner, quicker, and better documented.

One of the goals of Firefox 3 was to clean up the codebase and simplify it. From what I've heard they did do this, but I don't know how it compares with current iterations of WebKit. It apparently wasn't enough for Google when they made Chrome, and they have a significant stake in Firefox.

See here for more details.

Horrific answered 8/10, 2008 at 19:16 Comment(1)
Firefox 3 was released on June 17th 2008 and by then Chrome had already been in development for 2 years if I recall correcly. I think it's safe to say that the restructuring Mozilla did for Firefox 3 had no relevance in Googles decission to go with Webkit.Alasteir
G
5

I am biased, but if you do not mind using (LGPL-ed) Qt, what about using QtWebKit? It is fairly easy to embed, cross-platform of course, has a nice web browser demonstration, and also other related examples.

Godesberg answered 17/3, 2009 at 23:2 Comment(1)
Hi Ariya, we ended up going with Qt; you guys are doing some amazing work. see my update above.Brigid
D
4

It depends on your needs. Even Webkit can be overkill if you just want to display plain-old HTML. In some of my applications I use wxHTML instead. It's a component from wxWidgets library (not sure if you can use it without wx though). It's lightweight, supports just basic HTML stuff (some CSS support might be available in the next version), and has a really nice wxHtmlEasyPrinting control which gives nice print preview and also prints very well. As for cross-platform, wxWidgets works on Windows, Linux, Mac, and some other systems, so that would surely fit your requirements.

I don't recommend going down the Gecko road. It is possible to integrate it, but it's much harder to do than KHTML/Webkit - simply because Gecko was not built with embedding in mind.

Digital answered 8/10, 2008 at 19:24 Comment(0)
K
3

I think I would suggest Safari/Chrome's WebKit engine which was derived from KHTML, the Konqueror rendering engine.

Krug answered 8/10, 2008 at 19:8 Comment(0)
P
2

Try to opt for Webkit as it is used by many different browsers (Konqueror, Safari and Google chrome). This makes Webkit more versatile and more adaptable to other needs.

The development of Gecko is very tied with Firefox. A lot of modifications made to Gecko are done because Firefox dictates them. For instance, Firefox 3 decided that it was going to block all self signed certificates for security purposes. The implementation has been done into Gecko's engine which means that any application that decides to embed Gecko has this security constraint added to them.

If you can stay with Webkit as it mainly a rendering engine for HTML pages. That's been developed with the intention to be used among different web browser. While Gecko is primarily the rendering engine of a single browser which just happens to offer an API for embedding.

Penna answered 11/2, 2009 at 17:32 Comment(1)
I would also hasten to add that Adobe AIR uses WebKit.Jumper
N
0

My understanding is Webkit is pretty good & smaller than Gecko. Gecko is supposed to have had a revamp recently which makes it fairly comparable, though.

Neapolitan answered 8/10, 2008 at 19:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.