NOTE: The current preferred location for bug reports is the GitHub issue tracker.
Bug 979 - <a name=foo id=bar> should be reported as an error
<a name=foo id=bar> should be reported as an error
Status: NEW
Product: Validator.nu
Classification: Unclassified
Component: General
HEAD
All All
: P2 normal
Assigned To: Nobody
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-26 10:05 CEST by Jukka K. Korpela
Modified: 2013-09-26 10:05 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jukka K. Korpela 2013-09-26 10:05:54 CEST
Minimal demo:

<!doctype html><title> </title>
<a name=foo id=bar>x</a>

This currently causes only a warning about the name attribute (and the warning is somewhat misleading when it says “Consider putting an id attribute on the nearest container instead.”; this note should be suppressed when the element itself has an id attribute).

It should additionally cause an error message, because HTML5 CR clause 11.1 says (and HTML 5.1 Nightly as of today hasn’t changed this):

“If this [name] attribute is present and the element has an ID, then the attribute's value must be equal to the element's ID.”

http://www.w3.org/TR/html5/obsolete.html#obsolete-but-conforming-features