Index: mail/em-folder-browser.c
===================================================================
--- mail/em-folder-browser.c	(revision 35828)
+++ mail/em-folder-browser.c	(working copy)
@@ -539,8 +539,10 @@
 	gtk_widget_show(p->scroll);
 
 	p->preview = gtk_vbox_new (FALSE, 6);
-	gtk_container_add((GtkContainer *)p->scroll, (GtkWidget *)emfb->view.preview->formathtml.html);
-	gtk_widget_show((GtkWidget *)emfb->view.preview->formathtml.html);
+	//gtk_container_add((GtkContainer *)p->scroll, (GtkWidget *)emfb->view.preview->formathtml.html);
+	//gtk_widget_show((GtkWidget *)emfb->view.preview->formathtml.html);
+	gtk_container_add((GtkContainer *)p->scroll, (GtkWidget *)emfb->view.preview->formathtml.webview);
+	gtk_widget_show((GtkWidget *)emfb->view.preview->formathtml.webview);
 	gtk_box_pack_start ((GtkBox *)p->preview, p->scroll, TRUE, TRUE, 0);
 	gtk_box_pack_start ((GtkBox *)p->preview, em_format_html_get_search_dialog (emfb->view.preview), FALSE, FALSE, 0);
 	gtk_paned_pack2 (GTK_PANED (emfb->vpane), p->preview, TRUE, FALSE);
Index: mail/em-html-stream.c
===================================================================
--- mail/em-html-stream.c	(revision 35828)
+++ mail/em-html-stream.c	(working copy)
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <gtkhtml/gtkhtml.h>
 #include <gtkhtml/gtkhtml-stream.h>
+#include <webkit/webkit.h>
 #include <gtk/gtk.h>
 #include "em-html-stream.h"
 
@@ -110,9 +111,19 @@
 	if (emhs->html == NULL)
 		return -1;
 
-	if (emhs->html_stream == NULL)
+	if (emhs->html_stream == NULL) {
 		emhs->html_stream = gtk_html_begin_full (emhs->html, NULL, NULL, emhs->flags);
+        //g_object_set_data (G_OBJECT (emhs->html_stream), "gstring", g_string_new(""));
+        g_object_set_data (G_OBJECT (emhs->html), "gstring", g_string_new(""));
+    }
 
+    //g_print("%s\n\n", buffer);
+
+    //GString *string = (GString *) g_object_get_data (emhs->html_stream, "gstring");
+    GString *string = (GString *) g_object_get_data (emhs->html, "gstring");
+    if (string)
+        g_string_append_len(string, buffer, n);
+
 	gtk_html_stream_write(emhs->html_stream, buffer, n);
 
 	return (ssize_t) n;
@@ -139,6 +150,19 @@
 	if (emhs->html_stream == NULL)
 		return -1;
 
+
+    //GString *string = (GString *) g_object_get_data (emhs->html_stream, "gstring");
+    GString *string = (GString *) g_object_get_data (emhs->html, "gstring");
+    if (string) {
+    gchar *data = g_string_free(string, FALSE);
+    g_object_set_data (G_OBJECT (emhs->html), "gstring", NULL);
+    g_print("DATA:\n%s\n\n", data);
+    WebKitWebView *webview = (WebKitWebView *) g_object_get_data (emhs->html, "webview");
+    if (webview)
+        webkit_web_view_load_html_string (webview, data, NULL);
+    }
+
+
 	gtk_html_stream_close(emhs->html_stream, GTK_HTML_STREAM_OK);
 	emhs_cleanup(emhs);
 
Index: mail/em-format-html-display.c
===================================================================
--- mail/em-format-html-display.c	(revision 35828)
+++ mail/em-format-html-display.c	(working copy)
@@ -41,6 +41,7 @@
 #include <gtkhtml/gtkhtml.h>
 #include <gtkhtml/gtkhtml-embedded.h>
 #include <gtkhtml/gtkhtml-search.h>
+#include <webkit/webkit.h>
 
 #include <glade/glade.h>
 
@@ -388,10 +389,12 @@
 		if(event->direction == GDK_SCROLL_UP)
 		{
 			gtk_html_zoom_in (efhd->formathtml.html);
+			webkit_web_view_zoom_in (efhd->formathtml.webview);
 		}
 		else if(event->direction == GDK_SCROLL_DOWN)
 		{
 			gtk_html_zoom_out (efhd->formathtml.html);
+			webkit_web_view_zoom_out (efhd->formathtml.webview);
 		}
 		return TRUE;
 	}
@@ -2220,7 +2223,8 @@
 
 	/* FIXME: What if the text is more?. Should we reduce the text with appending ...?
 	 * or resize the bar? How to figure out that, it needs more space? */
-	bar_width = ((GtkWidget *)efh->html)->parent->allocation.width - /* FIXME */16;
+	//bar_width = ((GtkWidget *)efh->html)->parent->allocation.width - /* FIXME */16;
+	bar_width = ((GtkWidget *)efh->webview)->parent->allocation.width - /* FIXME */16;
 	gtk_widget_set_size_request (priv->attachment_bar,
 				     bar_width > 0 ? bar_width : 0,
 				     84 /* FIXME: Default show only one row, Dont hardcode size*/);
@@ -2270,6 +2274,9 @@
 	if (efhd->nobar || efhd->priv->files)
 		return;
 
+    //HACK to avoid attachment bar with WebKit
+    return;
+
 	efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
 	efhd->priv->updated = FALSE;
 
@@ -2346,7 +2353,8 @@
 static void
 efhd_resize (GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh)
 {
-	gtk_widget_set_size_request (w, ((GtkWidget *)efh->html)->allocation.width-48, 250);
+	//gtk_widget_set_size_request (w, ((GtkWidget *)efh->html)->allocation.width-48, 250);
+	gtk_widget_set_size_request (w, ((GtkWidget *)efh->webview)->allocation.width-48, 250);
 }
 
 /* optional render attachment button callback */
@@ -2426,7 +2434,8 @@
 	gtk_box_pack_start(GTK_BOX (vbox), scroll, TRUE, TRUE, 6);
 	gtk_widget_show (GTK_WIDGET(view));
 
-	gtk_widget_set_size_request (scroll, (GTK_WIDGET (efh->html))->allocation.width - 48, 250);
+	//gtk_widget_set_size_request (scroll, (GTK_WIDGET (efh->html))->allocation.width - 48, 250);
+	gtk_widget_set_size_request (scroll, (GTK_WIDGET (efh->webview))->allocation.width - 48, 250);
 	g_signal_connect (scroll, "size_allocate", G_CALLBACK(efhd_resize), efh);
 	gtk_widget_show (scroll);
 
Index: mail/em-format-html.c
===================================================================
--- mail/em-format-html.c	(revision 35828)
+++ mail/em-format-html.c	(working copy)
@@ -50,6 +50,7 @@
 #include <gtkhtml/gtkhtml.h>
 #include <gtkhtml/gtkhtml-embedded.h>
 #include <gtkhtml/gtkhtml-stream.h>
+#include <webkit/webkit.h>
 
 #include <glib/gi18n.h>
 
@@ -154,9 +155,14 @@
 		(GDestroyNotify) efh_free_cache);
 
 	efh->html = (GtkHTML *)gtk_html_new();
+	efh->webview = (WebKitWebView *)webkit_web_view_new();
+    // HACK: just for fun, enable editing
+    webkit_web_view_set_editable(efh->webview, TRUE);
+    g_object_set_data(efh->html, "webview", efh->webview);
 	gtk_html_set_blocking(efh->html, FALSE);
 	gtk_html_set_caret_first_focus_anchor (efh->html, EFM_MESSAGE_START_ANAME);
 	g_object_ref_sink(efh->html);
+	g_object_ref_sink(efh->webview);
 
 	gtk_html_set_default_content_type(efh->html, "text/html; charset=utf-8");
 	gtk_html_set_editable(efh->html, FALSE);
@@ -800,7 +806,7 @@
 		type = camel_mime_part_get_content_type(newpart);
 		if (camel_content_type_is (type, "text", "*") && !camel_content_type_is(type, "text", "calendar")) {
 			camel_stream_printf (stream,
-   					"<div style=\"border: solid #%06x 1px; background-color: #%06x; padding: 10px; color: #%06x;\">\n",
+   					"<div style=\"border: solid #%06x 1px; -webkit-border-radius: 6px; background-color: #%06x; padding: 10px; color: #%06x;\">\n",
 					     efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff);
 			camel_stream_write_string(stream, "<tt>\n" EFH_MESSAGE_START);
 			em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, (CamelDataWrapper *)newpart);
@@ -877,10 +883,17 @@
 	char *cid = NULL;
 
 	camel_stream_printf (stream,
-			     "<div style=\"border: solid #%06x 1px; background-color: #%06x; color: #%06x;\">\n"
+			     //"<div style=\"border: solid #%06x 1px; -webkit-border-radius: 6px; background-color: #%06x; color: #%06x;\">\n"
+			     "<div style=\"border: solid #%06x 1px; -webkit-border-radius: 6px; padding: 1em; background-color: #%06x; color: #%06x;\">\n"
 			     "<!-- text/html -->\n" EFH_MESSAGE_START,
 			     efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff, efh->text_colour & 0xffffff);
 
+    //NEW WebKit
+	em_format_format_text((EMFormat *)efh, (CamelStream *)stream, (CamelDataWrapper *)part);
+	camel_stream_printf(stream, "</div>\n");
+    return;
+
+#if 0
 	/* TODO: perhaps we don't need to calculate this anymore now base is handled better */
 	/* calculate our own location string so add_puri doesn't do it
 	   for us. our iframes are special cases, we need to use the
@@ -911,6 +924,7 @@
 			    "</div>\n",
 			    cid, cid);
 	g_free(cid);
+#endif
 }
 
 /* This is a lot of code for something useless ... */
@@ -1247,13 +1261,21 @@
 	if (m->format->html == NULL)
 		return;
 
+#if 0
 	camel_stream_printf((CamelStream *)m->estream,
 			    "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n"
 			    "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n"
 			    "<body bgcolor =\"#%06x\" text=\"#%06x\" marginwidth=6 marginheight=6>\n",
 			    m->format->body_colour & 0xffffff,
 			    m->format->header_colour & 0xffffff);
+#endif
 
+	camel_stream_printf((CamelStream *)m->estream,
+			    "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n"
+			    "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n"
+			    "<body bgcolor =\"#%06x\" marginwidth=6 marginheight=6>\n",
+			    m->format->body_colour & 0xffffff);
+
 	/* <insert top-header stuff here> */
 
 	if (((EMFormat *)m->format)->mode == EM_FORMAT_SOURCE) {
@@ -1853,11 +1875,18 @@
 	charset = camel_content_type_param (ct, "charset");
 	charset = camel_iconv_charset_name(charset);
 
+#if 0
 	if (!efh->simple_headers)
 		camel_stream_printf(stream,
 				    "<font color=\"#%06x\">\n"
 				    "<table cellpadding=\"0\" width=\"100%%\">",
 				    efh->header_colour & 0xffffff);
+#endif
+
+	if (!efh->simple_headers)
+		camel_stream_printf(stream,
+				    "<font color=\"black\">\n"
+				    "<table cellpadding=\"0\" width=\"100%%\">");
 	
 	hdr_charset = emf->charset ? emf->charset : emf->default_charset;
 	
Index: mail/em-format-html.h
===================================================================
--- mail/em-format-html.h	(revision 35828)
+++ mail/em-format-html.h	(working copy)
@@ -182,6 +182,7 @@
 	struct _EMFormatHTMLPrivate *priv;
 
 	struct _GtkHTML *html;
+	struct _WebKitWebView *webview;
 
 	EDList pending_object_list;
 
Index: configure.in
===================================================================
--- configure.in	(revision 35828)
+++ configure.in	(working copy)
@@ -668,6 +668,9 @@
 GTKHTML_API_VERSION=`$PKG_CONFIG --variable gtkhtml_apiversion libgtkhtml-3.14`
 AC_DEFINE_UNQUOTED(GTKHTML_API_VERSION, "$GTKHTML_API_VERSION", [The gtkhtml api version])
 
+PKG_CHECK_MODULES([WEBKIT], [webkit-1.0])
+AC_SUBST([WEBKIT_CFLAGS])
+AC_SUBST([WEBKIT_LIBS])
 
 
 
@@ -1582,7 +1585,7 @@
 
 dnl --- evolution-mail flags
 
-EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, camel-provider-$EDS_PACKAGE libgnomeui-2.0 libbonoboui-2.0 libglade-2.0 gio-2.0 gconf-2.0 gobject-2.0 libgtkhtml-$GTKHTML_PACKAGE gtkhtml-editor bonobo-activation-2.0 $mozilla_nss libebook-$EDS_PACKAGE libedataserverui-$EDS_PACKAGE)
+EVO_SET_COMPILE_FLAGS(EVOLUTION_MAIL, camel-provider-$EDS_PACKAGE libgnomeui-2.0 libbonoboui-2.0 libglade-2.0 gio-2.0 gconf-2.0 gobject-2.0 libgtkhtml-$GTKHTML_PACKAGE webkit-1.0 gtkhtml-editor bonobo-activation-2.0 $mozilla_nss libebook-$EDS_PACKAGE libedataserverui-$EDS_PACKAGE)
 AC_SUBST(EVOLUTION_MAIL_CFLAGS)
 AC_SUBST(EVOLUTION_MAIL_LIBS)
 
