From 39931fc51a3a668d04f938fa555bdf9a4abf3056 Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Wed, 27 Jun 2012 13:16:16 +0200 Subject: ephy-web-view: fix anchor links' URI update Use again notify::uri, but do nothing if we receive it when the page is not loading (ie, before STARTED was reached). This fixes the difference in semantincs between WK1 and WK2. --- embed/ephy-web-view.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'embed') diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index ffd3f68d8..83a89bf94 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1162,15 +1162,17 @@ uri_changed_cb (WebKitWebView *web_view, GParamSpec *spec, gpointer data) { -#ifdef HAVE_WEBKIT2 - /* TODO: update adress when clicking anchor links. */ -#else char *uri; const char *current_address; g_object_get (web_view, "uri", &uri, NULL); current_address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view)); +#ifdef HAVE_WEBKIT2 + if (!EPHY_WEB_VIEW (web_view)->priv->is_loading) + return; +#endif + /* We need to check if we get URI notifications without going through the usual load process, as this can happen when changing location within a page */ @@ -1178,7 +1180,6 @@ uri_changed_cb (WebKitWebView *web_view, ephy_web_view_set_address (EPHY_WEB_VIEW (web_view), uri); g_free (uri); -#endif } #ifdef HAVE_WEBKIT2 -- cgit v1.2.3