This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 817 - Image map usemap attribute does not validate
Summary: Image map usemap attribute does not validate
Status: VERIFIED WORKSFORME
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.6.6
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://www.veiled-chameleon.com/xhtml...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-03 21:57 UTC by Jeff
Modified: 2004-07-12 17:28 UTC (History)
0 users

See Also:


Attachments

Description Jeff 2004-07-03 21:57:19 UTC
Please visit the attached URL for a concise description and an example of this 
problem.

In a nutshell: The content of the "usemap" attribute in an image tag MUST 
begin with a "#" character in order for its associated image map to be 
functional. However, the code will NOT validate if the "#" character is 
present.

Googling this problem has resulted in repeated claims that the validator is 
wrong, and that the code with the "#" is valid XHTML 1.1. Can you verify this 
for me, or, barring that, explain how to make the code both validate and 
function properly?

Thank you.
Comment 1 Ville Skyttä 2004-07-04 05:46:46 UTC
Don't trust Google, the validator is correct :)

In XHTML 1.1, usemap is defined as IDREF, and IDREFs cannot start with "#". 
http://www.w3.org/TR/REC-xml/#idref

If you want your image maps to work with mainstream browsers and your documents
to validate, use XHTML 1.0 (see also below).  It defines usemap as CDATA
(through &URI;), and you can happily use usemap="#foo" which, unlike the XHTML
1.1 version usemap="foo", works with most browsers.

XHTML 1.0 is the current de facto recommendation for HTML, by the way; there are
very few if any browsers out there that really support XHTML 1.1. 
http://www.w3.org/TR/html/
Comment 2 gohankid7_7 2004-07-12 13:28:27 UTC
The "#" is not supposed to be used. Mozilla 1.7 correctly uses the image map.
Here is a sample piece of code:

<img style="border-width:0px" src="packages.jpg" alt="packages" usemap="doodles" />

and later:

<map id="doodles">
<area shape="rect" alt="Package 58" coords="290,75,310,95" href="doodle.html" />
<area shape="rect" alt="Hyman Stadium" coords="69,10,215,42" href="doodle2.html" />
</map>

This works in Mozilla, but not IE. I had the same problem.

Signed,
gohankid77