RESOLVED FIXED 18680
Favicon won't load when link tag preceded by script tag
https://bugs.webkit.org/show_bug.cgi?id=18680
Summary Favicon won't load when link tag preceded by script tag
Ross Simpson
Reported 2008-04-22 13:24:48 PDT
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: (from http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd) <!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;))))>
Attachments
Simple testcase exhibiting broken favicon (447 bytes, text/html)
2008-04-22 13:28 PDT, Ross Simpson
no flags
Ross Simpson
Comment 1 2008-04-22 13:28:18 PDT
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.
Mark Rowe (bdash)
Comment 2 2008-04-22 13:47:55 PDT
Brady Eidson
Comment 3 2008-04-22 13:50:32 PDT
This is in Radar already, as an example of a real-world site <rdar://problem/5733282> No favicon at washingtonindependent.com
Brady Eidson
Comment 4 2008-04-23 19:06:20 PDT
This was fixed in r32413
Ross Simpson
Comment 5 2008-04-23 19:21:21 PDT
I confirm r32416 fixes both my testcase and my real-world page (and washingtonindependent.com too :)) Thanks.
Note You need to log in before you can comment on or make changes to this bug.