Re: Implementation Query: <MAP> with mixed <AREA> <A> !?

Ian Hickson wrote:
> 
> When trying to implement client side image maps in Mozilla, we have hit a
> problem.
> 
> The following is valid XHTML:
> 
>    <p><img src="x" alt="text" usemap="#map" /></p>
>    <map id="map">
>       <p><a href="#a" shape="rect" coords="10,10,20,20">A</a></p>
>       <area href="#b" shape="rect" coords="30,30,40,40">B</area>
>    </map>
> 
> But, assuming images are disabled or the UA does not support images,
> how should the above be rendered?

I suggest the following:

1) Render the content as you would outside of a MAP. 
2) Convert the AREA to an A element whose link text is value of the
   the *mandatory* "alt" attribute.
 
> I need to know what the expected behaviour as we are currently trying
> to implement this in Mozilla.

The expected behavior in HTML 4.01 is to render body content. From [1]:

<BLOCKQUOTE>
The MAP element content model allows authors to combine the following:

      1.One or more AREA elements. These elements have no content but
specify the 
        geometric regions of the image map and the link associated with
each region. 
        Note that user agents do not generally render AREA elements.
        Therefore, authors must provide alternate text for each AREA
with the alt
        attribute (see below for information on  how to specify
alternate text). 

      2.Block-level content. This content should include A elements that
specify the 
        geometric regions of the image map and the link associated with
each region. 
        Note that the user agent may render block-level content of a MAP
        element. Authors should use this method to create more
accessible documents. 
</BLOCKQUOTE>

For bullet two, the HTML WG decided to change "may" to "should" (for the
rendering
part) after the document became a Proposed Recommendation. This change
will
appear in subsequent drafts.

[1] http://www.w3.org/TR/html40/struct/objects.html#h-13.6.1

> With the content model of MAP in HTML4 this was not an issue, since in
> that case AREAs and other content could not be mixed in MAP elements.
> Previously, if the MAP contained only AREA elements then the AREA elements
> would be turned into a menu and would replace the IMG altogether, and if
> the MAP contained mix content then the IMG would be replaced by its alt
> text, made inert, and the MAP would be renderered inline where it appeared
> in the document.

Please let me know if this answers your question and is feasible,

 - Ian


-- 
Ian Jacobs (jacobs@w3.org)   http://www.w3.org/People/Jacobs
Tel/Fax:                     +1 212 684-1814
Cell:                        +1 917 450-8783

Received on Monday, 25 October 1999 08:34:54 UTC