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

Lachlan Hunt lachlan.hunt at lachy.id.au
Thu May 1 01:05:27 PDT 2008


Martin Atkins wrote:
> Lachlan Hunt wrote:
>> Martin Atkins wrote:
>>> Could this be said about size as well?
>>>
>>> <link type="image/png"
>>>       media="all and (max-width:16px and max-height:16px)">
>>
>> No, because the media queries are related to the actual tech specs of 
>> the device, not the image.  I'm fairly sure there are no 16x16px 
>> screens in use, at least not for the web.  To get appropriate 
>> behaviour for what you're suggesting here would require redefining and 
>> special casing media queries.
>
> When I shrink my browser window down so that its viewport is 16x16px 
> (assuming that it'd let me do such a thing) it's quite happy to apply a 
> stylesheet with the above media query. It seems, therefore, that the 
> "width" and "height" constraints relate to the rendering viewport and 
> not to the device.

Yes, I meant "device and viewport" above.  But even if you want to apply 
this to a special icon viewport, it still wouldn't work as you expect, 
because what we need is something that describes the properties of the 
image, not the properties of viewport it's being rendered in.

Given a UA that can display any icon size up to, e.g., 128px square, the 
above media query wouldn't match.  But what if the author only provided 
icons up to 64x64px, then no media query would match and no icon would 
be used.  However, for this use case, the UA would need to pick the 
highest quality image that is suitable for the environment.

You couldn't eve get away with using min-width/height here, because UAs 
generally stretch and scew icons to fit the necessary size, and say a 
60x60 icon provided, and specified as:

   "all and (min-width:60px) and (min-height:60px)"

Then the iPhone, for example, wouldn't pick it because it needs 59x60. 
Where there isn't a perfect size available, the UA needs to be able to 
pick one that is slightly smaller or larger and stretch it to fit.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/



More information about the whatwg mailing list