WebKit/mac:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 20:25:33 +0000 (20:25 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2007 20:25:33 +0000 (20:25 +0000)
        Reviewed by Brady.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16296
          <rdar://problem/5635641> -[WebFrameLoadDelegate didReceiveIcon:forFrame:] never called

        * WebView/WebView.mm:
        (-[WebView setFrameLoadDelegate:]): Call [WebIconDatabase sharedIconDatabase] if the
        a didReceiveIcon method is present.

WebKitTools:

        * DumpRenderTree/mac/FrameLoadDelegate.mm: Don't implement didReceiveIcon delegate method
        since it now triggers unwanted icon loading. We only had it because we implemented "all"
        delegate methods here.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28718 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/mac/ChangeLog
WebKit/mac/WebView/WebView.mm
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm

index 18de2381731ce1b729ed62de6dc323f27168b2dd..299fbe4cbc133b20b82cd66590ce27b73cda8b4d 100644 (file)
@@ -1,3 +1,14 @@
+2007-12-14  Darin Adler  <darin@apple.com>
+
+        Reviewed by Brady.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=16296
+          <rdar://problem/5635641> -[WebFrameLoadDelegate didReceiveIcon:forFrame:] never called
+
+        * WebView/WebView.mm:
+        (-[WebView setFrameLoadDelegate:]): Call [WebIconDatabase sharedIconDatabase] if the
+        a didReceiveIcon method is present.
+
 2007-12-14  Darin Adler  <darin@apple.com>
 
         Reviewed by Alexey.
index 68499b6e9b12919594a4c89852ae37fdc24a69ed..e5bc39eba701493fcf1ac6e2317e1c3f1e217916 100644 (file)
@@ -2138,6 +2138,10 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
 {
     _private->frameLoadDelegate = delegate;
     [self _cacheFrameLoadDelegateImplementations];
+
+    // If this delegate wants callbacks for icons, fire up the icon database.
+    if (_private->frameLoadDelegateImplementations.didReceiveIconForFrameFunc)
+        [WebIconDatabase sharedIconDatabase];
 }
 
 - frameLoadDelegate
@@ -4054,11 +4058,11 @@ static WebFrameView *containingFrameView(NSView *view)
     // notification any longer
     [self _registerForIconNotification:NO];
 
-    WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(self);
-    if (implementations->didReceiveIconForFrameFunc) {
+    WebFrameLoadDelegateImplementationCache* cache = &_private->frameLoadDelegateImplementations;
+    if (cache->didReceiveIconForFrameFunc) {
         Image* image = iconDatabase()->iconForPageURL(core(webFrame)->loader()->url().string(), IntSize(16, 16));
         if (NSImage *icon = webGetNSImage(image, NSMakeSize(16, 16)))
-            CallFrameLoadDelegate(implementations->didReceiveIconForFrameFunc, self, @selector(webView:didReceiveIcon:forFrame:), icon, webFrame);
+            CallFrameLoadDelegate(cache->didReceiveIconForFrameFunc, self, @selector(webView:didReceiveIcon:forFrame:), icon, webFrame);
     }
 
     [self _didChangeValueForKey:_WebMainFrameIconKey];
index 55fa257699419368de965e9653191aeb22d8fcda..bc6a76f806989920099cbe955e2e737e3f7ba9ac 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-14  Darin Adler  <darin@apple.com>
+
+        * DumpRenderTree/mac/FrameLoadDelegate.mm: Don't implement didReceiveIcon delegate method
+        since it now triggers unwanted icon loading. We only had it because we implemented "all"
+        delegate methods here.
+
 2007-12-14  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin and Geoff.
index c39139e8a89afd32a828ba299604fb60c05803c2..c6dcc1582cc5e576e7eb54280bd31884f1ef14f7 100644 (file)
     }
 }
 
-- (void)webView:(WebView *)sender didReceiveIcon:(NSImage *)image forFrame:(WebFrame *)frame
-{
-    if (!done && layoutTestController->dumpFrameLoadCallbacks()) {
-        NSString *string = [NSString stringWithFormat:@"%@ - didReceiveIconForFrame", [frame _drt_descriptionSuitableForTestResult]];
-        printf ("%s\n", [string UTF8String]);
-    }
-}
-
 - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame
 {
     if (!done && layoutTestController->dumpFrameLoadCallbacks()) {