When referencing a favorite icon (favicon) via a link tag, Webkit doesn't display the icon in the URL bar (or even try to load the icon) when the link tag is preceded by a script tag in the source. Instead, it reverts to the default behavior of requesting /favicon.ico.
This only happens when the script tag references an external resource with the href attribute. If it's a script block with inline script, the problem doesn't occur. It does not occur when the same script tag appears after the link tag instead of before it. It also does not occur when preceded by a style tag referencing an external resource.
I've tested on the following platforms; they all exhibit the problem:
OS X 10.4.10 (PPC), Safari 2.0.4 (419.3)
OS X 10.5.2 (Intel), Safari 3.1.1 (5525.18)
OS X 10.5.2 (Intel), Nightly r32364
My test case uses XHTML 1.0 Transitional, whose DTD specifies that the order of elements in the head section does not matter:
<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
<!-- content model is %head.misc; combined with a single
title and an optional base element in any order -->
<!ELEMENT head (%head.misc;,
((title, %head.misc;, (base, %head.misc;)?) |
(base, %head.misc;, (title, %head.misc;))))>
Created attachment 20754 [details]
Simple testcase exhibiting broken favicon
Steps to reproduce:
1. Open favicon_testcase in a affected browser.
2. Note that no favicon appears in URL bar.
3. Edit the testcase, remove the script tag, and save.
4. Refresh the testcase, noting that the favicon now appears in the URL bar.
This is in Radar already, as an example of a real-world site
<rdar://problem/5733282> No favicon at washingtonindependent.com
This was fixed in r32413
I confirm r32416 fixes both my testcase and my real-world page (and washingtonindependent.com too :))