[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

beidson at apple.com beidson at apple.com
Thu Oct 29 20:41:28 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 2a943cc0a750b0b267a5c2718fd95a1dee615070
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 8 00:05:14 2009 +0000

    Send title changes to the global history delegate.
    <rdar://problem/7285293> and https://webkit.org/b/29904
    
    Reviewed by Darin Adler.
    
    WebKit/mac:
    
    * WebCoreSupport/WebFrameLoaderClient.mm:
    (WebFrameLoaderClient::setTitle):
    * WebView/WebDelegateImplementationCaching.h:
    * WebView/WebHistoryDelegate.h:
    * WebView/WebView.mm:
    (-[WebView _cacheHistoryDelegateImplementations]):
    
    WebKitTools:
    
    * DumpRenderTree/mac/HistoryDelegate.mm:
    (-[HistoryDelegate webView:updateHistoryTitle:forURL:]):
    
    LayoutTests:
    
    * http/tests/globalhistory/history-delegate-basic-title-expected.txt: Added.
    * http/tests/globalhistory/history-delegate-basic-title.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49277 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 0cb78ea..8662401 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-07  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Send title changes to the global history delegate.
+        <rdar://problem/7285293> and https://webkit.org/b/29904
+
+        * http/tests/globalhistory/history-delegate-basic-title-expected.txt: Added.
+        * http/tests/globalhistory/history-delegate-basic-title.html: Added.
+
 2009-10-07  Evan Martin  <evan at chromium.org>
 
         Reviewed by Adam Roben.
diff --git a/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt b/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt
new file mode 100644
index 0000000..ed25a80
--- /dev/null
+++ b/LayoutTests/http/tests/globalhistory/history-delegate-basic-title-expected.txt
@@ -0,0 +1,4 @@
+WebView navigated to url "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" with title "" with HTTP equivalent method "GET".  The navigation was successful and was not a client redirect.
+WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 1".
+WebView updated the title for history URL "http://127.0.0.1:8000/globalhistory/history-delegate-basic-title.html" to "Test Title 2".
+This test sees if the history delegate is notified of title changes.
diff --git a/LayoutTests/http/tests/globalhistory/history-delegate-basic-title.html b/LayoutTests/http/tests/globalhistory/history-delegate-basic-title.html
new file mode 100644
index 0000000..e5bdaa0
--- /dev/null
+++ b/LayoutTests/http/tests/globalhistory/history-delegate-basic-title.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+</script>
+<title>Test Title 1</title>
+</head>
+<body>
+This test sees if the history delegate is notified of title changes.
+</body>
+<script>
+document.title = "Test Title 2";
+</script>
+</html>
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 656065d..c4c9ec6 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-07  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Send title changes to the global history delegate.
+        <rdar://problem/7285293> and https://webkit.org/b/29904
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::setTitle):
+        * WebView/WebDelegateImplementationCaching.h:
+        * WebView/WebHistoryDelegate.h:
+        * WebView/WebView.mm:
+        (-[WebView _cacheHistoryDelegateImplementations]):
+
 2009-10-07  Darin Adler  <darin at apple.com>
 
         Reviewed by John Sullivan.
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index 764130a..4d253d8 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -1064,15 +1064,25 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso
     return loader.release();
 }
 
-// FIXME: <rdar://problem/4880065> - Push Global History into WebCore
-// Once that task is complete, this will go away
-void WebFrameLoaderClient::setTitle(const String& title, const KURL& URL)
+void WebFrameLoaderClient::setTitle(const String& title, const KURL& url)
 {
-    NSURL* nsURL = URL;
+    WebView* view = getWebView(m_webFrame.get());
+    
+    if ([view historyDelegate]) {
+        WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view);
+        if (!implementations->setTitleFunc)
+            return;
+            
+        CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title, (NSString *)url);
+        return;
+    }
+    
+    NSURL* nsURL = url;
     nsURL = [nsURL _webkit_canonicalize];
     if(!nsURL)
         return;
     NSString *titleNSString = title;
+       
     [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString];
 }
 
diff --git a/WebKit/mac/WebView/WebDelegateImplementationCaching.h b/WebKit/mac/WebView/WebDelegateImplementationCaching.h
index 6e7af15..907ba42 100644
--- a/WebKit/mac/WebView/WebDelegateImplementationCaching.h
+++ b/WebKit/mac/WebView/WebDelegateImplementationCaching.h
@@ -85,6 +85,7 @@ struct WebHistoryDelegateImplementationCache {
     IMP navigatedFunc;
     IMP clientRedirectFunc;
     IMP serverRedirectFunc;
+    IMP setTitleFunc;
 };
 
 WebResourceDelegateImplementationCache* WebViewGetResourceLoadDelegateImplementations(WebView *);
diff --git a/WebKit/mac/WebView/WebHistoryDelegate.h b/WebKit/mac/WebView/WebHistoryDelegate.h
index fba3cc8..4029eb0 100644
--- a/WebKit/mac/WebView/WebHistoryDelegate.h
+++ b/WebKit/mac/WebView/WebHistoryDelegate.h
@@ -37,4 +37,6 @@
 
 - (void)webView:(WebView *)webView didPerformServerRedirectFromURL:(NSString *)sourceURL toURL:(NSString *)destinationURL inFrame:(WebFrame *)webFrame;
 
+- (void)webView:(WebView *)webView updateHistoryTitle:(NSString *)title forURL:(NSString *)url;
+
 @end
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index deef0a8..83c7e20 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -1420,6 +1420,7 @@ static inline IMP getMethod(id o, SEL s)
     cache->navigatedFunc = getMethod(delegate, @selector(webView:didNavigateWithNavigationData:inFrame:));
     cache->clientRedirectFunc = getMethod(delegate, @selector(webView:didPerformClientRedirectFromURL:toURL:inFrame:));
     cache->serverRedirectFunc = getMethod(delegate, @selector(webView:didPerformServerRedirectFromURL:toURL:inFrame:));
+    cache->setTitleFunc = getMethod(delegate, @selector(webView:updateHistoryTitle:forURL:));
 }
 
 - (id)_policyDelegateForwarder
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 36c28e7..869af8a 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-07  Brady Eidson  <beidson at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Send title changes to the global history delegate.
+        <rdar://problem/7285293> and https://webkit.org/b/29904
+
+        * DumpRenderTree/mac/HistoryDelegate.mm:
+        (-[HistoryDelegate webView:updateHistoryTitle:forURL:]):
+
 2009-10-07  Adam Barth  <abarth at webkit.org>
 
         Unreviewed.  Remove some folks from committers.py who were listed on
diff --git a/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm b/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm
index d2c9664..9e2b836 100644
--- a/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/HistoryDelegate.mm
@@ -66,4 +66,9 @@
     printf("WebView performed a server redirect from \"%s\" to \"%s\".\n", [[source _drt_descriptionSuitableForTestResult] UTF8String], [[dest _drt_descriptionSuitableForTestResult] UTF8String]);
 }
 
+- (void)webView:(WebView *)webView updateHistoryTitle:(NSString *)title forURL:(NSString *)url
+{
+    printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", [[[NSURL URLWithString:url]_drt_descriptionSuitableForTestResult] UTF8String], [title UTF8String]);
+}
+
 @end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list