NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 864 - Spurious error message "area tag needs href attribute"
Spurious error message "area tag needs href attribute"
Status: RESOLVED INTENTIONAL
Product: Validator.nu
Classification: Unclassified
Component: HTML5 schema
HEAD
All All
: P2 normal
Assigned To: Nobody
http://wilson.homeunix.com/area_valid...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-15 09:24 CEST by Torsten Bronger
Modified: 2011-10-15 12:44 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 Torsten Bronger 2011-10-15 09:24:30 CEST
If checking HTML5 with <area> tag without href attribute, the validator complains "XHTML element area is missing required attribute href".  However, http://www.whatwg.org/specs/web-apps/current-work/#attr-hyperlink-href states that the attribute is optional.
Comment 1 Michael[tm] Smith 2011-10-15 12:44:23 CEST
Do your area element also have an alt attribute? If it does, then it also must have an href attribute.

See the part of the spec where it says, "If the area element has no href attribute, then the area represented by the element cannot be selected, and the alt attribute must be omitted."

http://dev.w3.org/html5/spec/the-map-element.html#attr-area-alt

If your area element does not have an alt attribute and the validator is still reporting it as invalid, then please reopen this bug and provide a test case.