[epiphany] ephy-web-view: fix anchor links' URI update



commit 39931fc51a3a668d04f938fa555bdf9a4abf3056
Author: Xan Lopez <xan igalia com>
Date:   Wed Jun 27 13:16:16 2012 +0200

    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 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index ffd3f68..83a89bf 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]