[whatwg] <link rel=icon width="" height="">

Maciej Stachowiak mjs at apple.com
Tue Apr 29 22:13:01 PDT 2008

On Apr 29, 2008, at 6:52 PM, Ian Hickson wrote:

> (With my rarely-used Google hat on:)
> The Gears team has an API that allows authors to specify a set of  
> icons:
>   http://code.google.com/apis/gears/upcoming/api_desktop.html
> They used a scripted API, but when I tried to get them to use a
> declarative API, they said that the main reason they used a scripted  
> one
> is that the declarative options didn't have a way to specify  
> dimensions.
> This is a proposal to add "height" and "width" attributes to <link>
> specifically for the case of rel=icon, so that authors can provide
> multiple icons and let the UA decide which to use based on their size
> (without having to download them all to find out which is best).
> Opinions?

I think a way to specify multiple icons at different sizes is a good  
idea. However, I do not think width and height attributes sufficiently  
cover the available options. We need to be able to handle:

1) Scalable vector formats such as SVG or PDF. These work well at any  
size. On some Linux desktop environments, SVG is used as a native icon  

2) Formats that include bitmaps at multiple sizes. These include the  
Windows native ICO format and the Mac OS X native ICNS format. At  
least for Mac OS X, the HI guidelines strongly recommend providing  
multiple sizes for best integration with the system UI. It is possible  
in theory for a UA to download multiple icons at different sizes and  
build a multi-size file, but more network transactions is less  

Therefore, I think it needs to be possible to specify multiple sizes,  
or to specify that an icon is scalable and thus usable at any size.

I would suggest a sizes attribute which can take a list of sizes (with  
x as a width/height separator), or a keyword such as "any" or  
"scalable" to indicate a scalable format suitable for any size.

<link type="icon" type="application/svg" sizes="any" href="whatwg.svg">
<link type="icon" type="image/microsoft.vnd.icon" sizes="16x16 32x32"  
<link type="icon" type="image/x-apple-icons" sizes="16x16 32x32 64x64  
128x128 256x256 512x512" href="whatwg.icns">
<link type="icon" type="image/png" sizes="59x60" href="whatwg.png">


More information about the whatwg mailing list