Title: [140557] trunk/Source/WebKit/gtk
Revision
140557
Author
[email protected]
Date
2013-01-23 11:13:50 -0800 (Wed, 23 Jan 2013)

Log Message

[GTK] Avoid reset title for navigation within the page
https://bugs.webkit.org/show_bug.cgi?id=106908

Patch by Manuel Rego Casasnovas <[email protected]> on 2013-01-23
Reviewed by Martin Robinson.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidNavigateWithinPage): Call
dispatchDidCommitLoad with true as param.
(WebKit::FrameLoaderClient::dispatchDidCommitLoad): The method has been
overloaded. The default implementation (without params) simply calls
dispatchDidCommitLoad with false. The new private method with
isNavigatingWithinPage as param will avoid to reset the title for
navigation within the page.
* WebCoreSupport/FrameLoaderClientGtk.h:
(FrameLoaderClient): Add new private method dispatchDidCommitLoad with a
boolean parameter to know if it is navigating withing the same page or
not.

Modified Paths

Diff

Modified: trunk/Source/WebKit/gtk/ChangeLog (140556 => 140557)


--- trunk/Source/WebKit/gtk/ChangeLog	2013-01-23 19:10:03 UTC (rev 140556)
+++ trunk/Source/WebKit/gtk/ChangeLog	2013-01-23 19:13:50 UTC (rev 140557)
@@ -1,3 +1,23 @@
+2013-01-23  Manuel Rego Casasnovas  <[email protected]>
+
+        [GTK] Avoid reset title for navigation within the page
+        https://bugs.webkit.org/show_bug.cgi?id=106908
+
+        Reviewed by Martin Robinson.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidNavigateWithinPage): Call
+        dispatchDidCommitLoad with true as param.
+        (WebKit::FrameLoaderClient::dispatchDidCommitLoad): The method has been
+        overloaded. The default implementation (without params) simply calls
+        dispatchDidCommitLoad with false. The new private method with
+        isNavigatingWithinPage as param will avoid to reset the title for
+        navigation within the page.
+        * WebCoreSupport/FrameLoaderClientGtk.h:
+        (FrameLoaderClient): Add new private method dispatchDidCommitLoad with a
+        boolean parameter to know if it is navigating withing the same page or
+        not.
+
 2013-01-22  Anders Carlsson  <[email protected]>
 
         Use a platforom strategy for local storage

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp (140556 => 140557)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2013-01-23 19:10:03 UTC (rev 140556)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2013-01-23 19:13:50 UTC (rev 140557)
@@ -766,7 +766,7 @@
     // FIXME: this is not ideal, but it seems safer than changing our
     // current contract with the clients about provisional data
     // sources not being '0' during the provisional load stage.
-    dispatchDidCommitLoad();
+    dispatchDidCommitLoad(true);
     dispatchDidFinishLoad();
 }
 
@@ -841,6 +841,11 @@
 
 void FrameLoaderClient::dispatchDidCommitLoad()
 {
+    FrameLoaderClient::dispatchDidCommitLoad(false);
+}
+
+void FrameLoaderClient::dispatchDidCommitLoad(bool isNavigatingWithinPage)
+{
     if (m_loadingErrorPage)
         return;
 
@@ -852,10 +857,12 @@
     WebKitWebFramePrivate* priv = m_frame->priv;
     g_free(priv->uri);
     priv->uri = g_strdup(core(m_frame)->loader()->activeDocumentLoader()->url().string().utf8().data());
-    g_free(priv->title);
-    priv->title = NULL;
     g_object_notify(G_OBJECT(m_frame), "uri");
-    g_object_notify(G_OBJECT(m_frame), "title");
+    if (!isNavigatingWithinPage) {
+        g_free(priv->title);
+        priv->title = 0;
+        g_object_notify(G_OBJECT(m_frame), "title");
+    }
 
     g_signal_emit_by_name(m_frame, "load-committed");
     notifyStatus(m_frame, WEBKIT_LOAD_COMMITTED);
@@ -864,8 +871,9 @@
     if (m_frame == webkit_web_view_get_main_frame(webView)) {
         g_object_freeze_notify(G_OBJECT(webView));
         g_object_notify(G_OBJECT(webView), "uri");
-        g_object_notify(G_OBJECT(webView), "title");
         g_object_thaw_notify(G_OBJECT(webView));
+        if (!isNavigatingWithinPage)
+            g_object_notify(G_OBJECT(webView), "title");
         g_signal_emit_by_name(webView, "load-committed", m_frame);
     }
 

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h (140556 => 140557)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h	2013-01-23 19:10:03 UTC (rev 140556)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h	2013-01-23 19:13:50 UTC (rev 140557)
@@ -198,6 +198,8 @@
         // Plugin view to redirect data to
         WebCore::PluginView* m_pluginView;
         bool m_hasSentResponseToPlugin;
+
+        virtual void dispatchDidCommitLoad(bool isNavigatingWithinPage);
     };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to