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

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

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

Michael[tm] Smith
"Michael E. Ewing owner, Graphic Information Sciences" <[hidden email]>, 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