This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1784 - Send warning for duplicated name attribute value
Summary: Send warning for duplicated name attribute value
Status: NEW
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.7.0
Hardware: All All
: P4 enhancement
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-20 04:09 UTC by Shin Saito
Modified: 2007-03-29 18:50 UTC (History)
0 users

See Also:


Attachments

Description Shin Saito 2005-07-20 04:09:42 UTC
Duplicated use of an anchor name cannot be detected.
For example, it passes the HTML code below:

<a name="top">Anchor 1</a>
<a name="top">Anchor 2</a>
Comment 1 Olivier Thereaux 2005-07-20 04:37:57 UTC
(In reply to comment #0)
> Duplicated use of an anchor name cannot be detected.
> For example, it passes the HTML code below:
> 
> <a name="top">Anchor 1</a>
> <a name="top">Anchor 2</a>

the "name" attribute is of type name, which means that unlike the "id" attribute, the name attribute has 
no constraint of uniqueness. As a result, the above is valid, and the validator parses it as such.

In an attempt at usefulness, one could imagine that the validator could throw a warning when detecting 
a duplicate name attribute. I am changing the bug title to show this idea, and marking it as 
enhancement request.

Note that in XHTML, the name attribute is deprecated.
http://www.w3.org/TR/xhtml1/#h-4.10

 The HTML compatibility guidelines recommend to use name="foo" id="foo". This recommendation is 
also a good idea for HTML4.
http://www.w3.org/TR/xhtml1/#C_8
Comment 2 Bj 2005-07-20 11:54:02 UTC
s/warning/error since it violates HTML conformance requirements.
I've implemented checks for this long ago in HTML Tidy...