[PATCH] favicons with rel="icon"

Alexander Kellett kelletta at eidetica.com
Sun Jun 23 17:15:00 BST 2002


Hiya all,

I just noticed that khtml doesn't support the <link> favicon on 
mozilla.org (among other sites) and checking out the source found
that it uses (rel="icon"), as compared to khtml which looks for 
the IE extension (rel="shortcut icon").

Here's a patch to fix it.

Though i'm not sure if rather than contains("icon"), it should use
rel.stripWhitespace (== "icon" || == "shortcut icon"). 

Alex
-------------- next part --------------
? favicon.diff
Index: html/html_headimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_headimpl.cpp,v
retrieving revision 1.90
diff -u -p -r1.90 html_headimpl.cpp
--- html/html_headimpl.cpp	2002/02/14 22:14:29	1.90
+++ html/html_headimpl.cpp	2002/06/23 16:10:58
@@ -163,7 +163,9 @@ void HTMLLinkElementImpl::process()
     KHTMLPart* part = getDocument()->view() ? getDocument()->view()->part() : 0;
 
     // IE extension: location of small icon for locationbar / bookmarks
-    if ( part && rel.contains("shortcut icon") && !m_url.isEmpty() && !part->parentPart())
+    // Uses both "shortcut icon" and "icon"
+   
+    if ( part && rel.contains("icon") && !m_url.isEmpty() && !part->parentPart())
         part->browserExtension()->setIconURL( KURL(m_url.string()) );
 
     // Stylesheet


More information about the kfm-devel mailing list