[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:25:29 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 763afee661d414da3a5932c803810ae0f8e9c803
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 19 19:04:49 2002 +0000

    top level:
    
            * Site/favicon.ico: Added.
    
    WebCore:
    
    	Added support favicons.
    
            * khtml/html/html_headimpl.cpp:
            (HTMLLinkElementImpl::process): added an APPLE_CHANGES
            * khtml/khtml_part.cpp:
            (KHTMLPart::loadIcon): added
            * khtml/khtml_part.h: added loadIcon
            * kwq/KWQKHTMLPartImpl.h: added loadIcon
            * kwq/KWQKHTMLPartImpl.mm: added loadIcon
            (KWQKHTMLPartImpl::loadIcon):
            * kwq/WebCoreBridge.h: added loadIcon
    
    WebKit:
    
    	Added support favicons.
    
            * Misc.subproj/WebIconLoader.h: Added.
            * Misc.subproj/WebIconLoader.m: Added.
            (-[WebIconLoaderPrivate dealloc]):
            (+[WebIconLoader defaultIcon]):
            (-[WebIconLoader initWithURL:]):
            (-[WebIconLoader dealloc]):
            (-[WebIconLoader setDelegate:]):
            (-[WebIconLoader startLoading]):
            (-[WebIconLoader startLoadingOnlyFromCache]):
            (-[WebIconLoader stopLoading]):
            (-[WebIconLoader WebResourceHandleDidBeginLoading:]):
            (-[WebIconLoader WebResourceHandleDidCancelLoading:]):
            (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]):
            (-[WebIconLoader WebResourceHandle:resourceDataDidBecomeAvailable:]):
            (-[WebIconLoader WebResourceHandle:resourceDidFailLoadingWithResult:]):
            (-[WebIconLoader WebResourceHandle:didRedirectToURL:]):
            * WebCoreSupport.subproj/WebBridge.m:
            (-[WebBridge loadIcon:]): added
            * WebKit.pbproj/project.pbxproj:
            * WebView.subproj/WebControllerPrivate.m:
            (-[WebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]):
            * WebView.subproj/WebDataSourcePrivate.h:
            * WebView.subproj/WebDataSourcePrivate.m:
            (-[WebDataSourcePrivate dealloc]):
            (-[WebDataSource _loadPageIconIfNecessary]): added
            (-[WebDataSource _setPrimaryLoadComplete:]): start loading icon
            (-[WebDataSource _stopLoading]): stop icon loader
            (-[WebDataSource receivedPageIcon:]): added
            (-[WebDataSource _loadIcon:]): added
            * WebView.subproj/WebLocationChangeHandler.h:
    
    WebBrowser:
    
    	Added support favicons.
    
            * BrowserDocument.m:
            (-[BrowserDocument _receivedPageIcon:]): added
            * BrowserDocumentPrivate.h:
            * BrowserWindowController.h:
            * BrowserWindowController.m:
            (-[BrowserWindowController frameLoadCommitted:]): switch to default icon
            (-[BrowserWindowController mouseDownInRightButton:]):
            (-[BrowserWindowController setPageIcon:]): added
            * LocationChangeHandler.m:
            (-[LocationChangeHandler receivedPageIcon:forDataSource:]): added
            * LocationTextField.h:
            * LocationTextField.m:
            (-[LocationTextField setDisplayAttributes]):
            (-[LocationTextField setIcon:]): set the icon size to 16x16
            * Resources/Images/url_icon.tiff: Removed.
            * TextFieldWithControls.h:
            * TextFieldWithControls.m: renamed _completeImage to _backgroundImage
            (-[TextFieldWithControls dealloc]):
            (-[TextFieldWithControls backgroundImage]):
            (-[TextFieldWithControls setFrameSize:]):
            (-[TextFieldWithControls showRightButton:]):
            (-[TextFieldWithControls setLeftCapImage:]):
            (-[TextFieldWithControls setRightCapImage:]):
            (-[TextFieldWithControls setMiddleImage:]):
            (-[TextFieldWithControls setLeftButtonImage:withOrigin:]):
            (-[TextFieldWithControls setRightButtonImage:withOrigin:]):
            * WebBrowser.pbproj/project.pbxproj:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1600 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 50c7979..791527d 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,15 @@
+2002-07-19  Chris Blumenberg  <cblu at apple.com>
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process): added an APPLE_CHANGES
+        * khtml/khtml_part.cpp: 
+        (KHTMLPart::loadIcon): added
+        * khtml/khtml_part.h: added loadIcon
+        * kwq/KWQKHTMLPartImpl.h: added loadIcon
+        * kwq/KWQKHTMLPartImpl.mm: added loadIcon
+        (KWQKHTMLPartImpl::loadIcon):
+        * kwq/WebCoreBridge.h: added loadIcon
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
         * khtml/css/makeprop: Fail if we don't find gperf.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 50c7979..791527d 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,15 @@
+2002-07-19  Chris Blumenberg  <cblu at apple.com>
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process): added an APPLE_CHANGES
+        * khtml/khtml_part.cpp: 
+        (KHTMLPart::loadIcon): added
+        * khtml/khtml_part.h: added loadIcon
+        * kwq/KWQKHTMLPartImpl.h: added loadIcon
+        * kwq/KWQKHTMLPartImpl.mm: added loadIcon
+        (KWQKHTMLPartImpl::loadIcon):
+        * kwq/WebCoreBridge.h: added loadIcon
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
         * khtml/css/makeprop: Fail if we don't find gperf.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 50c7979..791527d 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,15 @@
+2002-07-19  Chris Blumenberg  <cblu at apple.com>
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process): added an APPLE_CHANGES
+        * khtml/khtml_part.cpp: 
+        (KHTMLPart::loadIcon): added
+        * khtml/khtml_part.h: added loadIcon
+        * kwq/KWQKHTMLPartImpl.h: added loadIcon
+        * kwq/KWQKHTMLPartImpl.mm: added loadIcon
+        (KWQKHTMLPartImpl::loadIcon):
+        * kwq/WebCoreBridge.h: added loadIcon
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
         * khtml/css/makeprop: Fail if we don't find gperf.
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index c0d0d31..79a3c6d 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -163,8 +163,13 @@ void HTMLLinkElementImpl::process()
     KHTMLPart* part = getDocument()->view() ? getDocument()->view()->part() : 0;
 
     // IE extension: location of small icon for locationbar / bookmarks
+#ifdef APPLE_CHANGES
+    if ( part && rel.contains("icon") && !m_url.isEmpty() && !part->parentPart())
+        part->loadIcon( KURL(m_url.string()) );
+#else
     if ( part && rel.contains("shortcut icon") && !m_url.isEmpty() && !part->parentPart())
-        part->browserExtension()->setIconURL( KURL(m_url.string()) );
+    	part->browserExtension()->setIconURL( KURL(m_url.string()) );
+#endif
 
     // Stylesheet
     if(type.contains("text/css") || rel == "stylesheet" || rel.contains("alternate")) {
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 49deaa3..563c8f7 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -4682,6 +4682,11 @@ void KHTMLPart::detachView()
     impl->setView(0);
 }
 
+void KHTMLPart::loadIcon(const KURL &url)
+{
+    impl->loadIcon(url);
+}
+
 #endif
 
 using namespace KParts;
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index c9beae6..d4b64b0 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -1095,7 +1095,7 @@ public:
   void setTitle(const DOM::DOMString &);
   void detachView(); 
   void setStatusBarText(const QString &);
- 
+  void loadIcon(const KURL &url);
   KWQKHTMLPartImpl *impl;
   friend class KWQKHTMLPartImpl;
 #endif
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 3a657ae..a33ccc9 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -60,7 +60,7 @@ public:
 
     void setTitle(const DOM::DOMString &);
     void setStatusBarText(const QString &status);
-
+    void loadIcon(const KURL &url);
     QString documentSource() const;
 
     bool frameExists(const QString &frameName);
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 25f75c7..791caa9 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -733,3 +733,8 @@ void KWQKHTMLPartImpl::overURL( const QString &url, const QString &target, int m
   
   setStatusBarText(QString::fromNSString([NSString stringWithFormat:format, url.getNSString()]));
 }
+
+void KWQKHTMLPartImpl::loadIcon(const KURL &url)
+{
+    [bridge loadIcon:url.getNSURL()];
+}
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 3a657ae..a33ccc9 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -60,7 +60,7 @@ public:
 
     void setTitle(const DOM::DOMString &);
     void setStatusBarText(const QString &status);
-
+    void loadIcon(const KURL &url);
     QString documentSource() const;
 
     bool frameExists(const QString &frameName);
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 25f75c7..791caa9 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -733,3 +733,8 @@ void KWQKHTMLPartImpl::overURL( const QString &url, const QString &target, int m
   
   setStatusBarText(QString::fromNSString([NSString stringWithFormat:format, url.getNSString()]));
 }
+
+void KWQKHTMLPartImpl::loadIcon(const KURL &url)
+{
+    [bridge loadIcon:url.getNSURL()];
+}
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index ee70d9a..3643691 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -124,6 +124,8 @@ typedef khtml::RenderPart KHTMLRenderPart;
 - (void)setTitle:(NSString *)title;
 - (void)setStatusText:(NSString *)status;
 
+- (void)loadIcon:(NSURL *)url;
+
 - (BOOL)createChildFrameNamed:(NSString *)frameName
     withURL:(NSURL *)URL renderPart:(KHTMLRenderPart *)renderPart
     allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 2ab07aa..fa36247 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,38 @@
+2002-07-19  Chris Blumenberg  <cblu at apple.com>
+
+	Added support favicons.
+
+        * Misc.subproj/WebIconLoader.h: Added.
+        * Misc.subproj/WebIconLoader.m: Added.
+        (-[WebIconLoaderPrivate dealloc]):
+        (+[WebIconLoader defaultIcon]):
+        (-[WebIconLoader initWithURL:]):
+        (-[WebIconLoader dealloc]):
+        (-[WebIconLoader setDelegate:]):
+        (-[WebIconLoader startLoading]):
+        (-[WebIconLoader startLoadingOnlyFromCache]):
+        (-[WebIconLoader stopLoading]):
+        (-[WebIconLoader WebResourceHandleDidBeginLoading:]):
+        (-[WebIconLoader WebResourceHandleDidCancelLoading:]):
+        (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]):
+        (-[WebIconLoader WebResourceHandle:resourceDataDidBecomeAvailable:]):
+        (-[WebIconLoader WebResourceHandle:resourceDidFailLoadingWithResult:]):
+        (-[WebIconLoader WebResourceHandle:didRedirectToURL:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadIcon:]): added
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _loadPageIconIfNecessary]): added
+        (-[WebDataSource _setPrimaryLoadComplete:]): start loading icon
+        (-[WebDataSource _stopLoading]): stop icon loader
+        (-[WebDataSource receivedPageIcon:]): added
+        (-[WebDataSource _loadIcon:]): added
+        * WebView.subproj/WebLocationChangeHandler.h:
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
         * WebKit.pbproj/project.pbxproj: Forgot to export WebKitStatistics.h so it can
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 2ab07aa..fa36247 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,38 @@
+2002-07-19  Chris Blumenberg  <cblu at apple.com>
+
+	Added support favicons.
+
+        * Misc.subproj/WebIconLoader.h: Added.
+        * Misc.subproj/WebIconLoader.m: Added.
+        (-[WebIconLoaderPrivate dealloc]):
+        (+[WebIconLoader defaultIcon]):
+        (-[WebIconLoader initWithURL:]):
+        (-[WebIconLoader dealloc]):
+        (-[WebIconLoader setDelegate:]):
+        (-[WebIconLoader startLoading]):
+        (-[WebIconLoader startLoadingOnlyFromCache]):
+        (-[WebIconLoader stopLoading]):
+        (-[WebIconLoader WebResourceHandleDidBeginLoading:]):
+        (-[WebIconLoader WebResourceHandleDidCancelLoading:]):
+        (-[WebIconLoader WebResourceHandleDidFinishLoading:data:]):
+        (-[WebIconLoader WebResourceHandle:resourceDataDidBecomeAvailable:]):
+        (-[WebIconLoader WebResourceHandle:resourceDidFailLoadingWithResult:]):
+        (-[WebIconLoader WebResourceHandle:didRedirectToURL:]):
+        * WebCoreSupport.subproj/WebBridge.m:
+        (-[WebBridge loadIcon:]): added
+        * WebKit.pbproj/project.pbxproj:
+        * WebView.subproj/WebControllerPrivate.m:
+        (-[WebController _mainReceivedError:forResourceHandle:partialProgress:fromDataSource:]):
+        * WebView.subproj/WebDataSourcePrivate.h:
+        * WebView.subproj/WebDataSourcePrivate.m:
+        (-[WebDataSourcePrivate dealloc]):
+        (-[WebDataSource _loadPageIconIfNecessary]): added
+        (-[WebDataSource _setPrimaryLoadComplete:]): start loading icon
+        (-[WebDataSource _stopLoading]): stop icon loader
+        (-[WebDataSource receivedPageIcon:]): added
+        (-[WebDataSource _loadIcon:]): added
+        * WebView.subproj/WebLocationChangeHandler.h:
+
 2002-07-19  Darin Adler  <darin at apple.com>
 
         * WebKit.pbproj/project.pbxproj: Forgot to export WebKitStatistics.h so it can
diff --git a/WebKit/Misc.subproj/WebIconLoader.h b/WebKit/Misc.subproj/WebIconLoader.h
new file mode 100644
index 0000000..1151fd4
--- /dev/null
+++ b/WebKit/Misc.subproj/WebIconLoader.h
@@ -0,0 +1,32 @@
+//
+//  WebIconLoader.h
+//  WebKit
+//
+//  Created by Chris Blumenberg on Thu Jul 18 2002.
+//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+
+ at class WebDataSource;
+ at class WebResourceHandle;
+ at class WebIconLoaderPrivate;
+ at protocol WebResourceClient;
+
+ at interface NSObject(WebIconLoaderDelegate)
+- (void)receivedPageIcon:(NSImage *)image;
+ at end;
+
+ at interface WebIconLoader : NSObject <WebResourceClient>
+{
+    WebIconLoaderPrivate *_private;
+}
+
++ (NSImage *)defaultIcon;
+
+- initWithURL:(NSURL *)iconURL;
+- (void)setDelegate:(id)delegate;
+- (void)startLoading;
+- (void)startLoadingOnlyFromCache;
+- (void)stopLoading;
+ at end
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
new file mode 100644
index 0000000..56523a2
--- /dev/null
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -0,0 +1,117 @@
+//
+//  WebIconLoader.m
+//  WebKit
+//
+//  Created by Chris Blumenberg on Thu Jul 18 2002.
+//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+//
+
+#import <WebKit/WebIconLoader.h>
+
+#import <WebFoundation/WebFoundation.h>
+#import <WebFoundation/WebNSURLExtras.h>
+
+ at interface WebIconLoaderPrivate : NSObject
+{
+ at public
+    WebResourceHandle *resourceHandle;
+    id delegate;
+    NSURL *url;
+}
+
+ at end;
+
+ at implementation WebIconLoaderPrivate
+
+- (void)dealloc
+{
+    [url release];
+    [resourceHandle release];
+    [super dealloc];
+}
+
+ at end;
+
+ at implementation WebIconLoader
+
++ (NSImage *)defaultIcon
+{
+    return [NSImage imageNamed:@"url_icon"];
+}
+
+- initWithURL:(NSURL *)iconURL
+{
+    [super init];
+    _private = [[WebIconLoaderPrivate alloc] init];
+    _private->url = [iconURL retain];
+    return self;
+}
+
+- (void)dealloc
+{
+    [_private release];
+    [super dealloc];
+}
+
+- (void)setDelegate:(id)delegate
+{
+    _private->delegate = delegate;
+}
+
+- (void)startLoading
+{
+    if([_private->url isFileURL]){
+        NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
+        [_private->delegate receivedPageIcon:[workspace iconForFile:[_private->url path]]];
+    }else{
+        _private->resourceHandle = [[WebResourceHandle alloc] initWithURL:_private->url];
+        [_private->resourceHandle addClient:self];
+        [_private->resourceHandle loadInBackground];
+    }
+}
+
+- (void)startLoadingOnlyFromCache
+{
+    [self startLoading];
+}
+
+- (void)stopLoading
+{
+    [_private->resourceHandle cancelLoadInBackground];
+}
+
+- (void)WebResourceHandleDidBeginLoading:(WebResourceHandle *)sender
+{
+
+}
+
+- (void)WebResourceHandleDidCancelLoading:(WebResourceHandle *)sender
+{
+
+}
+
+- (void)WebResourceHandleDidFinishLoading:(WebResourceHandle *)sender data:(NSData *)data
+{
+    NSImage *image = [[NSImage alloc] initWithData:data];
+    if(image){
+        [_private->delegate receivedPageIcon:[image autorelease]];
+    }
+}
+
+
+- (void)WebResourceHandle:(WebResourceHandle *)sender resourceDataDidBecomeAvailable:(NSData *)data
+{
+
+}
+
+- (void)WebResourceHandle:(WebResourceHandle *)sender resourceDidFailLoadingWithResult:(WebError *)result
+{
+
+}
+
+- (void)WebResourceHandle:(WebResourceHandle *)sender didRedirectToURL:(NSURL *)url
+{
+
+}
+
+ at end
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 06a61c9..cc80a8a 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -230,4 +230,9 @@
     return [WebHTMLView _modifierTrackingEnabled];
 }
 
+- (void)loadIcon:(NSURL *)url
+{
+    [dataSource _loadIcon:url];
+}
+
 @end
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 57261ae..11e760a 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -262,6 +262,7 @@
 				F508472402DED36E01257167,
 				F53444D002E87CBA018635CA,
 				F53444D302E87D4B018635CA,
+				F5934C8A02E894F50197FBCF,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -341,6 +342,7 @@
 				F5488CF702CB04EE01FF6274,
 				F508472502DED36E01257167,
 				F53444D102E87CBA018635CA,
+				F5934C8B02E894F50197FBCF,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -407,16 +409,18 @@
 				F5FBAB9002B88CBF01FF6074,
 				3944607A020F50ED0ECA1767,
 				3944607B020F50ED0ECA1767,
+				F5934C8802E894F50197FBCF,
+				F5934C8902E894F50197FBCF,
+				2568C72C0174912D0ECA149E,
+				25A5593101A5996D0ECA149E,
+				25A5593201A5996D0ECA149E,
+				F5927D4E02D26C5E01CA2DBB,
+				F5C283730284676D018635CA,
+				25C29825016E29620ECA149E,
 				F508946902B71D59018A9CD4,
 				F508946A02B71D59018A9CD4,
 				F59668C802AD2923018635CA,
 				F59668C902AD2923018635CA,
-				F5927D4E02D26C5E01CA2DBB,
-				2568C72C0174912D0ECA149E,
-				25C29825016E29620ECA149E,
-				F5C283730284676D018635CA,
-				25A5593101A5996D0ECA149E,
-				25A5593201A5996D0ECA149E,
 			);
 			isa = PBXGroup;
 			name = "Other Sources";
@@ -1669,6 +1673,30 @@
 				);
 			};
 		};
+		F5934C8802E894F50197FBCF = {
+			isa = PBXFileReference;
+			name = WebIconLoader.h;
+			path = Misc.subproj/WebIconLoader.h;
+			refType = 4;
+		};
+		F5934C8902E894F50197FBCF = {
+			isa = PBXFileReference;
+			name = WebIconLoader.m;
+			path = Misc.subproj/WebIconLoader.m;
+			refType = 4;
+		};
+		F5934C8A02E894F50197FBCF = {
+			fileRef = F5934C8802E894F50197FBCF;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		F5934C8B02E894F50197FBCF = {
+			fileRef = F5934C8902E894F50197FBCF;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		F59668C802AD2923018635CA = {
 			isa = PBXFileReference;
 			name = WebStringTruncator.h;
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 793c77f..4eb81a4 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -132,9 +132,9 @@
 
     [[self resourceProgressHandler] receivedError: error forResourceHandle: resourceHandle partialProgress: progress fromDataSource: dataSource];
     
+    [dataSource _setMainDocumentError: error];
     [dataSource _setPrimaryLoadComplete: YES];
 
-    [dataSource _setMainDocumentError: error];
     [frame _checkLoadComplete];
 }
 
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 96264e3..8f6e31f 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -10,6 +10,7 @@
 #import <WebKit/WebLocationChangeHandler.h>
 #import <WebKit/WebBridge.h>
 
+ at class WebIconLoader;
 @class WebResourceHandle;
 @class WebMainResourceClient;
 @protocol WebLocationChangeHandler;
@@ -70,6 +71,8 @@
 
     BOOL gotFirstByte; // got first byte
     BOOL committed; // This data source has been committed
+    
+    WebIconLoader *iconLoader;
 }
 
 @end
@@ -103,6 +106,7 @@
 + (NSMutableDictionary *)_repTypes;
 + (BOOL)_canShowMIMEType:(NSString *)MIMEType;
 - (void)_removeFromFrame;
+- (void)_loadIcon:(NSURL *)url;
 
 // Convenience interface for getting here from an WebDataSource.
 // This returns nil if the representation is not an WebHTMLRepresentation.
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 6e759b4..290bc8d 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -12,6 +12,7 @@
 #import <WebKit/WebException.h>
 #import <WebKit/WebHTMLRepresentation.h>
 #import <WebKit/WebHTMLViewPrivate.h>
+#import <WebKit/WebIconLoader.h>
 #import <WebKit/WebImageRepresentation.h>
 #import <WebKit/WebLocationChangeHandler.h>
 #import <WebKit/WebMainResourceClient.h>
@@ -72,7 +73,9 @@
     [errors release];
     [mainDocumentError release];
     [locationChangeHandler release];
-
+    [iconLoader setDelegate:nil];
+    [iconLoader release];
+    
     [super dealloc];
 }
 
@@ -134,10 +137,29 @@
     _private->parent = p;
 }
 
+- (void)_loadPageIconIfNecessary
+{
+    // Start loading the page icon from the server's root directory 
+    // since no page icon has already been requested with the LINK tag
+    if(!_private->iconLoader && !_private->mainDocumentError){
+        NSURL *dataSourceURL = [self wasRedirected] ? [self redirectedURL] : [self inputURL];
+        NSURL *iconURL;
+        
+        if([dataSourceURL isFileURL]){
+            iconURL = dataSourceURL;
+        } else {
+            iconURL = [NSURL _web_URLWithString:@"favicon.ico" relativeToURL:[dataSourceURL absoluteURL]];
+        }
+        [self _loadIcon:iconURL];
+    }
+}
+
 - (void)_setPrimaryLoadComplete: (BOOL)flag
 {
     _private->primaryLoadComplete = flag;
+    
     if (flag) {
+        [self _loadPageIconIfNecessary];
         [_private->mainURLHandleClient release];
         _private->mainURLHandleClient = 0; 
         [_private->mainHandle autorelease];
@@ -146,6 +168,7 @@
     }
 }
 
+
 - (void)_startLoading: (BOOL)forceRefresh
 {
     WEBKIT_ASSERT ([self _isStopping] == NO);
@@ -213,6 +236,8 @@
     if (_private->committed) {
 	[[self _bridge] closeURL];        
     }
+
+    [_private->iconLoader stopLoading];
 }
 
 - (void)_recursiveStopLoading
@@ -462,4 +487,19 @@
     [[[[self webFrame] webView] documentView] dataSourceUpdated:self];
 }
 
+- (void)receivedPageIcon:(NSImage *)image
+{
+    [_private->locationChangeHandler receivedPageIcon:image forDataSource:self];
+}
+
+- (void)_loadIcon:(NSURL *)url
+{
+    WEBKIT_ASSERT(!_private->iconLoader);
+    
+    if([self isMainDocument]){
+        _private->iconLoader = [[WebIconLoader alloc] initWithURL:url];
+        [_private->iconLoader setDelegate:self];
+        [_private->iconLoader startLoading];
+    }
+}
 @end
diff --git a/WebKit/WebView.subproj/WebFrameLoadDelegate.h b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
index f98a2a0..e82bd71 100644
--- a/WebKit/WebView.subproj/WebFrameLoadDelegate.h
+++ b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
@@ -43,6 +43,8 @@
 
 - (void)receivedPageTitle: (NSString *)title forDataSource: (WebDataSource *)dataSource;
 
+- (void)receivedPageIcon: (NSImage *)image forDataSource: (WebDataSource *)dataSource;
+
 - (void)serverRedirectTo: (NSURL *)url forDataSource: (WebDataSource *)dataSource;
 
 @end
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.h b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
index f98a2a0..e82bd71 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.h
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
@@ -43,6 +43,8 @@
 
 - (void)receivedPageTitle: (NSString *)title forDataSource: (WebDataSource *)dataSource;
 
+- (void)receivedPageIcon: (NSImage *)image forDataSource: (WebDataSource *)dataSource;
+
 - (void)serverRedirectTo: (NSURL *)url forDataSource: (WebDataSource *)dataSource;
 
 @end
diff --git a/WebKit/WebView.subproj/WebLocationChangeHandler.h b/WebKit/WebView.subproj/WebLocationChangeHandler.h
index f98a2a0..e82bd71 100644
--- a/WebKit/WebView.subproj/WebLocationChangeHandler.h
+++ b/WebKit/WebView.subproj/WebLocationChangeHandler.h
@@ -43,6 +43,8 @@
 
 - (void)receivedPageTitle: (NSString *)title forDataSource: (WebDataSource *)dataSource;
 
+- (void)receivedPageIcon: (NSImage *)image forDataSource: (WebDataSource *)dataSource;
+
 - (void)serverRedirectTo: (NSURL *)url forDataSource: (WebDataSource *)dataSource;
 
 @end
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 793c77f..4eb81a4 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -132,9 +132,9 @@
 
     [[self resourceProgressHandler] receivedError: error forResourceHandle: resourceHandle partialProgress: progress fromDataSource: dataSource];
     
+    [dataSource _setMainDocumentError: error];
     [dataSource _setPrimaryLoadComplete: YES];
 
-    [dataSource _setMainDocumentError: error];
     [frame _checkLoadComplete];
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list