Bugzilla – Bug 870
Improve diagnostio <area> without href
Last modified: 2015-04-13 19:26:02 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."
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.