[whatwg] <link rel=icon width=

Maciej Stachowiak mjs at apple.com
Mon May 5 12:57:26 PDT 2008

On May 5, 2008, at 10:28 AM, Ernest Cline wrote:

> -----Original Message-----
>> From: Anne van Kesteren <annevk at opera.com>
>> Sent: May 5, 2008 5:27 AM
>> On Sun, 04 May 2008 02:38:03 +0200, Ernest Cline
>> <ernestcline at mindspring.com> wrote:
>>> Perhaps, but it means adding attributes to <link> elements that will
>>> only be needed for a single link type.  If the use case for these
>>> attributes is strong enough to add special purpose attributes for  
>>> use
>>> with only <link rel=icon> then I dare say that it is strong enough  
>>> to
>>> have a special purpose <icon> element so as to keep user agents from
>>> having to deal with nonsense such as <link rel=stylesheet height=32
>>> width=32>
>> <icon> would not be backwards compatible. In some user agents (at  
>> least
>> Opera and Firefox) that would imply a <body> element for instance.
> Would making <icon> an optional content of <title> break backwards  
> compatibility?  The incompatibility problem you mention comes from  
> the start and end tags of both <head> and <body> being optional.   
> That isn't the case for title and it makes sense syntactically to  
> place it there as the icon is part of the identifying information  
> for the document.

<title> is parsed as CDATA, so tags inside it are not processed as  
such, and instead become part of the title. Try opening a document  
containing this to see:

<title><icon src="foo.jpg">This is some fancy title</title>

Thus, putting <icon> in the <title> would look terrible in all  
existing user agents (at least ones that display the title), in  
addition to being a total hack.

In addition, if we add <icon>, UAs will have to parse both <link  
rel="icon"> (since many sites already specify icons this way,  
sometimes 16x16 but sometimes bigger) and the new <icon>, but the old  
way will have no way to specify size data. In fact, if a site has  
icons with sizes from 16x16 up to anything you could reasonably want,  
it will have to link it with <link rel="icon"> to support older  
browsers and then again with <icon> to specify the size data.

So, on further reflection, I think a new <icon> element would be a bad  
way to go.


More information about the whatwg mailing list