<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>18680</bug_id>
          
          <creation_ts>2008-04-22 13:24:48 -0700</creation_ts>
          <short_desc>Favicon won&apos;t load when link tag preceded by script tag</short_desc>
          <delta_ts>2008-04-23 19:21:21 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Simpson">simpsora</reporter>
          <assigned_to name="Brady Eidson">beidson</assigned_to>
          <cc>beidson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78563</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Simpson">simpsora</who>
    <bug_when>2008-04-22 13:24:48 -0700</bug_when>
    <thetext>When referencing a favorite icon (favicon) via a link tag, Webkit doesn&apos;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&apos;s a script block with inline script, the problem doesn&apos;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&apos;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)
&lt;!ENTITY % head.misc &quot;(script|style|meta|link|object|isindex)*&quot;&gt;

&lt;!-- content model is %head.misc; combined with a single
     title and an optional base element in any order --&gt;

&lt;!ELEMENT head (%head.misc;,
     ((title, %head.misc;, (base, %head.misc;)?) |
      (base, %head.misc;, (title, %head.misc;))))&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78564</commentid>
    <comment_count>1</comment_count>
      <attachid>20754</attachid>
    <who name="Ross Simpson">simpsora</who>
    <bug_when>2008-04-22 13:28:18 -0700</bug_when>
    <thetext>Created attachment 20754
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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78569</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-04-22 13:47:55 -0700</bug_when>
    <thetext>&lt;rdar://problem/5881376&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78570</commentid>
    <comment_count>3</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2008-04-22 13:50:32 -0700</bug_when>
    <thetext>This is in Radar already, as an example of a real-world site
&lt;rdar://problem/5733282&gt; No favicon at washingtonindependent.com
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78724</commentid>
    <comment_count>4</comment_count>
    <who name="Brady Eidson">beidson</who>
    <bug_when>2008-04-23 19:06:20 -0700</bug_when>
    <thetext>This was fixed in r32413</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78726</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Simpson">simpsora</who>
    <bug_when>2008-04-23 19:21:21 -0700</bug_when>
    <thetext>I confirm r32416 fixes both my testcase and my real-world page (and washingtonindependent.com too :))

Thanks.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>20754</attachid>
            <date>2008-04-22 13:28:18 -0700</date>
            <delta_ts>2008-04-22 13:28:18 -0700</delta_ts>
            <desc>Simple testcase exhibiting broken favicon</desc>
            <filename>favicon_testcase.html</filename>
            <type>text/html</type>
            <size>447</size>
            <attacher name="Ross Simpson">simpsora</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25h
bC5kdGQiPgo8aHRtbCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCIgeG1sOmxh
bmc9ImVuIiBsYW5nPSJlbiI+CiAgICA8aGVhZD4KICAgICAgICA8dGl0bGU+U2FmYXJpIGZhdmlj
b24gdGVzdDwvdGl0bGU+CiAgICAgICAgPHNjcmlwdCB0eXBlPSd0ZXh0L2phdmFzY3JpcHQnIHNy
Yz0nbWlzc2luZy5qcyc+PC9zY3JpcHQ+CiAgICAgICAgPGxpbmsgcmVsPSdzaG9ydGN1dCBpY29u
JyBocmVmPSdodHRwOi8vd3d3Lmdvb2dsZS5jb20vZmF2aWNvbi5pY28nIHR5cGU9J2ltYWdlL3gt
aWNvbicgLz4KICAgIDwvaGVhZD4KCiAgICA8Ym9keT48L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>