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

Re: Comments on Image maps in HTML5, coordinate and possible validator issues

From: Michael[tm] Smith <mike@w3.org>
Date: Thu, 19 Jul 2012 18:39:28 +0900
To: "Michael E. Ewing owner, Graphic Information Sciences" <admin@gisone.com>
Cc: public-html-comments@w3.org
Message-ID: <20120719093923.GA34224@sideshowbarker>
"Michael E. Ewing owner, Graphic Information Sciences" <admin@gisone.com>, 2012-07-11 08:00 +0000:

> Sample code:
> (this validates in 4.01 transitional, but not in HTML5):
> <MAP NAME="Map1">
> <AREA SHAPE="RECT" COORDS="25, 206, 90, 228" HREF="index.htm" alt="Our Home Page">
> .. . .
> (This validates in HTML5 and in 4.01 transitional:)

The only reason it validates in the HTML4 validator is that the HTML4
validator doesn't actually check the value of the coords attribute at all.
It'll accept any value you put there -- e.g., coords="foo + bar / baz".
Try it.

The HTML4 spec doesn't actually unambiguously state the precise
requirements on the value of coords. What it does have is here:


But there it does describe it as "comma-separated list of lengths", with no
mention of spaces being allowed in the list.

> <MAP NAME="Map1">
> <AREA SHAPE="RECT" COORDS="25,206,90,228" HREF="index.htm" alt="Our Home Page">
> .. . .

The HTML5 spec requires the value of coords to be a "valid list of
integers", which it defines clearly as:

  "A valid list of integers is a number of valid integers separated by
  U+002C COMMA characters, with no other characters (e.g. no space

So you can't have spaces in the value.

> The HTML5 validator identifies the error with the phrase "expecting a
> digit or "-" sign", which isn't very helpful in figuring out what is
> wrong.

Yeah the error message for this case should be improved; I've filed a
validator bug and will try to make time to fix it.



Michael[tm] Smith http://people.w3.org/mike
Received on Thursday, 19 July 2012 09:39:32 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:28 UTC