Index: configure.in
===================================================================
--- configure.in	(revision 3138)
+++ configure.in	(working copy)
@@ -39,7 +39,6 @@
 
 if test "x$enable_maintainer_mode" = "xyes"; then
 	AC_DEFINE([MAINTAINER_MODE],[1],[Define to enable 'maintainer-only' behaviour])
-#	DEPRECATION_FLAGS="-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGCONF_DISABLE_DEPRECATED -DGNOME_VFS_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DLIBGLADE_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED"
   if test "x$GCC" = "xyes"; then
 	MOZILLA_WARN_CXXFLAGS="-Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth $MOZILLA_WARN_CXXFLAGS"
   fi
@@ -222,40 +221,83 @@
 AC_SUBST(BZ_LIBS)
 
 
+
+AC_ARG_WITH([backend],
+	[AC_HELP_STRING([--with-backend=gecko|webkit],
+			[switch the beackend to build with [default=gecko]])], ,
+	with_backend=gecko)
+
+AM_CONDITIONAL(WEBKIT_BACKEND, test x"$with_backend" = xwebkit)
+
+if test "x$with_backend" = "xgecko"; then
 # *****
 # Gecko
 # *****
 
-GECKO_INIT([MOZILLA])
-GECKO_DEFINES
 
-AC_SUBST([MOZILLA])
-AC_SUBST([MOZILLA_FLAVOUR])
-AC_SUBST([MOZILLA_INCLUDE_ROOT])
-AC_SUBST([MOZILLA_HOME])
-AC_SUBST([MOZILLA_PREFIX])
-AC_SUBST([MOZILLA_EXTRA_LIBS])
-AC_SUBST([MOZILLA_GLUE_LIBS])
+   GECKO_INIT([MOZILLA])
+   GECKO_DEFINES
 
-case "$MOZILLA" in
-xulrunner) gecko_min_version=1.8 ;;
-libxul*) gecko_min_version=1.9 ;;
-*firefox) gecko_min_version=1.5 ;;
-*) AC_MSG_ERROR([$gecko_cv_gecko is not supported])
-esac
+   AC_SUBST([MOZILLA])
+   AC_SUBST([MOZILLA_FLAVOUR])
+   AC_SUBST([MOZILLA_INCLUDE_ROOT])
+   AC_SUBST([MOZILLA_HOME])
+   AC_SUBST([MOZILLA_PREFIX])
+   AC_SUBST([MOZILLA_EXTRA_LIBS])
+   AC_SUBST([MOZILLA_GLUE_LIBS])
 
-if test $MOZILLA = libxul-embedding; then
-	PKG_CHECK_MODULES([MOZILLA_COMPONENT],[libxul-embedding $gecko_cv_extra_pkg_dependencies])
+   case "$MOZILLA" in
+   xulrunner) gecko_min_version=1.8 ;;
+   libxul*) gecko_min_version=1.9 ;;
+   *firefox) gecko_min_version=1.5 ;;
+   *) AC_MSG_ERROR([$gecko_cv_gecko is not supported])
+   esac
+
+   if test $MOZILLA = libxul-embedding; then
+   	PKG_CHECK_MODULES([MOZILLA_COMPONENT],[libxul-embedding $gecko_cv_extra_pkg_dependencies])
 	MOZILLA_COMPONENT_CFLAGS="$MOZILLA_COMPONENT_CFLAGS `$PKG_CONFIG --cflags ${gecko_cv_gecko}` `$PKG_CONFIG --define-variable=includetype=unstable --cflags ${gecko_cv_gecko}`"
+   else
+   	PKG_CHECK_MODULES([MOZILLA_COMPONENT],[${gecko_cv_gecko}-xpcom >= $gecko_min_version $gecko_cv_extra_pkg_dependencies])
+   fi
+
+# Set flags
+
+  AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS $MOZILLA_WARN_CXXFLAGS"
+  AC_DEFINE(WEBKIT_BACKEND, 0, [Webkit Backend])
+  html_engine="Gecko - ${MOZILLA}"
+
 else
-	PKG_CHECK_MODULES([MOZILLA_COMPONENT],[${gecko_cv_gecko}-xpcom >= $gecko_min_version $gecko_cv_extra_pkg_dependencies])
+# *****
+# Webkit
+# *****
+  PKG_CHECK_MODULES(YELP_WEBKIT, "webkit-1.0")
+  AC_SUBST(YELP_WEBKIT_CFLAGS)
+  AC_SUBST(YELP_WEBKIT_LIBS)
+  AC_DEFINE(WEBKIT_BACKEND, 1, [Webkit Backend])
+  html_engine="Webkit.  Don't do it maaaannnn!!!!!"
+
+### Gecko does demand a lot of things here, doesn't it?
+
+
+  AM_CONDITIONAL([HAVE_MOZILLA_TOOLKIT],test x"$with_backend" = xgecko)
+
+  AM_CONDITIONAL([HAVE_GECKO_DEBUG],test x"$with_backend" = xgecko)
+
+  AM_CONDITIONAL([HAVE_GECKO_1_7],test x"$with_backend" = xgecko)
+  AM_CONDITIONAL([HAVE_GECKO_1_8],test x"$with_backend" = xgecko)
+  AM_CONDITIONAL([HAVE_GECKO_1_8_1],test x"$with_backend" = xgecko)
+  AM_CONDITIONAL([HAVE_GECKO_1_9],test x"$with_backend" = xgecko)
+  AM_CONDITIONAL([HAVE_GECKO_HOME],test x"$with_backend" = xgecko)
+  AM_CONDITIONAL([HAVE_GECKO_XPCOM_GLUE],test x"$with_backend" = xgecko)
+
+
 fi
 
-# Set flags
-
+# More flags
 AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
 AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
-AM_CXXFLAGS="$AM_CXXFLAGS $WARN_CXXFLAGS $MOZILLA_WARN_CXXFLAGS"
+
+
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([AM_CFLAGS])
 AC_SUBST([AM_CXXFLAGS])
@@ -286,5 +328,5 @@
 
 	Debug enabled:            ${enable_debug}
 	Search backend:           ${search_backend}
-	Mozilla version:          ${MOZILLA}
+	Mozilla version:          ${html_engine}
 "
Index: src/yelp-html.cpp
===================================================================
--- src/yelp-html.cpp	(revision 3138)
+++ src/yelp-html.cpp	(working copy)
@@ -21,15 +21,27 @@
  * Author: Marco Pesenti Gritti <marco@gnome.org>
  */
 
+#include <config.h>
+#ifndef WEBKIT_BACKEND
 #include <mozilla-config.h>
-#include <config.h>
+#endif
 
+#ifndef WEBKIT_BACKEND
 #include "yelp-gecko-services.h"
 #include "yelp-gecko-utils.h"
+#endif
 #include "yelp-marshal.h"
 #include "yelp-settings.h"
 
+#ifndef WEBKIT_BACKEND
 #include "Yelper.h"
+#else
+#include <string.h>
+#include <webkit/webkitwebframe.h>
+#include <webkit/webkitnetworkrequest.h>
+#include <webkit/webkitwebview.h>
+#include <webkit/webkitwebsettings.h>
+#endif
 
 #include "yelp-html.h"
 #include "yelp-debug.h"
@@ -38,16 +50,23 @@
 #define YELP_HTML_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), YELP_TYPE_HTML, YelpHtmlPriv))
 
 struct _YelpHtmlPriv {
+#ifndef WEBKIT_BACKEND
     Yelper      *yelper;
+#else
+    gchar *content;
+    gchar *mime;
+    gchar       *find_string;
+    gboolean    initialised;
+#endif
     gchar       *base_uri;
     gchar       *anchor;
     gboolean     frames_enabled;
     guint        timeout;
 };
 
-static void      html_set_fonts          (void);
-static void      html_set_colors         (void);
-static void      html_set_a11y           (void);
+static void      html_set_fonts          (YelpHtml *html);
+static void      html_set_colors         (YelpHtml *html);
+static void      html_set_a11y           (YelpHtml *html);
 
 enum {
     URI_SELECTED,
@@ -61,6 +80,7 @@
 
 static GObjectClass *parent_class = NULL;
 
+#ifndef WEBKIT_BACKEND
 static void
 html_title (GtkMozEmbed *embed)
 {
@@ -105,7 +125,49 @@
     }
     return block_load;
 }
+#else /* WEBKIT_BACKEND */
+static WebKitNavigationResponse
+html_open_uri (WebKitWebView *view, WebKitWebFrame *frame, WebKitNetworkRequest* req)
+{
+    
+    const gchar *uri = webkit_network_request_get_uri (req);
+    WebKitNavigationResponse resp = WEBKIT_NAVIGATION_RESPONSE_ACCEPT;
+    YelpHtml *html = YELP_HTML (view);
+    gboolean block_load;
+    gchar *real_uri;
 
+    debug_print (DB_FUNCTION, "entering\n");
+    debug_print (DB_ARG, "  uri = \"%s\"\n", uri);
+
+
+
+    if (uri[0] == '#') {
+	gchar *hash = g_strrstr (html->priv->base_uri, "#");
+	if (hash) {
+	    gchar *tmp = g_strndup (html->priv->base_uri, 
+				    (hash - html->priv->base_uri));
+	    real_uri = g_strdup_printf ("%s%s", tmp, uri);
+
+	    g_free (tmp);
+	} else {
+	    real_uri = g_strdup_printf ("%s%s", html->priv->base_uri, uri);
+	}
+    } else {
+	real_uri = g_strdup (uri);
+    }
+    
+    if (!html->priv->frames_enabled) {
+  	g_signal_emit (html, signals[URI_SELECTED], 0, real_uri, FALSE);
+  	resp = WEBKIT_NAVIGATION_RESPONSE_IGNORE;
+    } else {
+  	g_signal_emit (html, signals[FRAME_SELECTED], 0, real_uri, FALSE, &block_load);
+    }
+
+    g_free (real_uri);
+    return resp;
+}
+#endif /* ELSE WEBKIT_BACKEND */
+
 static void
 html_realize (GtkWidget *widget)
 {
@@ -113,12 +175,15 @@
 
     GTK_WIDGET_CLASS (parent_class)->realize (widget);
 
+#ifndef WEBKIT_BACKEND
     nsresult rv;
+
     rv = html->priv->yelper->Init ();
         
     if (NS_FAILED (rv)) {
         g_warning ("Yelper initialization failed for %p\n", (void*) html);
     }
+#endif
 }
 
 static void
@@ -132,29 +197,34 @@
     priv->base_uri = NULL;
     priv->anchor = NULL;
     priv->timeout = 0;
-
+#ifdef WEBKIT_BACKEND
+    priv->content = NULL;
+    priv->mime = NULL;
+    priv->initialised = FALSE;
+#else
     priv->yelper = new Yelper (GTK_MOZ_EMBED (html));
+#endif
     klass = YELP_HTML_GET_CLASS (html);
     if (!klass->font_handler) {
 	klass->font_handler =
 	    yelp_settings_notify_add (YELP_SETTINGS_INFO_FONTS,
 				      (GHookFunc) html_set_fonts,
-				      NULL);
-	html_set_fonts ();
+				      html);
+	html_set_fonts (html);
     }
     if (!klass->color_handler) {
 	klass->color_handler =
 	    yelp_settings_notify_add (YELP_SETTINGS_INFO_COLOR,
 				      (GHookFunc) html_set_colors,
-				      NULL);
-	html_set_colors ();
+				      html);
+	html_set_colors (html);
     }
     if (!klass->a11y_handler) {
 	klass->a11y_handler =
 	    yelp_settings_notify_add (YELP_SETTINGS_INFO_A11Y,
 				      (GHookFunc) html_set_a11y,
-				      NULL);
-	html_set_a11y ();
+				      html);
+	html_set_a11y (html);
     }
 }
 
@@ -163,7 +233,9 @@
 {
     YelpHtml *html = YELP_HTML (object);
 
+#ifndef WEBKIT_BACKEND
     html->priv->yelper->Destroy ();
+#endif
 
     parent_class->dispose (object);
 }
@@ -174,7 +246,9 @@
     YelpHtml *html = YELP_HTML (object);
     YelpHtmlPriv *priv = html->priv;
 
+#ifndef WEBKIT_BACKEND
     delete priv->yelper;
+#endif
 
     if (priv->timeout)
 	g_source_remove (priv->timeout);
@@ -189,8 +263,11 @@
 {
     GObjectClass *object_class = G_OBJECT_CLASS (klass);
     GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+#ifndef WEBKIT_BACKEND
     GtkMozEmbedClass *moz_embed_class = GTK_MOZ_EMBED_CLASS (klass);
-
+#else
+    WebKitWebViewClass* wc_class = WEBKIT_WEB_VIEW_CLASS (klass); 
+#endif
     parent_class = (GObjectClass *) g_type_class_peek_parent (klass);
 
     object_class->finalize = html_finalize;
@@ -198,9 +275,12 @@
 
     widget_class->realize = html_realize;
 
+
+#ifndef WEBKIT_BACKEND
     moz_embed_class->title = html_title;
     moz_embed_class->dom_mouse_down = html_dom_mouse_down;
-    moz_embed_class->open_uri = html_open_uri;
+#endif
+    wc_class->navigation_requested = html_open_uri;
 
     klass->font_handler = 0;
     klass->color_handler = 0;
@@ -228,6 +308,7 @@
 		      G_TYPE_BOOLEAN,
 		      2, G_TYPE_POINTER, G_TYPE_BOOLEAN);
     
+#ifndef WEBKIT_BACKEND
     signals[TITLE_CHANGED] = 
 	g_signal_new ("title_changed",
 		      G_TYPE_FROM_CLASS (klass),
@@ -238,6 +319,7 @@
 		      g_cclosure_marshal_VOID__STRING,
 		      G_TYPE_NONE,
 		      1, G_TYPE_STRING);
+#endif
 
     signals[POPUPMENU_REQUESTED] = 
 	g_signal_new ("popupmenu_requested",
@@ -271,9 +353,15 @@
 	    (GInstanceInitFunc) html_init,
 	};
 
-	type = g_type_register_static (GTK_TYPE_MOZ_EMBED,
+#ifdef WEBKIT_BACKEND
+	type = g_type_register_static (WEBKIT_TYPE_WEB_VIEW,
 				       "YelpHtml", 
 				       &info, (GTypeFlags) 0);
+#else
+	type = g_type_register_static (WEBKIT_TYPE_MOZ_EMBED,
+				       "YelpHtml", 
+				       &info, (GTypeFlags) 0);
+#endif
     }
 
     return type;
@@ -313,22 +401,42 @@
     debug_print (DB_FUNCTION, "entering\n");
 
     html->priv->frames_enabled = FALSE;
+#ifndef WEBKIT_BACKEND
     gtk_moz_embed_open_stream (GTK_MOZ_EMBED (html),
 			       html->priv->base_uri,
 			       mime);
+#else
+    g_free (html->priv->content);
+    html->priv->content = NULL;
+    g_free (html->priv->mime);
+    html->priv->mime = g_strdup(mime);
+#endif
 }
 
 void
 yelp_html_write (YelpHtml *html, const gchar *data, gint len)
 {
-     if (len == -1) len = strlen (data);
+#ifdef WEBKIT_BACKEND
+    gchar *tmp = NULL;
+#endif
+    if (len == -1) len = strlen (data);
 
     debug_print (DB_FUNCTION, "entering\n");
     debug_print (DB_ARG, "  data = %i bytes\n", strlen (data));
     debug_print (DB_ARG, "  len  = %i\n", len);
 
+#ifndef WEBKIT_BACKEND
     gtk_moz_embed_append_data (GTK_MOZ_EMBED (html),
 			       data, len);
+#else
+    if (html->priv->content) {
+	tmp = g_strjoin (NULL, html->priv->content, data, NULL);
+	g_free (html->priv->content);
+	html->priv->content = tmp;
+    } else {
+	html->priv->content = g_strdup (data);
+    }
+#endif
 }
 
 void
@@ -356,6 +464,7 @@
     g_free (string);
 }
 
+#ifndef WEBKIT_BACKEND
 /* Fire "children_changed::add" event to refresh "UI-Grab" window of GOK,
  * this event is not fired when using gtk_moz_embed_xxx_stream,
  * see Mozilla bug #293670.  Done in a timeout to allow mozilla to
@@ -369,29 +478,68 @@
     html->priv->timeout = 0;
     return FALSE;
 }
+#endif
 
 void
 yelp_html_close (YelpHtml *html)
 {
     debug_print (DB_FUNCTION, "entering\n");
+#ifndef WEBKIT_BACKEND
     gtk_moz_embed_close_stream (GTK_MOZ_EMBED (html));
     html->priv->timeout = g_timeout_add (2000, 
 					 (GSourceFunc) timeout_update_gok,
 					 html);
+#else
+    if (!html->priv->initialised) {
+	html->priv->initialised = TRUE;
+	html_set_fonts (html);
+	html_set_colors (html);
+	html_set_a11y (html);
+	webkit_web_view_set_maintains_back_forward_list (WEBKIT_WEB_VIEW (html), FALSE);
+    }
+
+    /* TODO: Broken navigation requests: */
+    /* See https://bugs.webkit.org/show_bug.cgi?id=19360 */
+    webkit_web_view_load_string (WEBKIT_WEB_VIEW (html),
+				 html->priv->content,
+				 html->priv->mime,
+				 NULL,
+				 "foo");
+    g_free (html->priv->content);
+    html->priv->content = NULL;
+    g_free (html->priv->mime);
+    html->priv->mime = NULL;
+#endif
 }
 
 gboolean
 yelp_html_find (YelpHtml    *html,
 		const gchar *find_string)
 {
+#ifndef WEBKIT_BACKEND
     return html->priv->yelper->Find (find_string);
+#else
+    if (html->priv->find_string)
+	g_free(html->priv->find_string);
+    html->priv->find_string = g_strdup (find_string);
+    return webkit_web_view_search_text (WEBKIT_WEB_VIEW (html),
+					find_string, FALSE,
+					TRUE, TRUE);
+#endif
 }
 
 gboolean
 yelp_html_find_again (YelpHtml    *html,					  
 		     gboolean     forward)
 {
+#ifndef WEBKIT_BACKEND
     return html->priv->yelper->FindAgain ((PRBool) forward);
+#else
+    return webkit_web_view_search_text (WEBKIT_WEB_VIEW (html),
+					html->priv->find_string, 
+					FALSE,
+					forward, TRUE);
+#endif
 }
 
 void
@@ -400,7 +548,9 @@
 			  gboolean     match_case,
 			  gboolean     wrap)
 {
+#ifndef WEBKIT_BACKEND
     html->priv->yelper->SetFindProperties (str, (PRBool) match_case, (PRBool) wrap);
+#endif
 }
 
 void
@@ -420,15 +570,20 @@
 void
 yelp_html_copy_selection (YelpHtml *html)
 {
+#ifndef WEBKIT_BACKEND
     html->priv->yelper->DoCommand ("cmd_copy");
+#endif
 }
 
 void
 yelp_html_select_all (YelpHtml *html)
 {
+#ifndef WEBKIT_BACKEND
     html->priv->yelper->DoCommand ("cmd_selectAll");
+#endif
 }
 
+#ifndef WEBKIT_BACKEND
 void
 yelp_html_print (YelpHtml *html, YelpPrintInfo *info, gboolean preview, gint *npages)
 {
@@ -446,24 +601,100 @@
 {
     html->priv->yelper->PrintPreviewEnd ();
 }
+#else
+void
+yelp_html_print (YelpHtml *html)
+{
+    webkit_web_view_execute_script (WEBKIT_WEB_VIEW (html), "print();");
+}
+#endif
 
 static void
-html_set_fonts (void)
+html_set_fonts (YelpHtml *html)
 {
     gchar *font;
+#ifdef WEBKIT_BACKEND
+    WebKitWebSettings *settings;
+    GValue *name, *size;
+    gchar *str_name;
+    gint i_size;
+    gchar *tmp;
 
+    settings = webkit_web_view_get_settings (WEBKIT_WEB_VIEW (html));
+#endif
+
     font = yelp_settings_get_font (YELP_FONT_VARIABLE);
+#ifndef WEBKIT_BACKEND
     yelp_gecko_set_font (YELP_FONT_VARIABLE, font);
+#else
+    /* We have to separate the string into name and size and then
+     * assign to the 2 gvalues */
+    tmp = g_strrstr (font, " ");
+    if (!tmp) {
+	g_warning ("Cannot decode font pattern %s", font);
+	g_free (font);
+	return;
+    }
+
+    name = g_new0 (GValue, 1);
+    size = g_new0 (GValue, 1);
+
+    name = g_value_init (name, G_TYPE_STRING);
+    size = g_value_init (size, G_TYPE_INT);
+
+    str_name = g_strndup (font, tmp - font);
+
+    i_size = g_strtod (tmp, NULL);
+
+    g_value_set_string (name, str_name);
+    g_value_set_int (size, i_size);
+
+    g_object_set_property (G_OBJECT (settings), "default-font-family",
+			   name);
+    g_object_set_property (G_OBJECT (settings), "default-font-size",
+			   size);
+
+#endif
     g_free (font);
 
     font = yelp_settings_get_font (YELP_FONT_FIXED);
+#ifndef WEBKIT_BACKEND
     yelp_gecko_set_font (YELP_FONT_FIXED, font);
+#else
+    tmp = g_strrstr (font, " ");
+    if (!tmp) {
+	g_warning ("Cannot decode monospace font pattern %s", font);
+	g_free (font);
+	return; 
+   }
+
+    name = g_value_reset (name);
+    size = g_value_reset (size);
+
+    str_name = g_strndup (font, tmp - font);
+
+    i_size = g_strtod (tmp, NULL);
+
+    g_value_set_string (name, str_name);
+    g_value_set_int (size, i_size);
+    
+
+    g_object_set_property (G_OBJECT (settings), "monospace-font-family",
+			   name);
+    g_object_set_property (G_OBJECT (settings), "default-monospace-font-size",
+			   size);
+
+#endif
     g_free (font);
 }
 
 static void
-html_set_colors (void)
+html_set_colors (YelpHtml *html)
 {
+    /* TODO: No Webkit equivalent ... */
+    /* See https://bugs.webkit.org/show_bug.cgi?id=19486 */
+
+#ifndef WEBKIT_BACKEND
     const gchar *color;
 
     color = yelp_settings_get_color (YELP_COLOR_FG);
@@ -474,25 +705,34 @@
  
     color = yelp_settings_get_color (YELP_COLOR_ANCHOR);
     yelp_gecko_set_color (YELP_COLOR_ANCHOR, color);
+
+#endif
 }
 
 static void
-html_set_a11y (void)
+html_set_a11y (YelpHtml *html)
 {
     gboolean caret;
 
     caret = yelp_settings_get_caret ();
+#ifndef WEBKIT_BACKEND
     yelp_gecko_set_caret (caret);
+#endif
 }
 
 gboolean
 yelp_html_initialize (void)
 {
+#ifndef WEBKIT_BACKEND
     return yelp_gecko_init ();
+#endif
+    return TRUE;
 }
 
 void
 yelp_html_shutdown (void)
 {
+#ifndef WEBKIT_BACKEND
     yelp_gecko_shutdown ();
+#endif
 }
Index: src/yelp-search-parser.c
===================================================================
--- src/yelp-search-parser.c	(revision 3138)
+++ src/yelp-search-parser.c	(working copy)
@@ -840,9 +840,9 @@
     gchar *ret;
     
     if (suffix) {
-	ret = g_strconcat (current, ":", new, suffix, NULL);
+	ret = g_strconcat (current, "\n", new, suffix, NULL);
     } else {
-	ret = g_strconcat (current, ":", new, NULL);
+	ret = g_strconcat (current, "\n", new, NULL);
     }
     g_free (current);
     return ret;
@@ -910,7 +910,7 @@
 	suffixes = NULL;
     }
 
-    search_terms = g_strdelimit (search_terms, ":", ' ');
+/*     search_terms = g_strdelimit (search_terms, ":", ' '); */
     list_copy = g_strsplit (g_utf8_casefold (g_strstrip (
 					  search_terms), -1),
 			    " ", -1);
@@ -981,11 +981,11 @@
 	}
     }
     g_strfreev (list_copy);
-    *terms = g_strsplit (term_str, ":", -1);
+    *terms = g_strsplit (term_str, "\n", -1);
     n_terms = g_strv_length (*terms);
     (*dups) = g_new0 (gint, n_terms);
     (*stops) = g_new0 (gboolean, n_terms);
-    list_copy = g_strsplit (dup_str, ":", -1);
+    list_copy = g_strsplit (dup_str, "\n", -1);
 
     if (n_terms == 0)
 	goto done;
Index: src/yelp-window.c
===================================================================
--- src/yelp-window.c	(revision 3138)
+++ src/yelp-window.c	(working copy)
@@ -125,12 +125,19 @@
 						   gchar             *uri,
 						   gboolean           handled,
 						   gpointer           user_data);
+#ifdef WEBKIT_BACKEND
 static void        html_title_changed_cb          (YelpHtml          *html,
+						   gpointer 	      webframe,
 						   gchar             *title,
 						   gpointer           user_data);
+#else
+static void        html_title_changed_cb          (YelpHtml          *html,
+						   gchar 	     *title,
+						   gpointer           user_data);
 static void        html_popupmenu_requested_cb    (YelpHtml *html,
 						   gchar *uri,
 						   gpointer user_data);
+#endif
 static gboolean    window_key_event_cb            (GtkWidget   *widget,
 						   GdkEventKey *event,
 						   YelpWindow  *window);
@@ -244,7 +251,11 @@
     YelpHtml       *html_view;
     GtkWidget      *side_sw;
     GtkWidget      *search_action;
+#ifdef WEBKIT_BACKEND
+    GtkWidget      *html_sw;
+#endif
 
+
     /* Find in Page */
     GtkToolItem    *find_prev;
     GtkToolItem    *find_next;
@@ -1036,7 +1047,11 @@
 	    doc = yelp_info_new (real_uri);
 	    break;
 	case YELP_RRN_TYPE_DOC:
+#ifndef WEBKIT_BACKEND
 	    priv->base_uri = g_filename_to_uri (real_uri, NULL, NULL);
+#else
+	    priv->base_uri = g_strdup(real_uri);
+#endif
 	    doc = yelp_docbook_new (real_uri);
 	    break;
 	case YELP_RRN_TYPE_SEARCH:
@@ -1367,7 +1382,17 @@
     gtk_paned_add1    (GTK_PANED (priv->pane), priv->side_sw);
 
     priv->html_pane = gtk_vbox_new (FALSE, 0);
-
+#ifdef WEBKIT_BACKEND
+    /* Webkit don't like shaving scrollbars, so we have to add our
+       own */
+    priv->html_sw = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->html_sw),
+				    GTK_POLICY_AUTOMATIC,
+				    GTK_POLICY_AUTOMATIC);
+    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->html_sw),
+					 GTK_SHADOW_IN);
+    
+#endif
     priv->find_bar = gtk_toolbar_new ();
     gtk_toolbar_set_style (GTK_TOOLBAR (priv->find_bar), GTK_TOOLBAR_BOTH_HORIZ);
     gtk_toolbar_set_icon_size (GTK_TOOLBAR (priv->find_bar), GTK_ICON_SIZE_MENU);
@@ -1389,21 +1414,32 @@
 		      "title_changed",
 		      G_CALLBACK (html_title_changed_cb),
 		      window);
+#ifndef WEBKIT_BACKEND
     g_signal_connect (priv->html_view,
 		      "popupmenu_requested",
 		      G_CALLBACK (html_popupmenu_requested_cb),
 		      window);
+#endif
     /* Connect to look for /'s */
     g_signal_connect (window,
 		      "key-press-event",
 		      G_CALLBACK (window_key_event_cb),
 		      window);
+#ifndef WEBKIT_BACKEND
     gtk_box_pack_end (GTK_BOX (priv->html_pane),
 		      GTK_WIDGET (priv->html_view),
 		      TRUE, TRUE, 0);
-
+#else
+    gtk_container_add (GTK_CONTAINER (priv->html_sw), 
+		       GTK_WIDGET (priv->html_view));
+    gtk_box_pack_end (GTK_BOX (priv->html_pane),
+		      GTK_WIDGET (priv->html_sw),
+		      TRUE, TRUE, 0);
+    gtk_widget_show (priv->html_sw);
+#endif
     gtk_paned_add2     (GTK_PANED (priv->pane),
 			priv->html_pane);
+
     gtk_box_pack_start (GTK_BOX (priv->main_box),
 			priv->pane,
 			TRUE, TRUE, 0);
@@ -1780,14 +1816,23 @@
     return TRUE;
 }
 
-static void
-html_title_changed_cb (YelpHtml  *html,
-		       gchar     *title,
-		       gpointer   user_data)
+
+#ifdef WEBKIT_BACKEND
+static void        html_title_changed_cb          (YelpHtml          *html,
+						   gpointer 	      webframe,
+						   gchar             *title,
+						   gpointer           user_data)
+#else
+static void        html_title_changed_cb          (YelpHtml          *html,
+						   gchar 	     *title,
+						   gpointer           user_data)
+#endif
 {
+
     gtk_window_set_title (GTK_WINDOW (user_data), title);
 }
 
+#ifndef WEBKIT_BACKEND
 static void
 html_popupmenu_requested_cb (YelpHtml *html,
 			     gchar *uri,
@@ -1814,6 +1859,7 @@
     gtk_menu_popup (GTK_MENU (window->priv->popup),
 		    NULL, NULL, NULL, NULL, 3, gtk_get_current_event_time());
 }
+#endif
 
 /** GtkTreeView Callbacks *****************************************************/
 
@@ -1946,7 +1992,11 @@
 
 	yelp_page_free ((YelpPage *) func_data);
 
+#ifndef WEBKIT_BACKEND
 	yelp_print_run (print->window, print->html, print->gtk_win, print->vbox);
+#else
+	yelp_html_print (print->html);
+#endif
 	break;
     case YELP_DOCUMENT_SIGNAL_TITLE:
 	g_free (func_data);
@@ -2053,17 +2103,17 @@
 	gsize             n;
 	gchar             buffer[BUFFER_SIZE];	
 	
-    file   = g_file_new_for_uri (priv->uri);
-    stream = g_file_read (file, NULL, NULL);
+	file   = g_file_new_for_uri (priv->uri);
+	stream = g_file_read (file, NULL, NULL);
 	
 	if (stream == NULL) {
 	    /*GError *error = NULL;
-	    g_set_error (&error, YELP_ERROR, YELP_ERROR_IO,
-			 _("The file ‘%s’ could not be read.  This file might "
-			   "be missing, or you might not have permissions to "
-			   "read it."),
-			 uri);
-			 window_error (window, error, TRUE);*/
+	      g_set_error (&error, YELP_ERROR, YELP_ERROR_IO,
+	      _("The file ‘%s’ could not be read.  This file might "
+	      "be missing, or you might not have permissions to "
+	      "read it."),
+	      uri);
+	      window_error (window, error, TRUE);*/
 	    /* TODO: Proper errors */
 
 	    if (file)
@@ -2088,18 +2138,24 @@
 	}
 	
 	while ((g_input_stream_read_all
-	    ((GInputStream *)stream, buffer, BUFFER_SIZE, &n, NULL, NULL))) {
+		((GInputStream *)stream, buffer, BUFFER_SIZE, &n, NULL, NULL))) {
 	    yelp_html_write (html, buffer, n);
 	}
 
-    if (file)
-        g_object_unref (file);
-    if (stream)
-        g_object_unref (stream);
+
+#ifdef WEBKIT_BACKEND
+	yelp_html_print (html);
+#endif
+
+	if (file)
+	    g_object_unref (file);
+	if (stream)
+	    g_object_unref (stream);
 	
 	yelp_html_close (html);
-	
+#ifndef WEBKIT_BACKEND
 	yelp_print_run (window, html, gtk_win, vbox);
+#endif
 	
     }
 }
Index: src/yelp-html.h
===================================================================
--- src/yelp-html.h	(revision 3138)
+++ src/yelp-html.h	(working copy)
@@ -23,7 +23,12 @@
 #ifndef __YELP_HTML_H__
 #define __YELP_HTML_H__
 
+#include <config.h>
+#ifndef WEBKIT_BACKEND
 #include <gtkmozembed.h>
+#else
+#include <webkit/webkit.h>
+#endif
 
 #include "yelp-print.h"
 
@@ -41,14 +46,20 @@
 typedef struct _YelpHtmlPriv    YelpHtmlPriv;
 
 struct _YelpHtml {
+#ifdef WEBKIT_BACKEND
+	WebKitWebView parent;
+#else
 	GtkMozEmbed   parent;
-
+#endif
 	YelpHtmlPriv *priv;
 };
 
 struct _YelpHtmlClass {
-        GtkMozEmbedClass parent_class;
-
+#ifdef WEBKIT_BACKEND
+	WebKitWebViewClass parent;
+#else
+	GtkMozEmbedClass parent_class;
+#endif
 	guint font_handler;
 	guint color_handler;
 	guint a11y_handler;
@@ -103,6 +114,7 @@
 
 void            yelp_html_select_all     (YelpHtml    *html);
 
+#ifndef WEBKIT_BACKEND
 void            yelp_html_print          (YelpHtml    *html,
 					  YelpPrintInfo *info,
 					  gboolean preview,
@@ -110,6 +122,9 @@
 void            yelp_html_preview_end    (YelpHtml    *html);
 void            yelp_html_preview_navigate (YelpHtml *html,
 					    gint page_no);
+#else
+void            yelp_html_print          (YelpHtml    *html);
+#endif
 gboolean        yelp_html_initialize     (void);
 void            yelp_html_shutdown       (void); 
 
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 3138)
+++ src/Makefile.am	(working copy)
@@ -1,12 +1,10 @@
 bin_PROGRAMS = yelp
 
 yelp_SOURCES =							\
-	Yelper.cpp		Yelper.h			\
 	yelp-base.c		yelp-base.h			\
 	yelp-bookmarks.c 	yelp-bookmarks.h		\
 	yelp-debug.c		yelp-debug.h			\
 	yelp-error.c		yelp-error.h			\
-	yelp-gecko-utils.cpp	yelp-gecko-utils.h		\
 	yelp-html.cpp		yelp-html.h			\
 	yelp-io-channel.c	yelp-io-channel.h		\
 	yelp-settings.c		yelp-settings.h			\
@@ -14,10 +12,8 @@
 	yelp-window.c 		yelp-window.h			\
 	yelp-marshal.c		yelp-marshal.h			\
 	yelp-main.c						\
-	yelp-print.c		yelp-print.h			\
 	yelp-page.c		yelp-page.h			\
 	yelp-transform.c	yelp-transform.h		\
-	yelp-gecko-services.h   yelp-gecko-services.cpp	        \
 	yelp-document.h		yelp-document.c			\
 	yelp-toc.h		yelp-toc.c			\
 	yelp-docbook.h		yelp-docbook.c			\
@@ -30,6 +26,15 @@
 	yelp-search.c		yelp-search.h			\
 	yelp-search-parser.c 	yelp-search-parser.h
 
+if !WEBKIT_BACKEND
+yelp_SOURCES +=							\
+	Yelper.cpp		Yelper.h			\
+	yelp-gecko-utils.cpp	yelp-gecko-utils.h		\
+	yelp-print.c		yelp-print.h			\
+	yelp-gecko-services.h   yelp-gecko-services.cpp
+endif
+
+
 YELP_DEFINES =								\
 	-DG_LOG_DOMAIN=\"Yelp\"						\
 	-DPREFIX=\""$(prefix)"\"					\
@@ -40,9 +45,13 @@
 	-DSERVERDIR=\"$(libexecdir)\"					\
 	-DBINDIR=\""$(bindir)"\"					\
 	-DSHAREDIR=\""$(pkgdatadir)"\"                                  \
-	-DMOZILLA_HOME=\""$(MOZILLA_HOME)\""				\
 	-DGDU_ICON_PATH=\"$(GDU_ICON_PATH)\"
 
+if !WEBKIT_BACKEND
+YELP_DEFINES +=                                                         \
+	-DMOZILLA_HOME=\""$(MOZILLA_HOME)\""
+
+
 mozilla_include_subdirs =	\
 	.		\
 	commandhandler  \
@@ -61,6 +70,7 @@
 	webbrwsr	\
 	webshell	\
 	widget
+endif
 
 yelp_CPPFLAGS =									\
 	-I$(top_srcdir)								\
@@ -68,9 +78,13 @@
 	$(YELP_DEFINES)								\
 	$(AM_CPPFLAGS)
 
+if !WEBKIT_BACKEND
 yelp_CPPFLAGS += $(MOZILLA_COMPONENT_CFLAGS)
 yelp_CPPFLAGS += $(addprefix -I$(MOZILLA_INCLUDE_ROOT)/,$(mozilla_include_subdirs))
+endif
 
+
+if !WEBKIT_BACKEND
 yelp_CFLAGS =				\
 	$(YELP_CFLAGS)			\
 	$(YELP_SEARCH_CFLAGS)		\
@@ -81,7 +95,21 @@
 	$(YELP_SEARCH_CFLAGS)		\
 	$(MOZILLA_COMPONENT_CFLAGS)	\
 	$(AM_CXXFLAGS)
+else
+yelp_CFLAGS =				\
+	$(YELP_CFLAGS)			\
+	$(YELP_SEARCH_CFLAGS)		\
+	$(AM_CFLAGS)			\
+	$(YELP_WEBKIT_CFLAGS)
 
+yelp_CXXFLAGS =				\
+	$(YELP_CFLAGS)			\
+	$(YELP_SEARCH_CFLAGS)		\
+	$(YELP_WEBKIT_CFLAGS)		\
+	$(AM_CXXFLAGS)
+endif
+
+if !WEBKIT_BACKEND
 yelp_LDADD =				\
 	$(YELP_LIBS)			\
 	$(YELP_SEARCH_LIBS)		\
@@ -100,6 +128,20 @@
 yelp_LDFLAGS += -R$(MOZILLA_HOME)
 endif
 
+else
+
+yelp_LDADD =				\
+	$(YELP_LIBS)			\
+	$(YELP_SEARCH_LIBS)		\
+	$(POPT_LIBS)			\
+	$(Z_LIBS)			\
+	$(BZ_LIBS)			\
+	$(LZMADEC_LIBS)			\
+	$(YELP_WEBKIT_LIBS)		\
+	$(X_LIBS)
+
+yelp_LDFLAGS = $(AM_LDFLAGS)
+endif
 #check_PROGRAMS =		\
 #	test-document		\
 #	test-man-parser		\
Index: src/yelp-main.c
===================================================================
--- src/yelp-main.c	(revision 3138)
+++ src/yelp-main.c	(working copy)
@@ -34,6 +34,7 @@
 #include <dbus/dbus-glib-bindings.h>
 #include <string.h>
 #include <stdlib.h>
+#include <libxslt/xslt.h>
 
 #include "client-bindings.h"
 #include "yelp-window.h"
@@ -345,6 +346,8 @@
 	bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);  
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain(GETTEXT_PACKAGE);
+ 	xsltInit ();
+	g_thread_init (NULL);
 
 	local_id = (gchar *) g_getenv ("DESKTOP_STARTUP_ID");
 
@@ -367,7 +370,9 @@
 				      GNOME_PROGRAM_STANDARD_PROPERTIES, 
 				      GNOME_PARAM_GOPTION_CONTEXT, context,
 				      GNOME_PARAM_NONE);
+#ifndef WEBKIT_BACKEND
 	dbus_g_thread_init();
+#endif
 
 	if (!startup_id) {
 		Time tmp;
@@ -386,7 +391,7 @@
 	}
 
 	if (!yelp_html_initialize ()) {
-		g_printerr ("Could not initialize gecko!\n");
+		g_printerr ("Could not initialize HTML component\n");
 		exit (1);
 	}
 
@@ -409,6 +414,7 @@
 	if (private || !main_is_running ()) {
 		const gchar          *env;
 
+#ifndef WEBKIT_BACKEND
 		/* workaround for bug #329461 */
 		env = g_getenv ("MOZ_ENABLE_PANGO");
 		
@@ -418,7 +424,9 @@
 			{
 				g_setenv ("MOZ_DISABLE_PANGO", "1", TRUE);
 			}
-		
+#endif
+
+		xsltInit ();
 		if (session_started) {
 			main_restore_session ();
 		} else {
