W3C home > Mailing lists > Public > public-html-a11y@w3.org > October 2011

Question for the Task Force on Site/fav Icons

From: Kelly Ford <Kelly.Ford@microsoft.com>
Date: Tue, 11 Oct 2011 22:54:00 +0000
To: "public-html-a11y@w3.org" <public-html-a11y@w3.org>
Message-ID: <FDD93DBB2C16D643AABC1A7111D149F32DFA5B67@TK5EX14MBXW603.wingroup.windeploy.ntdev.microsoft.com>

I wanted to bring an issue up to the task force related to site icons or favicons and the HTML5 spec.  These are the icons that sites can use to represent themselves and that browsers then show in various locations within the user interface to represent the site in question.  This concept is not new to HTML5.

I've listed what I believe is the current HTML5 spec text for such icons below.

If a user agent wanted to expose this icon for accessibility purposes programmatically, it doesn't seem that there is currently a mechanism to allow the author to supply a desired name.  Now a user agent could come up with a name based on domain name, page title or some generic solution if desired.  Does the task force think this is an issue that should be raised in HTML5 in some capacity or deligated strictly as a user agent issue to determine or something else, perhaps that I'm missing something?

Kelly Link type "icon"

The icon<http://dev.w3.org/html5/spec/Overview.html#rel-icon> keyword may be used with link<http://dev.w3.org/html5/spec/Overview.html#the-link-element> elements. This keyword creates an external resource link<http://dev.w3.org/html5/spec/Overview.html#external-resource-link>.

The specified resource is an icon representing the page or site, and should be used by the user agent when representing the page in the user interface.

Icons could be auditory icons, visual icons, or other kinds of icons. If multiple icons are provided, the user agent must select the most appropriate icon according to the type<http://dev.w3.org/html5/spec/Overview.html#attr-link-type>, media<http://dev.w3.org/html5/spec/Overview.html#attr-link-media>, and sizes<http://dev.w3.org/html5/spec/Overview.html#attr-link-sizes> attributes. If there are multiple equally appropriate icons, user agents must use the last one declared in tree order<http://dev.w3.org/html5/spec/Overview.html#tree-order> at the time that the user agent collected the list of icons. If the user agent tries to use an icon but that icon is determined, upon closer examination, to in fact be inappropriate (e.g. because it uses an unsupported format), then the user agent must try the next-most-appropriate icon as determined by the attributes.

User agents are not required to update icons when the list of icons changes, but are encouraged to do so.

There is no default type for resources given by the icon<http://dev.w3.org/html5/spec/Overview.html#rel-icon> keyword. However, for the purposes of determining the type of the resource<http://dev.w3.org/html5/spec/Overview.html#concept-link-type-sniffing>, user agents must expect the resource to be an image.

The sizes attribute gives the sizes of icons for visual media. Its value, if present, is merely advisory. User agents may use the value to decide which icon(s) to use if multiple icons are available.

If specified, the attribute must have a value that is an unordered set of unique space-separated tokens<http://dev.w3.org/html5/spec/Overview.html#unordered-set-of-unique-space-separated-tokens> which are ASCII case-insensitive<http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive>. Each value must be either an ASCII case-insensitive<http://dev.w3.org/html5/spec/Overview.html#ascii-case-insensitive> match for the string "any<http://dev.w3.org/html5/spec/Overview.html#attr-link-sizes-any>", or a value that consists of two valid non-negative integers<http://dev.w3.org/html5/spec/Overview.html#valid-non-negative-integer> that do not have a leading U+0030 DIGIT ZERO (0) character and that are separated by a single U+0078 LATIN SMALL LETTER X or U+0058 LATIN CAPITAL LETTER X character.

The keywords represent icon sizes.

To parse and process the attribute's value, the user agent must first split the attribute's value on spaces<http://dev.w3.org/html5/spec/Overview.html#split-a-string-on-spaces>, and must then parse each resulting keyword to determine what it represents.

The any keyword represents that the resource contains a scalable icon, e.g. as provided by an SVG image.

Other keywords must be further parsed as follows to determine what they represent:

*         If the keyword doesn't contain exactly one U+0078 LATIN SMALL LETTER X or U+0058 LATIN CAPITAL LETTER X character, then this keyword doesn't represent anything. Abort these steps for that keyword.

*         Let width string be the string before the "x" or "X".

*         Let height string be the string after the "x" or "X".

*         If either width string or height string start with a U+0030 DIGIT ZERO (0) character or contain any characters other than characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then this keyword doesn't represent anything. Abort these steps for that keyword.

*         Apply the rules for parsing non-negative integers<http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-non-negative-integers> to width string to obtain width.

*         Apply the rules for parsing non-negative integers<http://dev.w3.org/html5/spec/Overview.html#rules-for-parsing-non-negative-integers> to height string to obtain height.

*         The keyword represents that the resource contains a bitmap icon with a width of width device pixels and a height of height device pixels.

The keywords specified on the sizes<http://dev.w3.org/html5/spec/Overview.html#attr-link-sizes> attribute must not represent icon sizes that are not actually available in the linked resource.

In the absence of a link<http://dev.w3.org/html5/spec/Overview.html#the-link-element> with the icon<http://dev.w3.org/html5/spec/Overview.html#rel-icon> keyword, for Document<http://dev.w3.org/html5/spec/Overview.html#document>s obtained over HTTP or HTTPS, user agents may instead attempt to fetch<http://dev.w3.org/html5/spec/Overview.html#fetch> and use an icon with the absolute URL<http://dev.w3.org/html5/spec/Overview.html#absolute-url> obtained by resolving the URL<http://dev.w3.org/html5/spec/Overview.html#url> "/favicon.ico" against the document's address<http://dev.w3.org/html5/spec/Overview.html#the-document-s-address>, as if the page had declared that icon using the icon<http://dev.w3.org/html5/spec/Overview.html#rel-icon> keyword.

The following snippet shows the top part of an application with several icons.




  <title>lsForums - Inbox</title>

  <link rel=icon href=favicon.png sizes="16x16" type="image/png">

  <link rel=icon href=windows.ico sizes="32x32 48x48" type="image/vnd.microsoft.icon">

  <link rel=icon href=mac.icns sizes="128x128 512x512 8192x8192 32768x32768">

  <link rel=icon href=iphone.png sizes="57x57" type="image/png">

  <link rel=icon href=gnome.svg sizes="any" type="image/svg+xml">

  <link rel=stylesheet href=lsforums.css>

  <script src=lsforums.js></script>

  <meta name=application-name content="lsForums">




For historical reasons, the icon<http://dev.w3.org/html5/spec/Overview.html#rel-icon> keyword may be preceded by the keyword "shortcut". If the "shortcut" keyword is present, it must be come immediately before the icon<http://dev.w3.org/html5/spec/Overview.html#rel-icon> keyword and the two keywords must be separated by only a single U+0020 SPACE character.
Received on Tuesday, 11 October 2011 22:54:43 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:24 UTC