views:

298

answers:

2

As I understand it, both Safari and Chrome use WebKit. There are many projects that allow you to embed WebKit, but want I actually want is to embed Chrome (for Windows) in a C# app so that my application renders identically to Chrome on Windows.

So when I embed, say, AwesomiumDotNet, will the rendering, CSS support, Javascript engine, font-rendering etc be that of Chrome for Windows, or of the underlying WebKit engine?

Presumably, WebKit doesn't handle things like font and control rendering or Chrome and Safari on Windows would look identical, and yet they don't (Safari has that fuzzy text thing going on, among other differences).

So is WebKit responsible for the layout and computed styles, while the browser built on top of WebKit provides the actual rendering? Or is it more that the projects used by Apple and Google forked a while ago, and that's why they're different?

+5  A: 

WebKit does handle all of those things, and in fact has it's own JS engine as well (JavaScriptCore). It also does in fact render the controls and such, though in a different way than you might expect. Safari and Chrome do indeed look different, but that's because they both have different implementations of WebKit. AwesomiumDotNet provides its own implementation (just as Chrome and Safari do) of control rendering.

For all intents and purposes, when you embed AwesomiumDotNet, you're embedding a full, pre-built browser control. WebKit itself, though, doesn't necessarily need to use each of the components of the full browser. For instance, Chrome implements its own JavaScript engine (V8).

Hope this helps!

mattbasta
Also, both browsers are likely to use their own implementations of buttons/text fields/etc, and both may change exactly how text rendering happens (e.g. using the platform's Unicode text engine or incorporating something better)
tc.
A: 

Chrome does not have the ability to be embedded in a C# application. You could look at taking the Chromium Source and converting it to a COM or ActiveX Object, but that is probably too much of a hassle. Instead you might try and embed the WebBrowser object and see if you can get Chrome Frame to work in it.

Update: I guess maybe thats what Awesomium is.... Not sure if it wraps Webkit or wraps Chromium though.

Greg Bray