views:

3262

answers:

7

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.

+3  A: 

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

theraccoonbear
A: 

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.

Paul Nathan
+6  A: 

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.

swilliams
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.
Kit Sunde
+2  A: 

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.

Milan Babuškov
+1  A: 

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.

potyl
A: 

is there any experience/example of a standalone windows aplication with webkit I can download/test ??

Regards

Safari and Google Chrome both use WebKit.
mipadi
+4  A: 

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.

Ariya Hidayat
Hi Ariya, we ended up going with Qt; you guys are doing some amazing work. see my update above.
conmulligan