NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 870 - Improve diagnostio <area> without href
Improve diagnostio <area> without href
Status: NEW
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-27 12:13 CEST by Jukka K. Korpela
Modified: 2015-04-13 19:26 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jukka K. Korpela 2011-10-27 12:13:35 CEST
The markup <area alt=foo> is flagged as erroneous, as it is, but the error message is somewhat misleading:

"Element area is missing required attribute href."
Comment 1 Jukka K. Korpela 2011-10-27 12:22:51 CEST
Sorry, I clicked on some wrong buttons... I meant to add the suggestion that the error message be modified e.g. to

"Element area requires attribute href when alt attribute is present"

or perhaps

"Element area does not allow alt attribute when href attribute is not present"

The current wording is confusing especially due to the following emphatic note:

"The href attribute on a and area elements is not required; when those elements do not have href attributes they do not create hyperlinks."

http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#attr-hyperlink-href

There are also some missing checks, as the current wording says:

"The target, download, ping, rel, media, hreflang, and type attributes must be omitted if the href attribute is not present."

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-map-element.html#the-area-element

Currently, of these only the download attribute is reported as an error. And there is a warning, not an error message, about the ping attribute.