Title: [101933] trunk/Source/WebKit/gtk
Revision
101933
Author
[email protected]
Date
2011-12-03 12:06:11 -0800 (Sat, 03 Dec 2011)

Log Message

[GTK] Implement History API FrameLoaderClient methods
https://bugs.webkit.org/show_bug.cgi?id=59017

Patch by Xan Lopez <[email protected]> on 2011-12-03
Reviewed by Gustavo Noronha Silva.

Fake the load process when the new HTML5 History APIs are
used. Otherwise the UA does not have a chance of updating the URL
entry, back/forward buttons, etc.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidNavigateWithinPage): fake a
load process.
(WebKit::FrameLoaderClient::dispatchDidPushStateWithinPage): call
dispatchDidNavigateWithinPage.
(WebKit::FrameLoaderClient::dispatchDidReplaceStateWithinPage):
ditto.
(WebKit::FrameLoaderClient::dispatchDidPopStateWithinPage): do
nothing, because push was already called, but note this in a
comment.
* WebCoreSupport/FrameLoaderClientGtk.h: add the new method.

Modified Paths

Diff

Modified: trunk/Source/WebKit/gtk/ChangeLog (101932 => 101933)


--- trunk/Source/WebKit/gtk/ChangeLog	2011-12-03 18:19:44 UTC (rev 101932)
+++ trunk/Source/WebKit/gtk/ChangeLog	2011-12-03 20:06:11 UTC (rev 101933)
@@ -1,3 +1,26 @@
+2011-12-03  Xan Lopez  <[email protected]>
+
+        [GTK] Implement History API FrameLoaderClient methods
+        https://bugs.webkit.org/show_bug.cgi?id=59017
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Fake the load process when the new HTML5 History APIs are
+        used. Otherwise the UA does not have a chance of updating the URL
+        entry, back/forward buttons, etc.
+
+        * WebCoreSupport/FrameLoaderClientGtk.cpp:
+        (WebKit::FrameLoaderClient::dispatchDidNavigateWithinPage): fake a
+        load process.
+        (WebKit::FrameLoaderClient::dispatchDidPushStateWithinPage): call
+        dispatchDidNavigateWithinPage.
+        (WebKit::FrameLoaderClient::dispatchDidReplaceStateWithinPage):
+        ditto.
+        (WebKit::FrameLoaderClient::dispatchDidPopStateWithinPage): do
+        nothing, because push was already called, but note this in a
+        comment.
+        * WebCoreSupport/FrameLoaderClientGtk.h: add the new method.
+
 2011-12-02  Philippe Normand  <[email protected]>
 
         [GStreamer] Fullscreen controller support for the new WebKit Fullscreen API

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp (101932 => 101933)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2011-12-03 18:19:44 UTC (rev 101932)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp	2011-12-03 20:06:11 UTC (rev 101933)
@@ -792,19 +792,41 @@
         g_object_notify(G_OBJECT(webView), "uri");
 }
 
+void FrameLoaderClient::dispatchDidNavigateWithinPage()
+{
+    WebKitWebView* webView = getViewFromFrame(m_frame);
+    WebKitWebFrame* mainFrame = webView->priv->mainFrame;
+    WebKitWebDataSource* dataSource = webkit_web_frame_get_data_source(mainFrame);
+    bool loaderCompleted = !webkit_web_data_source_is_loading(dataSource);
+
+    if (!loaderCompleted)
+        return;
+
+    // No provisional load started, because:
+    // - It will break (no provisional data source at this point).
+    // - There's no provisional load going on anyway, the URI is being
+    //   programatically changed.
+    // 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();
+    dispatchDidFinishLoad();
+}
+
 void FrameLoaderClient::dispatchDidPushStateWithinPage()
 {
-    notImplemented();
+    dispatchDidNavigateWithinPage();
 }
 
 void FrameLoaderClient::dispatchDidReplaceStateWithinPage()
 {
-    notImplemented();
+    dispatchDidNavigateWithinPage();
 }
 
 void FrameLoaderClient::dispatchDidPopStateWithinPage()
 {
-    notImplemented();
+    // No need to do anything, we already called
+    // dispatchDidNavigateWithinPage() in PushStateWithinPage().
 }
 
 void FrameLoaderClient::dispatchWillClose()

Modified: trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h (101932 => 101933)


--- trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h	2011-12-03 18:19:44 UTC (rev 101932)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h	2011-12-03 20:06:11 UTC (rev 101933)
@@ -75,6 +75,7 @@
         virtual void dispatchDidCancelClientRedirect();
         virtual void dispatchWillPerformClientRedirect(const WebCore::KURL&, double, double);
         virtual void dispatchDidChangeLocationWithinPage();
+        virtual void dispatchDidNavigateWithinPage();
         virtual void dispatchDidPushStateWithinPage();
         virtual void dispatchDidReplaceStateWithinPage();
         virtual void dispatchDidPopStateWithinPage();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to