W3C home > Mailing lists > Public > public-html@w3.org > July 2009

Image maps: <a coords=""> - a new look

From: Leif Halvard Silli <lhs@malform.no>
Date: Thu, 16 Jul 2009 05:02:30 +0200
Message-ID: <4A5E9846.6060003@malform.no>
To: HTMLWG <public-html@w3.org>
CC: scampa.giovanni@gmail.com
<a coords=""> was apparently dropped in 2005  [1].  Now, a bug report 
has been filed to get  <a coords=""> added to HTML 5 again. [2]

A. The debate in the WHATwg group in 2005 acknowledged that both Opera 
and Firefox supports <a coords=""> and that it, thus, meets the CR 
criteria. [3] But the argument against keeping <a coords=""> was lack of 
support in IE6 and little use as well (due to IE6, we may assume).  
However, a few things happened  since April 2005. E.g. both IE7 and IE8 
have been released.

B. IE8 has got proper support for <object data="image">. Thus, with IE8, 
Anne in theory has a reason to support <a coords="">, so he can do this[4]:

    <object data="foo" usemap="#foo">
       <map id="foo">
            <a coords="..." href="...">...</a>

   (Safari doesn't seem to support image maps with the <object>, though 
...  - another of its many OBJECT anomalies ...)

C. Unfortunately, IE8 still does not support <a coords="">. So, for IE8 
support, one must still use the workaround that Ian proposed for IE6 
(and which works even better with IE8!) - namely, to use both elements 
simultaneously: [5]

       <map id="foo">
            <area coords="..." href="..."><a href="...">...</a>

D. There is a problem with this workaround, though: While the exact 
construct above works fine,  it actually stops working in Firefox if you 
place the <area> /after/ the <a> element. This is a bug/fact/issue that 
is difficult to communicate or understand. So this doesn't work in Firefox:

       <map id="foo">
            <a href="...">...</a><area coords="..." href="...">

   (Firefox' problem seems to be that it sees <area> as child of <a>, 
even if it is its sibling. We can take advantage of this fact and 
actually _permit_ <area> as child of <a coords=""> - see below.)

E. Another problem with the same workaround is that it doesn't allow you 
to drop the @alt attribute of the <area> element -  an empty or 
non-empty @alt attribute must be offered in order to be able to produce 
valid HTML code.


If we allow <area> as child of <a coords="">,

       <map id="foo">
          <a coords="..." href="..."><area coords="..." href="..."> ...</a>

then we have a solution which  is

     - Firefox compatible.
     - easier to communicate
     - in line with the HTML 5 pattern to allow <a> around  almost any 
     - a logical solution to the @alt attribute problem:   when <area> 
is kept inside <a coords="">,  then one should be permitted to drop the 
@alt attribute.
     - a transition construct towards the goal that _all_ UAs support <a 
coords=""> - any UA that understand <a coords=""> should ignore the 
nested <area> element (as both Opera and Firefox do).
     - "a better design because it has automatic full fallback" - 
without the use of @alt attribute. [6]

[2] http://www.w3.org/Bugs/Public/show_bug.cgi?id=7076
leif halvard silli
Received on Thursday, 16 July 2009 03:03:11 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:15:48 UTC